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

Aurelien Jacobs aurel
Wed Aug 5 00:00:44 CEST 2009


On Tue, Aug 04, 2009 at 09:10:23PM +0800, Zhou Zongyi wrote:
> 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.

This is already known as issue807 [1].

> 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?

IIRC the problem is that FFmpeg is missing a h264 parser that would
generate dts for streams which don't have it.

Aurel

[1] http://roundup.ffmpeg.org/roundup/ffmpeg/issue807



More information about the ffmpeg-devel mailing list