[FFmpeg-devel] Lib lame mp3 and quality setting

christophelorenz christophelorenz
Tue Feb 5 17:11:54 CET 2008

While there's some discussions about mp3 ;-)

Looking at lame mp3 code, I found this

    /* lame 3.91 dies on quality != 5 */
    lame_set_quality(s->gfp, 5);
    /* lame 3.91 doesn't work in mono */
    lame_set_mode(s->gfp, JOINT_STEREO);

It is present since the first appearance of the source file on svn...
Lame mp3 is now at 3.97 and I haven't noticed any problem with quality 
!= 5. (not yet tried mono mode)

Wouldn't it be interresting to enhance quality of the encoding following 
the -aq value ?
The the audio quality value is already used in the codec to switch on 
VBR encoding (and VBR quality)

I see three possible ways of having control over this :
-Use negative values for VBR encoding, and positive for CBR. (But that 
differs from the 0-1 range the doc defines.)
-Add a flag to enable VBR audio and control quality with -aq.
-Change the range of -aq so that :
   0->0.4999 is VBR quality 0->5
   5->1 is CBR quality 5->lowest quality.

There's a significative quality improvement when comparing Q=0 with Q=5 
for lame, and I think using it should seriously be considered.


More information about the ffmpeg-devel mailing list