Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
4e9e6fa9
F
Ffmpeg
项目概览
小白菜888
/
Ffmpeg
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Ffmpeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4e9e6fa9
编写于
8月 08, 2014
作者:
L
Luca Barbato
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mpeg: Write H264 streams at offset 2
It hints that the content is H264 according to HD-DVD.
上级
a4d3c200
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
10 addition
and
4 deletion
+10
-4
libavformat/mpeg.h
libavformat/mpeg.h
+1
-0
libavformat/mpegenc.c
libavformat/mpegenc.c
+9
-4
未找到文件。
libavformat/mpeg.h
浏览文件 @
4e9e6fa9
...
@@ -40,6 +40,7 @@
...
@@ -40,6 +40,7 @@
#define AUDIO_ID 0xc0
#define AUDIO_ID 0xc0
#define VIDEO_ID 0xe0
#define VIDEO_ID 0xe0
#define H264_ID 0xe2
#define AC3_ID 0x80
#define AC3_ID 0x80
#define DTS_ID 0x8a
#define DTS_ID 0x8a
#define LPCM_ID 0xa0
#define LPCM_ID 0xa0
...
...
libavformat/mpegenc.c
浏览文件 @
4e9e6fa9
...
@@ -301,7 +301,7 @@ static int get_system_header_size(AVFormatContext *ctx)
...
@@ -301,7 +301,7 @@ static int get_system_header_size(AVFormatContext *ctx)
static
av_cold
int
mpeg_mux_init
(
AVFormatContext
*
ctx
)
static
av_cold
int
mpeg_mux_init
(
AVFormatContext
*
ctx
)
{
{
MpegMuxContext
*
s
=
ctx
->
priv_data
;
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
;
AVStream
*
st
;
StreamInfo
*
stream
;
StreamInfo
*
stream
;
int
audio_bitrate
;
int
audio_bitrate
;
...
@@ -337,6 +337,7 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
...
@@ -337,6 +337,7 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
ac3_id
=
AC3_ID
;
ac3_id
=
AC3_ID
;
dts_id
=
DTS_ID
;
dts_id
=
DTS_ID
;
mpv_id
=
VIDEO_ID
;
mpv_id
=
VIDEO_ID
;
h264_id
=
H264_ID
;
mps_id
=
SUB_ID
;
mps_id
=
SUB_ID
;
lpcm_id
=
LPCM_ID
;
lpcm_id
=
LPCM_ID
;
...
@@ -379,7 +380,10 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
...
@@ -379,7 +380,10 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
s
->
audio_bound
++
;
s
->
audio_bound
++
;
break
;
break
;
case
AVMEDIA_TYPE_VIDEO
:
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
)
if
(
st
->
codec
->
rc_buffer_size
)
stream
->
max_buffer_size
=
6
*
1024
+
st
->
codec
->
rc_buffer_size
/
8
;
stream
->
max_buffer_size
=
6
*
1024
+
st
->
codec
->
rc_buffer_size
/
8
;
else
{
else
{
...
@@ -409,7 +413,8 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
...
@@ -409,7 +413,8 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
st
=
ctx
->
streams
[
i
];
st
=
ctx
->
streams
[
i
];
stream
=
(
StreamInfo
*
)
st
->
priv_data
;
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
;
codec_rate
=
st
->
codec
->
rc_max_rate
;
else
else
codec_rate
=
st
->
codec
->
bit_rate
;
codec_rate
=
st
->
codec
->
bit_rate
;
...
@@ -421,7 +426,7 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
...
@@ -421,7 +426,7 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
if
((
stream
->
id
&
0xe0
)
==
AUDIO_ID
)
if
((
stream
->
id
&
0xe0
)
==
AUDIO_ID
)
audio_bitrate
+=
codec_rate
;
audio_bitrate
+=
codec_rate
;
else
if
(
st
ream
->
id
==
VIDEO_ID
)
else
if
(
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_VIDEO
)
video_bitrate
+=
codec_rate
;
video_bitrate
+=
codec_rate
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录