[FFmpeg-devel] [Bug] Problem on remuxing AVC in mkv to mp4, how to fix it?

Zhou Zongyi zhouzy
Tue Aug 4 15:10:23 CEST 2009

Hi all,
When using the following command line to remux AVC in mkv (with b-frames) to mp4,
ffmpeg -i avc.mkv -vcodec copy avc.mp4
FFmpeg complains about "non monotone timestamps" and exits.

I tried skipping that check in util.c and it gave me broken mp4 files.
mkv->mkv is broken as well if it contain audio streams, while mp4->mp4 and mp4->mkv works just fine.

Since matroska does not provide dts (mp4 does), ffmpeg assumes dts = pts, which is completely wrong if b-frames are used.
Is that where the problem is and can anybody give suggestions on how to fix that?

Zhou Zongyi,
zhouzy at os.pku.edu.cn 

More information about the ffmpeg-devel mailing list