[FFmpeg-trac] #3967(avcodec:new): suboptimal mp3 encoding, non-identical to lame(1)

FFmpeg trac at avcodec.org
Sun Sep 21 23:55:40 CEST 2014


#3967: suboptimal mp3 encoding, non-identical to lame(1)
---------------------------------+---------------------------------------
             Reporter:  svpv     |                     Type:  defect
               Status:  new      |                 Priority:  normal
            Component:  avcodec  |                  Version:  unspecified
             Keywords:           |               Blocked By:
             Blocking:           |  Reproduced by developer:  0
Analyzed by developer:  0        |
---------------------------------+---------------------------------------
 In libavcodec/libmp3lame.c, algorithmic quality is set to 5 by default.
 However, lame(1) internally uses the default value of 3.  Thus ffmpeg
 prefers faster encodes while compromising the quality and/or producing
 larger output.  Specifically, in VBR mode, when compared to lame(1),
 mp3 files written by ffmpeg take about 2% more space.

 {{{
 $ lame -V2 in.wav out1.mp3
 ...
 $ ffmpeg -i in.wav -aq 2 out2.mp3
 ...
 $ diff -U1 <(mp3packer -i out1.mp3) <(mp3packer -i out2.mp3)
 ...
 - 700795 bytes in file (186.624755 kbps)
 - 700378 bytes in MP3 frames (186.513707 kbps) = current bitrate
 ...
 + 715329 bytes in file (190.495223 kbps)
 + 714838 bytes in MP3 frames (190.364467 kbps) = current bitrate
 ...
   Bitrate distribution:
 -  112: 1,0
 -  128: 2,0
 -  160: 270,0
 -  192: 792,0
 -  224: 82,0
 +   96: 1,0
 +  128: 3,0
 +  160: 186,0
 +  192: 818,0
 +  224: 139,0
    256: 3,0
 ...
 }}}

 The fix is rather trivial.  Although the default/recommended algorithmic
 quality is not specified by libmp3lame API, it is simply used by default,
 and need not be set explicitly.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/3967>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list