GNOME Bugzilla – Bug 368681
avimux + vbr lame always out of sync
Last modified: 2009-10-16 15:33:54 UTC
The pipeline gst-launch-0.10 dvdreadsrc ! dvddemux name=demux demux. ! queue ! mpeg2dec ! ffmpegcolorspace ! ffenc_mpeg4 ! avimux name=mux ! filesink location=... demux. ! queue ! a52dec ! audioconvert ! lame vbr=abr ! mux. will seemingly always produce output files with the audio and video out of sync (when played back with any of totem-gst, MPlayer, Xine or VLC). Replacing ffenc_mpeg4 with xvidenc or any other video encoder that can output into AVI doesn't seem to make a difference. Replacing avimux with matroskamux produces a properly syncronised output file. Leaving out the "vbr" property (so that lame defaults to constant bitrate) produces an sync'd file. Interestingly however, replacing lame with vorbisenc, which always gives VBR output, also produces an in-sync file. As such, I'm not sure whether this is a bug in avimux or in lame. If you need any more info please let me know.
This is probably avimux's fault, but could also be lame, which has had some fixes lately. Feel free to re-assign to -ugly if it's lame's fault.
This is an interaction between Lame (libmp3lame, not just the Gstreamer plugin) and muxing VBR audio within AVI. The same problem also happens with many other AVI muxers. Problems: *AVI is not really friendly with VBR audio *libmp3lame outputs raw data, but doesn't carry framing info to the caller.
Following commit should fix MP3 VBR muxing in AVI, *provided* the input is properly parsed (as so indicated by caps), e.g. as in mp3parse ! avimux. commit 8f2beb5e51a179b34f50863101ac3e4d17ed1483 Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> Date: Fri Oct 16 17:28:09 2009 +0200 avimux: support (some) VBR audio muxing AVI format can handle VBR audio provided audio chunks are of fixed duration (cfr fixed duration video frames). Apply this approach to (always) parsed raw AAC and (if parsed) to MPEG-1/2 audio. See #368681.