[FFmpeg-devel] [PATCH] ffmpeg: add debug_ts trace to show what is fed up to the muxer

Stefano Sabatini stefasab at gmail.com
Thu Sep 6 15:11:12 CEST 2012


This is useful, as ffmpeg the application may tweak PTS/DTS values.
---
 ffmpeg.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 2763db6..65daaee 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -566,6 +566,15 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
     }
 
     pkt->stream_index = ost->index;
+
+    if (debug_ts) {
+        av_log(NULL, AV_LOG_INFO, "muxer <- stream:%d#%d type:%s "
+               "pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s\n",
+               ost->file_index, pkt->stream_index, av_get_media_type_string(ost->st->codec->codec_type),
+               av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &ost->st->time_base),
+               av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &ost->st->time_base));
+    }
+
     ret = av_interleaved_write_frame(s, pkt);
     if (ret < 0) {
         print_error("av_interleaved_write_frame()", ret);
-- 
1.7.5.4



More information about the ffmpeg-devel mailing list