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.

 

Go Back   Doom9's Forum > General > Audio encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 17th January 2020, 15:05   #1  |  Link
syrist
Registered User
 
Join Date: Nov 2013
Posts: 5
Does FFMPEG convert 5.1 to 2.0 properly by default??

Hi, I normally use ffmpeg+neroaacenc to downmix AC3 and DTS surround to 2 channel AAC using the following command line:

Code:
ffmpeg.exe -y -i SOURCE.MKV -ac 2 -acodec pcm_s16le -f wav - | neroAacEnc.exe -ignorelength -if - -of DESTINATION.AAC
I was reading on this forum that some people like to tweak the volume levels of some channels (ie. increase center and decrease surround, etc.) so the dialog doesn't get overpowered/

So I was just wondering if when ffmpeg downmixes multichannel to 2 channel if it just blindly merges all the channels together or if it makes level adjustments to some of the channels before downmixing.

Thanks.

Last edited by syrist; 17th January 2020 at 15:07.
syrist is offline   Reply With Quote
Old 17th January 2020, 21:50   #2  |  Link
Sparktank
47.952fps@71.928Hz
 
Sparktank's Avatar
 
Join Date: Mar 2011
Posts: 940
Yeah, it will downmix properly, according to standards. Remember the standards omit the LFE channel.
https://trac.ffmpeg.org/wiki/AudioCh...ion#a5.1stereo

You can use the pan audio filter to customize the downmix how you want.
https://ffmpeg.org/ffmpeg-filters.html#pan-1
__________________
Win10 (x64) build 19041
NVIDIA GeForce GTX 1060 3GB (GP106) 3071MB/GDDR5 | (r435_95-4)
NTSC | DVD: R1 | BD: A
AMD Ryzen 5 2600 @3.4GHz (6c/12th, I'm on AVX2 now!)
Sparktank is offline   Reply With Quote
Old 18th January 2020, 11:56   #3  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
Quote:
Originally Posted by Sparktank View Post
Yeah, it will downmix properly, according to standards. Remember the standards omit the LFE channel.
https://trac.ffmpeg.org/wiki/AudioCh...ion#a5.1stereo
It is not exact. The standards showed in section 7.8 of .pdf related in ffmpeg docs are:

For a standard mix:
Quote:
Prior to the scaling needed to prevent overflow, the general 3/2 downmix equations for an LoRo stereo signal are
Lo = 1.0 * L + clev * C + slev * Ls ;
Ro = 1.0 * R + clev * C + slev * Rs ;
or for a DPL mix:
Quote:
Prior to the scaling needed to prevent overflow, the 3/2 downmix equations for an LtRt stereo signal are
Lt = 1.0 * L + 0.707 * C – 0.707 * Ls – 0.707 * Rs ;
Rt = 1.0 * R + 0.707 * C + 0.707 * Ls + 0.707 * Rs ;
But ffmpeg do:
Quote:
L = 0.4142 * L + 0.2929 * C + 0.2929 * Ls
R = 0.4142 * R + 0.2929 * C + 0.2929 * Rs
From a un-normalized mix of:
Quote:
L = 1.0 * L + 0.707 * C + 0.707 * Ls
R = 1.0 * R + 0.707 * C + 0.707 * Rs
Is a standard mix (not DPL) but ignoring the 'clev' and 'slev' parameters included in AC3 headers.

clev can be:
0.707 (my recommendation when encode: -center_mixlev 0.707)
0.595 (the default when encode with ffmpeg)
0.500 (never recommended)

slev can be:
0.707 (not recommended)
0.500 (the default and recommended with ffmpeg)

My recommended un-normalizad mix standard is:
Quote:
L = 1.0 * L + 0.707 * C + 0.500 * Ls
R = 1.0 * R + 0.707 * C + 0.500 * Rs
and normalized:
Quote:
L = 0.453 * L + 0.320 * C + 0.227 * Ls
R = 0.453 * R + 0.320 * C + 0.227 * Rs
But for users than experiment low dialog volume we can modify the coeficients.
__________________
BeHappy, AviSynth audio transcoder.

Last edited by tebasuna51; 19th January 2020 at 13:10. Reason: typo
tebasuna51 is offline   Reply With Quote
Old 27th January 2020, 20:45   #4  |  Link
syrist
Registered User
 
Join Date: Nov 2013
Posts: 5
Quote:
Originally Posted by tebasuna51 View Post
It is not exact. The standards showed in section 7.8 of .pdf related in ffmpeg docs are:

For a standard mix:


or for a DPL mix:


But ffmpeg do:


From a un-normalized mix of:


Is a standard mix (not DPL) but ignoring the 'clev' and 'slev' parameters included in AC3 headers.

clev can be:
0.707 (my recommendation when encode: -center_mixlev 0.707)
0.595 (the default when encode with ffmpeg)
0.500 (never recommended)

slev can be:
0.707 (not recommended)
0.500 (the default and recommended with ffmpeg)

My recommended un-normalizad mix standard is:


and normalized:


But for users than experiment low dialog volume we can modify the coeficients.
Great info... thanks for the reply. I'll adjust my batch file command line settings.
syrist is offline   Reply With Quote
Reply

Tags
downmix, ffmpeg, multichannel, stereo, surround

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 14:04.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.