[FFmpeg-trac] #8763(undetermined:new): ffmpeg doesn't output lame vbr header correctly

FFmpeg trac at avcodec.org
Mon Jun 29 11:32:11 EEST 2020


#8763: ffmpeg doesn't output lame vbr header correctly
--------------------------------------+----------------------------------
             Reporter:  spotter       |                     Type:  defect
               Status:  new           |                 Priority:  normal
            Component:  undetermined  |                  Version:  4.2
             Keywords:                |               Blocked By:
             Blocking:                |  Reproduced by developer:  0
Analyzed by developer:  0             |
--------------------------------------+----------------------------------
 Summary of the bug: lame includes the xing header that defines the VBR
 quality level that was used.  ffmpeg inserts the header, but seems to
 include incorrect values.

 one can see this by inspecting the file with mediainfo a file encoded with
 lame -V0 shows

 Audio
 Format                                   : MPEG Audio
 Format version                           : Version 1
 Format profile                           : Layer 3
 Format settings                          : Joint stereo
 Duration                                 : 3 min 56 s
 Bit rate mode                            : Variable
 Bit rate                                 : 280 kb/s
 Minimum bit rate                         : 32.0 kb/s
 Channel(s)                               : 2 channels
 Sampling rate                            : 44.1 kHz
 Frame rate                               : 38.281 FPS (1152 SPF)
 Compression mode                         : Lossy
 Stream size                              : 7.89 MiB (100%)
 Writing library                          : LAME3.100
 Encoding settings                        : -m j -V 0 -q 0 -lowpass 22.1
 --vbr-new -b 32

 while a file encoded with ffmpeg -q:a 0 (per
 https://trac.ffmpeg.org/wiki/Encode/MP3)

 shows

 Format                                   : MPEG Audio
 Format version                           : Version 1
 Format profile                           : Layer 3
 Format settings                          : Joint stereo
 Duration                                 : 3 min 56 s
 Bit rate mode                            : Variable
 Bit rate                                 : 280 kb/s
 Channel(s)                               : 2 channels
 Sampling rate                            : 44.1 kHz
 Frame rate                               : 38.281 FPS (1152 SPF)
 Compression mode                         : Lossy
 Stream size                              : 7.89 MiB (100%)
 Writing library                          : LAME3.100

 so first thing we note is data seems to be the same, but ffmpeg doesn't
 include the Encoder settings.  so what happens if we use ffmpeg to copy
 the lame encoded file (above) into an mp3 (in this case, getting the id3
 tags from another file)

 then we see

 Audio
 Format                                   : MPEG Audio
 Format version                           : Version 1
 Format profile                           : Layer 3
 Format settings                          : Joint stereo
 Duration                                 : 3 min 56 s
 Bit rate mode                            : Variable
 Bit rate                                 : 280 kb/s
 Channel(s)                               : 2 channels
 Sampling rate                            : 44.1 kHz
 Frame rate                               : 38.281 FPS (1152 SPF)
 Compression mode                         : Lossy
 Stream size                              : 7.89 MiB (100%)
 Writing library                          : LAME3.100
 Encoding settings                        : -m m -V 10 -q 0

 that's weird. it now output the encoding settings, but messed with them.

 inspecting the all 3 files with Mpeg Audio Info (which can decode the xing
 header, haven't found a linux utility that can do it, but it runs in wine
 without a problem, https://www.codeproject.com/Articles/8295/MPEG-Audio-
 Frame-Header ).  It shows the lame encoded file as having quality 100, but
 the ffmpeg copied and ffmpeg encoded files as having Quality 0.

 version of ffmpeg: ffmpeg version 4.2.2-1ubuntu1

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


More information about the FFmpeg-trac mailing list