Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
af6058d0
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,体验更适合开发者的 AI 搜索 >>
提交
af6058d0
编写于
4月 11, 2018
作者:
V
Vishwanath Dixit
提交者:
Karthick Jeyapal
4月 17, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
avformat/dashenc: constructing MPD's bandwidth string locally
上级
0c7bc7eb
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
9 addition
and
11 deletion
+9
-11
libavformat/dashenc.c
libavformat/dashenc.c
+9
-11
未找到文件。
libavformat/dashenc.c
浏览文件 @
af6058d0
...
...
@@ -78,7 +78,6 @@ typedef struct OutputStream {
int64_t
first_pts
,
start_pts
,
max_pts
;
int64_t
last_dts
;
int
bit_rate
;
char
bandwidth_str
[
64
];
char
codec_str
[
100
];
int
written_len
;
...
...
@@ -549,20 +548,25 @@ static int write_adaptation_set(AVFormatContext *s, AVIOContext *out, int as_ind
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
{
OutputStream
*
os
=
&
c
->
streams
[
i
];
char
bandwidth_str
[
64
]
=
{
'\0'
};
if
(
os
->
as_idx
-
1
!=
as_index
)
continue
;
if
(
os
->
bit_rate
>
0
)
snprintf
(
bandwidth_str
,
sizeof
(
bandwidth_str
),
" bandwidth=
\"
%d
\"
"
,
os
->
bit_rate
);
if
(
as
->
media_type
==
AVMEDIA_TYPE_VIDEO
)
{
AVStream
*
st
=
s
->
streams
[
i
];
avio_printf
(
out
,
"
\t\t\t
<Representation id=
\"
%d
\"
mimeType=
\"
video/%s
\"
codecs=
\"
%s
\"
%s width=
\"
%d
\"
height=
\"
%d
\"
"
,
i
,
os
->
format_name
,
os
->
codec_str
,
os
->
bandwidth_str
,
s
->
streams
[
i
]
->
codecpar
->
width
,
s
->
streams
[
i
]
->
codecpar
->
height
);
i
,
os
->
format_name
,
os
->
codec_str
,
bandwidth_str
,
s
->
streams
[
i
]
->
codecpar
->
width
,
s
->
streams
[
i
]
->
codecpar
->
height
);
if
(
st
->
avg_frame_rate
.
num
)
avio_printf
(
out
,
" frameRate=
\"
%d/%d
\"
"
,
st
->
avg_frame_rate
.
num
,
st
->
avg_frame_rate
.
den
);
avio_printf
(
out
,
">
\n
"
);
}
else
{
avio_printf
(
out
,
"
\t\t\t
<Representation id=
\"
%d
\"
mimeType=
\"
audio/%s
\"
codecs=
\"
%s
\"
%s audioSamplingRate=
\"
%d
\"
>
\n
"
,
i
,
os
->
format_name
,
os
->
codec_str
,
os
->
bandwidth_str
,
s
->
streams
[
i
]
->
codecpar
->
sample_rate
);
i
,
os
->
format_name
,
os
->
codec_str
,
bandwidth_str
,
s
->
streams
[
i
]
->
codecpar
->
sample_rate
);
avio_printf
(
out
,
"
\t\t\t\t
<AudioChannelConfiguration schemeIdUri=
\"
urn:mpeg:dash:23003:3:audio_channel_configuration:2011
\"
value=
\"
%d
\"
/>
\n
"
,
s
->
streams
[
i
]
->
codecpar
->
channels
);
}
...
...
@@ -918,10 +922,7 @@ static int dash_init(AVFormatContext *s)
char
filename
[
1024
];
os
->
bit_rate
=
s
->
streams
[
i
]
->
codecpar
->
bit_rate
;
if
(
os
->
bit_rate
)
{
snprintf
(
os
->
bandwidth_str
,
sizeof
(
os
->
bandwidth_str
),
" bandwidth=
\"
%d
\"
"
,
os
->
bit_rate
);
}
else
{
if
(
!
os
->
bit_rate
)
{
int
level
=
s
->
strict_std_compliance
>=
FF_COMPLIANCE_STRICT
?
AV_LOG_ERROR
:
AV_LOG_WARNING
;
av_log
(
s
,
level
,
"No bit rate set for stream %d
\n
"
,
i
);
...
...
@@ -1236,11 +1237,8 @@ static int dash_flush(AVFormatContext *s, int final, int stream)
int64_t
bitrate
=
(
int64_t
)
range_length
*
8
*
AV_TIME_BASE
/
av_rescale_q
(
os
->
max_pts
-
os
->
start_pts
,
st
->
time_base
,
AV_TIME_BASE_Q
);
if
(
bitrate
>=
0
)
{
if
(
bitrate
>=
0
)
os
->
bit_rate
=
bitrate
;
snprintf
(
os
->
bandwidth_str
,
sizeof
(
os
->
bandwidth_str
),
" bandwidth=
\"
%d
\"
"
,
os
->
bit_rate
);
}
}
add_segment
(
os
,
os
->
filename
,
os
->
start_pts
,
os
->
max_pts
-
os
->
start_pts
,
os
->
pos
,
range_length
,
index_length
);
av_log
(
s
,
AV_LOG_VERBOSE
,
"Representation %d media segment %d written to: %s
\n
"
,
i
,
os
->
segment_index
,
os
->
full_path
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录