Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
28th October 2020, 19:21 | #21 | Link | |
Registered User
Join Date: Mar 2011
Posts: 4,823
|
Quote:
I tried downmixing a less than 5 minute 7.1ch wave file to stereo with MeGUI while converting to flac, and after indexing it took roughly one minute to complete. I didn't normalize. To do the same thing with foobar2000 I downmix 7.1ch to 5.1ch with the Matrix Mixer, run that through the Amplify DSP to increase the volume by a couple of dB (for the next DSP), then through fb2k's Advanced Limiter to limit any loud peaks after combining the surround channels, from there it goes through the Amplify DSP again to reduce the volume by 2dB before being downmixed to stereo with the Matrix Mixer DSP. For the same file, outputting flac once more, that whole process took about 4 seconds. |
|
2nd November 2020, 09:53 | #23 | Link |
Registered User
Join Date: Aug 2002
Location: Italy
Posts: 303
|
Hi there, can you finally "sum up" all the (proper ?) ways to downmix multichannels to stereo with FFMPEG ?
I've already cheked many approaches, but I'm a bit confused now... - https://superuser.com/questions/8524...o-using-ffmpeg - http://forum.doom9.org/showthread.php?t=168267 Thanks in advance. |
2nd November 2020, 12:55 | #24 | Link | |
Moderator
Join Date: Feb 2005
Location: Spain
Posts: 6,890
|
Quote:
-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]" 2) If your audio equipment support Dolby ProLogic decoder (recover a 5.0 from your 2.0 file) use the DPLII downmix: -filter_complex "pan=stereo|FL=.3254FL+.2301FC+.2818BL+.1627BR|FR=.3254FR+.2301FC-.1627BL-.2818BR" 3) If your audio equipment is only stereo (TV for instance) does not exist a proper way, because is not possible suply the same audio volume with 2 speakers than with 5 speakers, and there are many options. Select the desired: a) The formal approach to preserve the balance between all the channels (of course the LFE channel is ignored by Dolby recommendation): -filter_complex "pan=stereo|FL=.3694FL+.2612FC+.3694BL+0.0LFE|FR=.3694FR+.2612FC+.3694BR+0.0LFE, volumedetect" b) The extreme dialog maximize: -filter_complex "pan=stereo|FL=.5FL+.5FC+.0BL+0.0LFE|FR=.5FR+.5FC+.0BR+0.0LFE, volumedetect" c) Any option between a) and b). The coeficients for each channel must sum 1 to avoid clip. For instance: -filter_complex "pan=stereo|FL=.5FL+.4FC+.1BL+0.0LFE|FR=.5FR+.4FC+.1BR+0.0LFE, volumedetect" I include the volumedetect filter to see if the mix admit a gain without clip. Mix like: FL=FC+0.30*FL+0.30*BL (sum of coeficients 1.6) FL=0.5*FC+0.707*FL+0.707*BL+0.5*LFE (sum of coeficients 2.414) are wrong because can produce clips. Mix like (see the < instead the =) FL < 1.0*FL + 0.707*FC + 0.707*BL are equivalent (automatic normalization): FL = 0.414*FL + 0.293*FC + 0.293*BL
__________________
BeHappy, AviSynth audio transcoder. Last edited by tebasuna51; 3rd February 2023 at 10:54. Reason: add info |
|
6th November 2020, 10:12 | #25 | Link | |||
Registered User
Join Date: Aug 2002
Location: Italy
Posts: 303
|
Quote:
Quote:
Quote:
Last edited by PatchWorKs; 6th November 2020 at 16:45. |
|||
6th November 2020, 21:42 | #26 | Link | ||
Moderator
Join Date: Feb 2005
Location: Spain
Posts: 6,890
|
Quote:
Quote:
Can work fine for some sources but bad for others (low dialogs). I prefer a C coeficient greater than the B coeficients.
__________________
BeHappy, AviSynth audio transcoder. |
||
7th November 2020, 08:23 | #28 | Link | |
Registered User
Join Date: Aug 2002
Location: Italy
Posts: 303
|
Quote:
...do you think it's implementable in FFMPEG ? |
|
7th November 2020, 12:05 | #29 | Link |
Moderator
Join Date: Feb 2005
Location: Spain
Posts: 6,890
|
AFAIK the mix suggested is (for each stereo channel):
lt [n] = l[n] + 0.707 * c[n] + (dlev - 1) * e[n] + 0.5 * ls [n] with e[n] the extra channel provided by the "Voice channel extraction", and the suggested boost for it is 10 dB (dlev = 3.216). Then can be: FL < 1FL + 0.707FC + 2.162E + 0.5BL and normalized: FL = 0.229FL + 0.162FC + 0.495E + 0.114BL I don't know how extract the E (Voice channel extraction) channel with ffmpeg functions, but seems than the stereo channels have more than half of the volume to only voices, for me is too much. We can obtain the same voice volume (not so clear) with: FL = 0.229FL + 0.657FC + 0.114BL For me FL=.5FL+.4FC+.1BL is more than enough preserving the stereo effect much more.
__________________
BeHappy, AviSynth audio transcoder. |
9th November 2020, 12:39 | #30 | Link | |
Registered User
Join Date: Aug 2002
Location: Italy
Posts: 303
|
Quote:
Code:
-filter_complex "pan=stereo|FL=.5FL+.4FC+.1BL+0.0LFE|FR=.5FR+.4FC+.1BR+0.0LFE, volumedetect" Code:
-filter_complex "pan=stereo|FL<.5FL+.4FC+.1BL+0.0LFE|FR<.5FR+.4FC+.1BR+0.0LFE, volumedetect" Last edited by PatchWorKs; 9th November 2020 at 12:44. |
|
9th November 2020, 13:10 | #31 | Link | |
Registered User
Join Date: Jan 2012
Posts: 272
|
Quote:
FFmpeg have many options for downmix. |
|
9th November 2020, 14:36 | #32 | Link | |
Moderator
Join Date: Feb 2005
Location: Spain
Posts: 6,890
|
Put < or = when the sum of coeficients is 1 (.5 + .4 + .1 = 1) is the same mix.
Quote:
__________________
BeHappy, AviSynth audio transcoder. |
|
11th November 2020, 08:34 | #33 | Link |
Registered User
Join Date: Aug 2002
Location: Italy
Posts: 303
|
Ok, last question: does this formula "correctly" downmix 7.1/atmos to stereo ?
Code:
-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=0oints=-90/-84|-10/-4|-6/-2|-0/-0.3, aformat=channel_layouts=stereo [d]; [r][d] amerge, pan=stereo|FL=.3254FL+.2301FC+.2818BL+.1627BR|FR=.3254FR+.2301FC-.1627BL-.2818BR, volumedetect [a]" -map "[a]" Last edited by PatchWorKs; 11th November 2020 at 08:37. |
11th November 2020, 11:55 | #34 | Link |
Moderator
Join Date: Feb 2005
Location: Spain
Posts: 6,890
|
Warning with the emoticon. Must be:
Code:
-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|-10/-4|-6/-2|-0/-0.3, aformat=channel_layouts=stereo [d]; [r][d] amerge, pan=stereo|FL=.3254FL+.2301FC+.2818BL+.1627BR|FR=.3254FR+.2301FC-.1627BL-.2818BR, volumedetect [a]" -map "[a]" To be played for a stereo only audio equipment (TV for instance) maybe you can try other downmix: Code:
-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, pan=stereo|FL=.4FL+.4FC+.2BL|FR=.4FR+.4FC+.2BR, volumedetect [a]" -map "[a]" points=-90/-84|-8/-2|-6/-1|-0/-0.1 and a mix stereo (not dplII) with the dialogs reinforced: pan=stereo|FL=.4FL+.4FC+.2BL|FR=.4FR+.4FC+.2BR Does not exist a unique correct way to do the downmix because depend on: - Device player (with or without DplII) - Kind of source (it need or not reinforce dialogs) - Users preferences (dialogs, compand curve)
__________________
BeHappy, AviSynth audio transcoder. |
11th November 2020, 16:22 | #35 | Link |
Life's clearer in 4K UHD
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,219
|
I have a few Dolby Surround (Prologic) encoded CD's. It would be interesting if such CD's could be reverse encoded to create native surround-sound channels.
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
|
11th November 2020, 23:41 | #36 | Link |
Moderator
Join Date: Feb 2005
Location: Spain
Posts: 6,890
|
The best option I know is the Foobar2000 plugin FreeSurround configured like the attached image.
Maybe the PowerDVD compatibility (a inverted surround channel) is better, that change with the method used to construct the dpl encode (it can't be know). There are a ffmpeg function but for me is worse, maybe I don't found the correct parameters, this is my best test: -af "surround=lfe_out=0:level_out=2"
__________________
BeHappy, AviSynth audio transcoder. |
2nd February 2022, 03:52 | #37 | Link |
Registered User
Join Date: Feb 2021
Location: Germany
Posts: 17
|
I use this one for all downmixing to stereo:
Code:
-af 'lowpass=c=LFE:f=120,pan=stereo|FL=.3FL+.21FC+.3FLC+.3SL+.3BL+.21BC+.21LFE|FR=.3FR+.21FC+.3FRC+.3SR+.3BR+.21BC+.21LFE' I usually normalize as well, by doing a first run with ebur128 at the end of the filter chain, and then setting a dB offset with volume filter in the actual encode, to reach -23 LUFS. |
2nd February 2022, 11:55 | #38 | Link |
Moderator
Join Date: Feb 2005
Location: Spain
Posts: 6,890
|
Like I say already each user is free to experiment and select the preferred method.
But for me there are some troubles: - Dolby recommend don't use the LFE channel in the downmix (and worse filtered), because can cancel or distort low frequencies present in other channels. - The volume of FC channel (.21) is very low compared with the rest of channels (1.2) and the dialogs can be inaudibles. - I can't recommend use double volume of front channels (.3) for surround channels (.6) Maybe... Code:
-af 'pan=stereo|FL=.4FL+.3FC+.15FLC+.15SL+.15BL+.15BC|FR=.4FR+.3FC+.15FRC+.15SR+.15BR+.15BC'
__________________
BeHappy, AviSynth audio transcoder. Last edited by tebasuna51; 2nd February 2022 at 12:02. Reason: add info |
27th September 2022, 18:23 | #39 | Link | |
Registered User
Join Date: Aug 2002
Location: Italy
Posts: 303
|
Sorry to revive this old 3ad but the bet is still kicking...
...just found this interesting reply - dated Aug 25 - from PierU @ Super User: Quote:
__________________
HYbrid Multimedia Production Suite project @ GitHub |
|
28th September 2022, 09:45 | #40 | Link |
Moderator
Join Date: Feb 2005
Location: Spain
Posts: 6,890
|
Yes, it is correct for me.
But remember, the thread is about 7.1 downmix and this downmix is for a 5.1 downmix and the canonical downmix is: pan=stereo|FL=.37FL+.26FC+.37BL|FR=.37FR+.26FC+.37BR with very low FC presence And the suggested: pan=stereo|FL < 1.0*FL + 0.707*FC + 0.707*BL|FR < 1.0*FR + 0.707*FC + 0.707*BR Is the same than (with = instead <, and rounding) pan=stereo|FL=.4FL+.3FC+.3BL|FR=.4FR+.3FC+.3BR And myself I suggested (five post before) a mix with more FC presence: pan=stereo|FL=.4FL+.4FC+.2BL|FR=.4FR+.4FC+.2BR The other: pan=stereo|FL < 1.0*FL + 0.707*FC + 0.4*BL|FR < 1.0*FR + 0.707*FC + 0.4*BR same than: pan=stereo|FL=.47FL+.33FC+.19BL|FR=.47FR+.33FC+.19BR have fronts with more force, I don't know if it is better. Is a question of taste.
__________________
BeHappy, AviSynth audio transcoder. Last edited by tebasuna51; 28th September 2022 at 10:11. |
Tags |
downmix, phase shift |
Thread Tools | Search this Thread |
Display Modes | |
|
|