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
290da7e7
Commit
290da7e7
authored
Jan 25, 2014
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg: tweak debug_ts logging and add more of it
Help with debugging timestamp issues.
parent
60251c13
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
6 deletions
+33
-6
ffmpeg.c
ffmpeg.c
+33
-6
No files found.
ffmpeg.c
View file @
290da7e7
...
...
@@ -707,6 +707,12 @@ static void do_audio_out(AVFormatContext *s, OutputStream *ost,
av_assert0
(
pkt
.
size
||
!
pkt
.
data
);
update_benchmark
(
NULL
);
if
(
debug_ts
)
{
av_log
(
NULL
,
AV_LOG_INFO
,
"encoder <- type:audio "
"frame_pts:%s frame_pts_time:%s time_base:%d/%d
\n
"
,
av_ts2str
(
frame
->
pts
),
av_ts2timestr
(
frame
->
pts
,
&
enc
->
time_base
),
enc
->
time_base
.
num
,
enc
->
time_base
.
den
);
}
if
(
avcodec_encode_audio2
(
enc
,
&
pkt
,
frame
,
&
got_packet
)
<
0
)
{
av_log
(
NULL
,
AV_LOG_FATAL
,
"Audio encoding failed (avcodec_encode_audio2)
\n
"
);
exit_program
(
1
);
...
...
@@ -981,6 +987,13 @@ static void do_video_out(AVFormatContext *s,
}
update_benchmark
(
NULL
);
if
(
debug_ts
)
{
av_log
(
NULL
,
AV_LOG_INFO
,
"encoder <- type:video "
"frame_pts:%s frame_pts_time:%s time_base:%d/%d
\n
"
,
av_ts2str
(
in_picture
->
pts
),
av_ts2timestr
(
in_picture
->
pts
,
&
enc
->
time_base
),
enc
->
time_base
.
num
,
enc
->
time_base
.
den
);
}
ret
=
avcodec_encode_video2
(
enc
,
&
pkt
,
in_picture
,
&
got_packet
);
update_benchmark
(
"encode_video %d.%d"
,
ost
->
file_index
,
ost
->
index
);
if
(
ret
<
0
)
{
...
...
@@ -989,6 +1002,13 @@ static void do_video_out(AVFormatContext *s,
}
if
(
got_packet
)
{
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
,
&
enc
->
time_base
),
av_ts2str
(
pkt
.
dts
),
av_ts2timestr
(
pkt
.
dts
,
&
enc
->
time_base
));
}
if
(
pkt
.
pts
==
AV_NOPTS_VALUE
&&
!
(
enc
->
codec
->
capabilities
&
CODEC_CAP_DELAY
))
pkt
.
pts
=
ost
->
sync_opts
;
...
...
@@ -1128,6 +1148,12 @@ static int reap_filters(void)
if
(
!
ost
->
frame_aspect_ratio
.
num
)
enc
->
sample_aspect_ratio
=
filtered_frame
->
sample_aspect_ratio
;
if
(
debug_ts
)
{
av_log
(
NULL
,
AV_LOG_INFO
,
"filter -> pts:%s pts_time:%s time_base:%d/%d
\n
"
,
av_ts2str
(
filtered_frame
->
pts
),
av_ts2timestr
(
filtered_frame
->
pts
,
&
enc
->
time_base
),
enc
->
time_base
.
num
,
enc
->
time_base
.
den
);
}
do_video_out
(
of
->
ctx
,
ost
,
filtered_frame
);
break
;
case
AVMEDIA_TYPE_AUDIO
:
...
...
@@ -1751,12 +1777,13 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output)
if
(
debug_ts
)
{
av_log
(
NULL
,
AV_LOG_INFO
,
"decoder -> ist_index:%d type:video "
"frame_pts:%s frame_pts_time:%s best_effort_ts:%"
PRId64
" best_effort_ts_time:%s keyframe:%d frame_type:%d
\n
"
,
"frame_pts:%s frame_pts_time:%s best_effort_ts:%"
PRId64
" best_effort_ts_time:%s keyframe:%d frame_type:%d time_base:%d/%d
\n
"
,
ist
->
st
->
index
,
av_ts2str
(
decoded_frame
->
pts
),
av_ts2timestr
(
decoded_frame
->
pts
,
&
ist
->
st
->
time_base
),
best_effort_timestamp
,
av_ts2timestr
(
best_effort_timestamp
,
&
ist
->
st
->
time_base
),
decoded_frame
->
key_frame
,
decoded_frame
->
pict_type
);
decoded_frame
->
key_frame
,
decoded_frame
->
pict_type
,
ist
->
st
->
time_base
.
num
,
ist
->
st
->
time_base
.
den
);
}
pkt
->
size
=
0
;
...
...
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