[FFmpeg-devel] [PATCH] VBR header for "libmp3lame"

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Apr 16 15:35:35 CEST 2011

On Fri, Apr 15, 2011 at 08:07:27PM +0200, Peter Belkner wrote:
> Hi,
> in case the switch "-aq" is provided to the "libmp3lame" codec a VBR
> MP3 is generated as e.g. in
>    ffmpeg -i a.wav -aq 2 b.mp3
> This corresponds to
>    lame -V2 a.wav b.m3
> Unfortunately no VBR header is written often leading to a completely
> wrong estimate of the duration during playback (cf. e.g. http://lists.mplayerhq.hu/pipermail/ffmpeg-user/2007-October/011573.html).
> The patch allows for writing the VBR header as generated by "libmp3lame.a".

Unfortunately I don't know what exactly the header contains, but I think
the whole approach is wrong and is likely to cause lots of issues in the
long term (e.g. that extradata will end up in mkv files as well, that might
even result in non-compliant files etc.).
IMO the demuxer (if copying) should extract that info somewhere, possibly
into metadata, and the encoder should set that and the muxer should use
this info to write whatever that format needs.

More information about the ffmpeg-devel mailing list