[FFmpeg-devel] [PATCH 3/6] lavf/mxfdec: fix stream time base for j2k codec with interlaced layout

Matthieu Bouron matthieu.bouron at gmail.com
Wed Jul 22 15:29:44 CEST 2015


Since two packets are required to decoded a frame, we need to divide by
a factor of 2 the stream time base so output ptses are correct.
---
 libavformat/mxfdec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index c966a0a..90abea5 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -2057,6 +2057,9 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
 
                     av_dict_set(&st->metadata, "mxf_field_dominance", buf, 0);
                     av_log(mxf->fc, AV_LOG_INFO, "Use filtergraph setfield=mode=%s,tinterlace to get full frames\n", buf);
+
+                    st->codec->time_base = st->time_base;
+                    st->time_base = (AVRational) { st->time_base.num, st->time_base.den * 2};
                 }
                 break;
             case AV_CODEC_ID_RAWVIDEO:
-- 
2.4.6



More information about the ffmpeg-devel mailing list