Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
4e9e6fa9
Commit
4e9e6fa9
authored
Aug 08, 2014
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpeg: Write H264 streams at offset 2
It hints that the content is H264 according to HD-DVD.
parent
a4d3c200
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
mpeg.h
libavformat/mpeg.h
+1
-0
mpegenc.c
libavformat/mpegenc.c
+9
-4
No files found.
libavformat/mpeg.h
View file @
4e9e6fa9
...
...
@@ -40,6 +40,7 @@
#define AUDIO_ID 0xc0
#define VIDEO_ID 0xe0
#define H264_ID 0xe2
#define AC3_ID 0x80
#define DTS_ID 0x8a
#define LPCM_ID 0xa0
...
...
libavformat/mpegenc.c
View file @
4e9e6fa9
...
...
@@ -301,7 +301,7 @@ static int get_system_header_size(AVFormatContext *ctx)
static
av_cold
int
mpeg_mux_init
(
AVFormatContext
*
ctx
)
{
MpegMuxContext
*
s
=
ctx
->
priv_data
;
int
bitrate
,
i
,
mpa_id
,
mpv_id
,
mps_id
,
ac3_id
,
dts_id
,
lpcm_id
,
j
;
int
bitrate
,
i
,
mpa_id
,
mpv_id
,
h264_id
,
mps_id
,
ac3_id
,
dts_id
,
lpcm_id
,
j
;
AVStream
*
st
;
StreamInfo
*
stream
;
int
audio_bitrate
;
...
...
@@ -337,6 +337,7 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
ac3_id
=
AC3_ID
;
dts_id
=
DTS_ID
;
mpv_id
=
VIDEO_ID
;
h264_id
=
H264_ID
;
mps_id
=
SUB_ID
;
lpcm_id
=
LPCM_ID
;
...
...
@@ -379,7 +380,10 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
s
->
audio_bound
++
;
break
;
case
AVMEDIA_TYPE_VIDEO
:
stream
->
id
=
mpv_id
++
;
if
(
st
->
codec
->
codec_id
==
AV_CODEC_ID_H264
)
stream
->
id
=
h264_id
++
;
else
stream
->
id
=
mpv_id
++
;
if
(
st
->
codec
->
rc_buffer_size
)
stream
->
max_buffer_size
=
6
*
1024
+
st
->
codec
->
rc_buffer_size
/
8
;
else
{
...
...
@@ -409,7 +413,8 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
st
=
ctx
->
streams
[
i
];
stream
=
(
StreamInfo
*
)
st
->
priv_data
;
if
(
st
->
codec
->
rc_max_rate
||
stream
->
id
==
VIDEO_ID
)
if
(
st
->
codec
->
rc_max_rate
||
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_VIDEO
)
codec_rate
=
st
->
codec
->
rc_max_rate
;
else
codec_rate
=
st
->
codec
->
bit_rate
;
...
...
@@ -421,7 +426,7 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
if
((
stream
->
id
&
0xe0
)
==
AUDIO_ID
)
audio_bitrate
+=
codec_rate
;
else
if
(
st
ream
->
id
==
VIDEO_ID
)
else
if
(
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_VIDEO
)
video_bitrate
+=
codec_rate
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment