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
5d12b83f
Commit
5d12b83f
authored
Jan 20, 2012
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg.c: implement -debug_ts option
Mostly useful for debugging purposes.
parent
18692375
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
4 deletions
+35
-4
ffmpeg.texi
doc/ffmpeg.texi
+8
-0
ffmpeg.c
ffmpeg.c
+27
-4
No files found.
doc/ffmpeg.texi
View file @
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
View file @
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"
},
...
...
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