View Full Version : 7.1 downmix function?
Balling
22nd February 2023, 13:53
What do you suggest should happen with Back Centre channel? We do not support mixing that into back channels.
https://trac.ffmpeg.org/ticket/10207#comment:4
tebasuna51
22nd February 2023, 15:50
What do you suggest should happen with Back Centre channel? We do not support mixing that into back channels
Your sample is a problematic AAC 6.0 (MediaInfo and faad inform with channel layout L R C Cb Lb Rb).
qaac can't decode it: ERROR: Not available input file format
NeroAacDec decode it in wrong (I suposse) channel order (maybe FL FC FR SL BC SR) without channel mask.
faad seems decode it without channel mask with the order FL FR FC BC SL SR
ffmpeg decode it like 5.1 but with channel mask 0 in the same order than faad.
To convert that 6.0 to 5.1 I suggest try:
-filter_complex "asplit [f][s]; [f] pan=3.1|c0=c0|c1=c1|c2=c2|c3=0.0*c3 [r]; [s] pan=stereo|c0=0.412*c3+0.588*c4|c1=0.412*c3+0.588*c5, compand=attacks=0:decays=0:points=-90/-85.4|-8/-3.4|-5/-1|-0/-0.1, aformat=channel_layouts=stereo [d]; [r][d] amerge [z]" -map "[z]"
Balling
23rd February 2023, 14:07
channel layout L R C Cb Lb Rb, yep, where Cb is back center. Wav does support that channel. https://learn.microsoft.com/en-us/windows/win32/api/mmreg/ns-mmreg-waveformatextensible
So your command puts back center where?
tebasuna51
23rd February 2023, 22:35
Half mixed in surround channels, make a fantom back center.
Hellboy.
12th October 2025, 20:48
@tebasuna51
I normally use:
ffmpeg -i "atmos-7.1.thd" -b:a 640k -ac 6 "output.ac3"
You recommend doing this also when converting atmos-7.1 to ac3-5.1:
7.1 -> 5.1 downmix with the compand selected
-b:a 640k -filter_complex "asplit [f][s]; [f] pan=3.1|c0=c0|c1=c1|c2=c2|c3=c3 [r]; [s] pan=stereo|c0=0.5*c4+0.5*c6|c1=0.5*c5+0.5*c7, compand=attacks=0:decays=0:points=-90/-84|-8/-2|-6/-1|-0/-0.1, aformat=channel_layouts=stereo [d]; [r][d] amerge [a]" -map "[a]"
Thanks
Edit: I don't know why that smiley face appears there.
Edit2: I disabled the smilies. Thanks again.
tebasuna51
13th October 2025, 09:37
Like ffmpeg can't decode Atmos part in thd (or eac3) the same function can be used to obtain surround 2D (5.1) from Atmos (or not Atmos) thd (or eac3).
If you want surround 3D (at least 5.1.2) you need use the Cavernize decoder.
The smiley face is really :p because you have Smilies ON (see posting rules at left bottom of this page)
PatchWorKs
5th May 2026, 09:36
Bump.
GPT-5 Pro suggests:
Recommended default for highest transparent quality:
ffmpeg -drc_scale 0 -i input.mkv \
-map 0:v? -map 0:a:0 -map 0:s? \
-c:v copy -c:s copy \
-af "aresample=ochl=stereo:rematrix_maxval=1.0" \
-c:a flac output_stereo.mkv
Why this is the best starting point:
FFmpeg’s own documentation says its default downmix/upmix system should normally be preferred over a custom pan matrix unless you have specific needs. The aresample filter uses libswresample, which is responsible for resampling, sample-format conversion and channel-layout rematrixing; ochl=stereo sets the stereo output layout, and rematrix_maxval=1.0 tells FFmpeg to scale the rematrix so that clipping is prevented.
Is this just a so-called LLM-hallucination or has some reliability ?
tebasuna51
6th May 2026, 09:32
FFmpeg’s own documentation says its default downmix/upmix system should normally be preferred over a custom pan matrix unless you have specific needs.
That is the downmix than -af "aresample=ochl=stereo:rematrix_maxval=1.0" make:
Over a 5.1:
FL' = 0.4142xFL + 0.2929xFC + 0.2929xSL
FR' = 0.4142xFR + 0.2929xFC + 0.2929xSR
Over a 7.1:
FL' = 0.3204xFL + 0.2266xFC + 0.2265xBL + 0.2265xSL
FR' = 0.3204xFR + 0.2266xFC + 0.2265xBR + 0.2265xSR
The same than:
-af "pan=stereo|FL < FL + .707FC + .707SL|FR < FR + .707FC + .707SR"
-af "pan=stereo|FL < FL + .707FC + .707BL + .707SL|FR < FR + .707FC + .707BR + .707SR"
It can be a good default downmix (with less contribution from surround channels) for the 5.1, but It usually produces low dialogue volume, and I recommend boosting the center channel more at the expense of the surround channels.
For 7.1 the problem is greater and I recommend a first downmix to 5.1 (the objective of this thread) and then to stereo.
raquete
17th May 2026, 17:18
another very interested thread.
where i can download 'FreeSurround' ?
tebasuna51
17th May 2026, 19:08
https://www.foobar2000.org/components/view/foo_dsp_fsurround
raquete
17th May 2026, 21:49
:thanks:
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.