[FFmpeg-trac] #7634(avfilter:new): [SOFAlizer] Unable to set LFE gain to more than 9dB (Also: should LFE gain have a +10dB boost by default?)

FFmpeg trac at avcodec.org
Sun Dec 23 00:15:59 EET 2018


#7634: [SOFAlizer] Unable to set LFE gain to more than 9dB (Also: should LFE gain
have a +10dB boost by default?)
-------------------------------------+-------------------------------------
             Reporter:               |                     Type:
  StarBrilliant                      |  enhancement
               Status:  new          |                 Priority:  normal
            Component:  avfilter     |                  Version:  git-
             Keywords:  hrtf, sofa,  |  master
  sofalizer                          |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 As multiple sources suggest, most multichannel recordings record LFE
 channel at a -10dB gain, and should be played back at +10dB gain. I would
 like to produce a SOFA downmix with `lfegain = +10dB`.
 - [https://en.wikipedia.org/wiki/Low-frequency_effects#Development
 Wikipedia] "The LFE channel is conventionally played back 10 dB louder
 than the main channels, giving significantly more recording headroom."
 - [https://tech.ebu.ch/docs/tech/tech3304.pdf EBU Tech. 3304] Page 8 "this
 channel is conventionally reproduced at a level 10 dB higher than the main
 channels"
 -
 [https://www.dolby.com/uploadedFiles/Assets/US/Doc/Professional/38_LFE.pdf
 Some document from Dolby] "The signal in the LFE channel is calibrated
 during soundtrack production to be able to contribute 10 dB higher SPL
 than the same bass signal from any one of the screen (front) channels."

 From the
 [https://github.com/FFmpeg/FFmpeg/blob/2336c76b224628f20ed0ef8a683ad602ed1739c3/libavfilter/af_sofalizer.c#L826
 source code] I know that taking panning law into account, LFE has a
 similar level as FL or FC or FR (if my calculation is not wrong).
 Therefore I need to increase it by 10 dB, the value I want would be
 `lfegain=10`.

 But I got:
 {{{
 ffmpeg version N-92738-g3a36b0c4b8 Copyright (c) 2000-2018 the FFmpeg
 developers
   built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
   configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-
 fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-
 libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-
 amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus
 --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora
 --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp
 --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg
 --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-
 libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex
 --enable-libxvid --enable-libaom --enable-appkit --enable-avfoundation
 --enable-coreimage --enable-audiotoolbox
   libavutil      56. 24.101 / 56. 24.101
   libavcodec     58. 42.104 / 58. 42.104
   libavformat    58. 24.101 / 58. 24.101
   libavdevice    58.  6.101 / 58.  6.101
   libavfilter     7. 46.101 /  7. 46.101
   libswscale      5.  4.100 /  5.  4.100
   libswresample   3.  4.100 /  3.  4.100
   libpostproc    55.  4.100 / 55.  4.100
 ...
 [sofalizer @ 0x7f81a289a400] Value 10.000000 for parameter 'lfegain' out
 of range [-9 - 9]
     Last message repeated 1 times
 [sofalizer @ 0x7f81a289a400] Error setting option lfegain to value 10.
 [Parsed_sofalizer_0 @ 0x7f81a0f034c0] Error applying options to the
 filter.
 [AVFilterGraph @ 0x7f81a0f03280] Error initializing filter 'sofalizer'
 with args 'Downloads/hrtf1.sofa:lfegain=10'
 Error reinitializing filters!
 Failed to inject frame into filter network: Result too large
 Error while processing the decoded data for stream #0:0
 Conversion failed!
 }}}

 Obviously the code required `lfegain` to be in range of `-9 ... 9`. Is it
 too strict? And shall we make the range `-24 ... +36` and `+10 dB` as the
 default?

 Speaking of potential overflow problems, since the code generates warnings
 to ask the user to lower the gain, I don't think it would be a big
 problem.

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


More information about the FFmpeg-trac mailing list