Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
5d12b83f
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,发现更多精彩内容 >>
提交
5d12b83f
编写于
1月 20, 2012
作者:
S
Stefano Sabatini
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ffmpeg.c: implement -debug_ts option
Mostly useful for debugging purposes.
上级
18692375
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
35 addition
and
4 deletion
+35
-4
doc/ffmpeg.texi
doc/ffmpeg.texi
+8
-0
ffmpeg.c
ffmpeg.c
+27
-4
未找到文件。
doc/ffmpeg.texi
浏览文件 @
5d12b83f
...
...
@@ -230,6 +230,14 @@ Specify the preset for matching stream(s).
@item -stats (@emph
{
global
}
)
Print encoding progress/statistics. On by default.
@item -debug
_
ts (@emph
{
global
}
)
Print timestamp information. It is off by default. This option is
mostly useful for testing and debugging purposes, and the output
format may change from one version to another, so it should not be
employed by portable scripts.
See also the option @code
{
-fdebug ts
}
.
@item -attach @var
{
filename
}
(@emph
{
output
}
)
Add an attachment to the output file. This is supported by a few formats
like Matroska for e.g. fonts used in rendering subtitles. Attachments
...
...
ffmpeg.c
浏览文件 @
5d12b83f
...
...
@@ -49,6 +49,7 @@
#include "libavutil/avstring.h"
#include "libavutil/libm.h"
#include "libavutil/imgutils.h"
#include "libavutil/timestamp.h"
#include "libavformat/os_support.h"
#include "libswresample/swresample.h"
...
...
@@ -174,6 +175,7 @@ static float dts_delta_threshold = 10;
static
float
dts_error_threshold
=
3600
*
30
;
static
int
print_stats
=
1
;
static
int
debug_ts
=
0
;
static
uint8_t
*
audio_buf
;
static
unsigned
int
allocated_audio_buf_size
;
...
...
@@ -1107,6 +1109,13 @@ static int encode_audio_frame(AVFormatContext *s, OutputStream *ost,
av_free_packet
(
&
pkt
);
}
if
(
debug_ts
)
{
av_log
(
NULL
,
AV_LOG_INFO
,
"encoder -> type:audio "
"pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s
\n
"
,
av_ts2str
(
pkt
.
pts
),
av_ts2timestr
(
pkt
.
pts
,
&
ost
->
st
->
time_base
),
av_ts2str
(
pkt
.
dts
),
av_ts2timestr
(
pkt
.
dts
,
&
ost
->
st
->
time_base
));
}
return
ret
;
}
...
...
@@ -1611,6 +1620,13 @@ static void do_video_out(AVFormatContext *s, OutputStream *ost,
if
(
pkt
.
dts
!=
AV_NOPTS_VALUE
)
pkt
.
dts
=
av_rescale_q
(
pkt
.
dts
,
enc
->
time_base
,
ost
->
st
->
time_base
);
if
(
debug_ts
)
{
av_log
(
NULL
,
AV_LOG_INFO
,
"encoder -> type:video "
"pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s
\n
"
,
av_ts2str
(
pkt
.
pts
),
av_ts2timestr
(
pkt
.
pts
,
&
ost
->
st
->
time_base
),
av_ts2str
(
pkt
.
dts
),
av_ts2timestr
(
pkt
.
dts
,
&
ost
->
st
->
time_base
));
}
if
(
format_video_sync
==
VSYNC_DROP
)
pkt
.
pts
=
pkt
.
dts
=
AV_NOPTS_VALUE
;
...
...
@@ -3003,10 +3019,16 @@ static int transcode(OutputFile *output_files, int nb_output_files,
if
(
pkt
.
dts
!=
AV_NOPTS_VALUE
)
pkt
.
dts
*=
ist
->
ts_scale
;
//fprintf(stderr, "next:%"PRId64" dts:%"PRId64"/%"PRId64" off:%"PRId64" %d\n",
// ist->next_dts,
// ist->dts, av_rescale_q(pkt.dts, ist->st->time_base, AV_TIME_BASE_Q), input_files[ist->file_index].ts_offset,
// ist->st->codec->codec_type);
if
(
debug_ts
)
{
av_log
(
NULL
,
AV_LOG_INFO
,
"demuxer -> ist_index:%d type:%s "
"next_pts:%s next_pts_time:%s pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s off:%"
PRId64
"
\n
"
,
ist_index
,
av_get_media_type_string
(
ist
->
st
->
codec
->
codec_type
),
av_ts2str
(
ist
->
next_pts
),
av_ts2timestr
(
ist
->
next_pts
,
&
ist
->
st
->
time_base
),
av_ts2str
(
pkt
.
pts
),
av_ts2timestr
(
pkt
.
pts
,
&
ist
->
st
->
time_base
),
av_ts2str
(
pkt
.
dts
),
av_ts2timestr
(
pkt
.
dts
,
&
ist
->
st
->
time_base
),
input_files
[
ist
->
file_index
].
ts_offset
);
}
if
(
pkt
.
dts
!=
AV_NOPTS_VALUE
&&
ist
->
next_dts
!=
AV_NOPTS_VALUE
&&
!
copy_ts
)
{
int64_t
pkt_dts
=
av_rescale_q
(
pkt
.
dts
,
ist
->
st
->
time_base
,
AV_TIME_BASE_Q
);
int64_t
delta
=
pkt_dts
-
ist
->
next_dts
;
...
...
@@ -4979,6 +5001,7 @@ static const OptionDef options[] = {
{
"stats"
,
OPT_BOOL
,
{
&
print_stats
},
"print progress report during encoding"
,
},
{
"attach"
,
HAS_ARG
|
OPT_FUNC2
,
{(
void
*
)
opt_attach
},
"add an attachment to the output file"
,
"filename"
},
{
"dump_attachment"
,
HAS_ARG
|
OPT_STRING
|
OPT_SPEC
,
{.
off
=
OFFSET
(
dump_attachment
)},
"extract an attachment into a file"
,
"filename"
},
{
"debug_ts"
,
OPT_BOOL
|
OPT_EXPERT
,
{
&
debug_ts
},
"print timestamp debugging info"
},
/* video options */
{
"vframes"
,
HAS_ARG
|
OPT_VIDEO
|
OPT_FUNC2
,
{(
void
*
)
opt_video_frames
},
"set the number of video frames to record"
,
"number"
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录