[FFmpeg-trac] #8939(undetermined:open): libopus: mapping_family does not get set correctly for surround sound

FFmpeg trac at avcodec.org
Tue Oct 5 10:08:32 EEST 2021


#8939: libopus: mapping_family does not get set correctly for surround sound
-------------------------------------+-------------------------------------
             Reporter:  frk1337      |                    Owner:  (none)
                 Type:  defect       |                   Status:  open
             Priority:  important    |                Component:
                                     |  undetermined
              Version:  git-master   |               Resolution:
             Keywords:  libopus,     |               Blocked By:
  channellayout                      |
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
Changes (by ArseGnomes):

 * status:  new => open

Comment:

 I hit this too, but in converting via an intermediate 5.1 WAV (as editing
 was required).   What made me suspicious was that libopus in default VBR
 with a target usually undershoots the specified rate by a decent amount
 when mapping_family is set correctly and this time it went over, so I did
 a second run with the same source file and mapping_family explicitly set
 to verify and came up with this:


 {{{
 >ffmpeg -i file.wav -c:a libopus -b:a 768k file.opus
 Input #0, wav, from 'file.wav':
   Duration: 01:22:01.89, bitrate: 9216 kb/s
   Stream #0:0: Audio: pcm_f32le ([3][0][0][0] / 0x0003), 48000 Hz, 5.1,
 flt, 9216 kb/s
 Stream mapping:
   Stream #0:0 -> #0:0 (pcm_f32le (native) -> opus (libopus))
 Press [q] to stop, [?] for help
 Output #0, opus, to 'file.opus':
   Metadata:
     encoder         : Lavf59.5.100
   Stream #0:0: Audio: opus, 48000 Hz, 5.1, flt, 768 kb/s
     Metadata:
       encoder         : Lavc59.7.103 libopus
 size=  480778kB time=01:22:01.89 bitrate= 800.2kbits/s speed=34.5x
 video:0kB audio:478567kB subtitle:0kB other streams:0kB global headers:0kB
 muxing overhead: 0.461974%


 >ffmpeg -i file.wav -c:a libopus -b:a 768k -mapping_family 1 test.opus

 Input #0, wav, from 'file.wav':
   Duration: 01:22:01.89, bitrate: 9216 kb/s
   Stream #0:0: Audio: pcm_f32le ([3][0][0][0] / 0x0003), 48000 Hz, 5.1,
 flt, 9216 kb/s
 Stream mapping:
   Stream #0:0 -> #0:0 (pcm_f32le (native) -> opus (libopus))
 Press [q] to stop, [?] for help
 Output #0, opus, to 'test.opus':
   Metadata:
     encoder         : Lavf59.5.100
   Stream #0:0: Audio: opus, 48000 Hz, 5.1, flt, 768 kb/s
     Metadata:
       encoder         : Lavc59.7.103 libopus
 size=  396990kB time=01:22:01.89 bitrate= 660.7kbits/s speed=33.4x
 video:0kB audio:395142kB subtitle:0kB other streams:0kB global headers:0kB
 muxing overhead: 0.467612%
 }}}


 I didn't check whether there was actually a problem with channel mapping /
 sound quality  in the larger file and just assumed it was due to the
 mapping_family=1 surround optimizations not being run. I also tried
 manually setting compression level to 10 but this didn't change results,
 so that part of the docs seems correct.

 The input .wav was the >4GB .wav type Adobe Audition outputs and channels
 are handled correctly by ffmpeg so that's not an issue. (...The 4GB limit
 ffmpeg has for wav extension outputs but not for inputs is another oddity
 I haven't looked into)

 So, either the codecs page, which says that anything > stereo defaults to
 1 for mapping_family, or program behavior is wrong here.
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/8939#comment:2>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list