diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2012-11-17 11:12:04 +0100 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2012-11-20 22:48:28 +0100 |
commit | 3d52083a274eaf92b1ef4c6e607e03374647a8c7 (patch) | |
tree | fba05a5d7bf0de59a93b1e5ffa4ce3962ff9190c /ffmpeg.c | |
parent | cc88734c3c2e93bc82bfdc90fc45a020fa499a9c (diff) | |
download | ffmpeg-3d52083a274eaf92b1ef4c6e607e03374647a8c7.tar.gz |
ffmpeg: rework debugging timestamp logs in process_input()
Print timestamps before and after ffmpeg timestamp postprocessing.
Help to debug how ffmpeg processes the input timestamps.
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 30 |
1 files changed, 19 insertions, 11 deletions
@@ -2750,6 +2750,17 @@ static int process_input(int file_index) if (ist->discard) goto discard_packet; + if (debug_ts) { + av_log(NULL, AV_LOG_INFO, "demuxer -> ist_index:%d type:%s " + "next_dts:%s next_dts_time:%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", + ifile->ist_index + pkt.stream_index, av_get_media_type_string(ist->st->codec->codec_type), + av_ts2str(ist->next_dts), av_ts2timestr(ist->next_dts, &AV_TIME_BASE_Q), + av_ts2str(ist->next_pts), av_ts2timestr(ist->next_pts, &AV_TIME_BASE_Q), + 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(!ist->wrap_correction_done && input_files[file_index]->ctx->start_time != AV_NOPTS_VALUE && ist->st->pts_wrap_bits < 64){ int64_t stime = av_rescale_q(input_files[file_index]->ctx->start_time, AV_TIME_BASE_Q, ist->st->time_base); int64_t stime2= stime + (1ULL<<ist->st->pts_wrap_bits); @@ -2775,17 +2786,6 @@ static int process_input(int file_index) if (pkt.dts != AV_NOPTS_VALUE) pkt.dts *= ist->ts_scale; - if (debug_ts) { - av_log(NULL, AV_LOG_INFO, "demuxer -> ist_index:%d type:%s " - "next_dts:%s next_dts_time:%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", - ifile->ist_index + pkt.stream_index, av_get_media_type_string(ist->st->codec->codec_type), - av_ts2str(ist->next_dts), av_ts2timestr(ist->next_dts, &AV_TIME_BASE_Q), - av_ts2str(ist->next_pts), av_ts2timestr(ist->next_pts, &AV_TIME_BASE_Q), - 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); @@ -2823,6 +2823,14 @@ static int process_input(int file_index) } } + if (debug_ts) { + av_log(NULL, AV_LOG_INFO, "demuxer+ffmpeg -> ist_index:%d type:%s pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s off:%"PRId64"\n", + ifile->ist_index + pkt.stream_index, av_get_media_type_string(ist->st->codec->codec_type), + 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); + } + sub2video_heartbeat(ist, pkt.pts); ret = output_packet(ist, &pkt); |