[FFmpeg-devel] Patch - Allow disabling of bit reservoir when encoding MP3 audio

Rich Felker dalias
Tue Feb 5 07:52:44 CET 2008

On Tue, Feb 05, 2008 at 12:40:18AM +0000, Paul Kelly wrote:
> Hello,
> May I suggest the attached patch for possible inclusion - as the subject 
> suggests, it allows the user to disable use of the bit reservoir through 
> the libavcodec API, when using libmp3lame to encode MP3. While generally 
> not considered a desirable thing to do due to it lowering the quality 
> slightly, disabling the bit reservoir is nonetheless useful when splitting 
> encoded output between different files, to avoid audio artefacts at the 
> start of a new file caused when some of the data for the first frame was 
> included in previous frames.
> Have I taken the right approach? Or is this not the right way and should 
> the codec always be closed and re-opened when splitting the output between 
> files? (I don't want to do this in my application because the initial 
> encoding delay will complicate things...)

Personally I would say just always disable bit reservoir. It's a dumb
[mis-]feature. If VBR is desired then use honest VBR mode, not this
ugly hack of coding bits into the wrong frames...


More information about the ffmpeg-devel mailing list