Opened 3 months ago

Closed 3 months ago

#7634 closed enhancement (fixed)

[SOFAlizer] Unable to set LFE gain to more than 9dB (Also: should LFE gain have a +10dB boost by default?)

Reported by: StarBrilliant Owned by:
Priority: normal Component: avfilter
Version: git-master Keywords: sofa
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


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.

  • Wikipedia "The LFE channel is conventionally played back 10 dB louder than the main channels, giving significantly more recording headroom."
  • EBU Tech. 3304 Page 8 "this channel is conventionally reproduced at a level 10 dB higher than the main channels"
  • 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 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.

Change History (2)

comment:1 Changed 3 months ago by cehoyos

  • Keywords hrtf sofalizer removed

comment:2 Changed 3 months ago by richardpl

  • Resolution set to fixed
  • Status changed from new to closed

Extended to [-20, 40] range same as gain option. Defaults should remain unchanged IMHO.

Fixed in b13fe6477d5b027aa3e4ec59e102be824d9b3513.

Note: See TracTickets for help on using tickets.