[Matroska-users] Convert mkv to mp4 - audio video sync issue

salsaman at xs4all.nl salsaman at xs4all.nl
Sun Nov 22 19:32:52 CET 2009

On Sun, November 22, 2009 19:11, Bachman Kharazmi wrote:
> Hi
> Anyone who knows if mp4 container format is troublesome to get lipsync
> with?
> I have big problems with audio/video out of sync when writing
> audio/video streams to a mp4muxer. I can successfully use a
> matroskamuxer instead and the a/v are
> perfectly synced. I have with such video even tried to do conversion
> (demux and mux) from mkv container to mp4 using mencoder and
> gst-mp4mux, and it didn't help. Still sync problems in the mp4 output
> :(
> The video is h264 and audio is AAC.
> Please see mkvinfo at the end of this email.
> The gst-launch line I tested with is:
> gst-launch -v filesrc location=out.mkv ! matroskademux name=d mp4mux
> name=m ! filesink  location=foo.mp4 d.video_00 ! queue ! m.video_00
> d.audio_00 ! queue ! m.audio_00
> And mencoder like:
> mencoder out.mkv -of lavf -lavfopts format=mp4 -oac lavc -ovc lavc -o
> outfoo.mp4
> I know that mkvextract can extract track1,track2,timestamps. Are there
> any free linux tools that can take them as input and properly put it
> in a mp4 container?

You could try decoding and re-encoding with LiVES:


More information about the Matroska-users mailing list