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 > Capturing and Editing Video > New and alternative a/v containers
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 28th July 2012, 19:38   #11801  |  Link
KoD
Registered User
 
Join Date: Mar 2006
Posts: 567
I believe there is an issue with the audio mixing matrix coefficients. When downmixing 5.1 to stereo, the front channels have a very low level, compared to all the other channels. The difference between them and the rear channels is very great, the latter being much louder. The center channel is louder than the front channels as well (but at least for this one the mixing coefficient is configurable).

This is easy to notice, when using the "normalize matrix" option (and having the clipping option disabled).
KoD is offline   Reply With Quote
Old 28th July 2012, 19:47   #11802  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,348
The front channels have a coefficient of 1, while the surrounds have a coefficient of usually 0.7, but thats also configurable.
Its interesting how you noticed the center mix option, but failed to find the surround mix option right below it.

Anyway, the volume of all individual channels relative to each other is the same no matter if you apply matrix normalization or not.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders
nevcairiel is offline   Reply With Quote
Old 29th July 2012, 11:40   #11803  |  Link
KoD
Registered User
 
Join Date: Mar 2006
Posts: 567
Quote:
Originally Posted by nevcairiel View Post
The front channels have a coefficient of 1, while the surrounds have a coefficient of usually 0.7, but thats also configurable.
Its interesting how you noticed the center mix option, but failed to find the surround mix option right below it.

Anyway, the volume of all individual channels relative to each other is the same no matter if you apply matrix normalization or not.
Hi,

I must have been suffering from temporary blindness, because I have not realized the purpose of the "surround mix level" setting, indeed.

However, the problem that I have described, does indeed exist. And it only manifests itself when "Normalize matrix" is enabled. It does not manifest itself when only "Clipping protection" is enabled.

I don't doubt you when you say that the matrix coefficients for the front channels are 1, but then there's something else which goes wrong, because the front channels do have their level attenuated (or maybe the other channels suffer some sort of additional amplification).

I went again and tested it, with a different sample than my initial one, and the problem was manifested again:
- the front channels suffer from noticeable attenuation of their level
- the center channel, when it starts, is definitely much louder than the front channels
- the rear channels are also louder than the front channels

For my second test, I have used this 6 channel WAV file from Microsoft:
http://www.microsoft.com/windows/win...nel.aspx#link6

I have converted it to a 6 channel FLAC file (with foobar2000 and the reference FLAC encoder), and embedded it into a mkv(a) file (with mkvmerge).

Here are all the files:
http://download.microsoft.com/downlo...S/6channel.exe
http://wikisend.com/download/415420/6_Channel_ID.flac
http://wikisend.com/download/733612/6_Channel_ID.mkv

How to reproduce:
- listen to the mkv file, letting the Windows mixer do the downmixing to stereo, or by using LAV but with only the "Clipping protection" option enabled (or listening to the wav or flac in foobar2000, Windows Media Player, etc)
- listen to the mkv, in MPC, after enabling "Normalize Matrix"

What should happen:
- the sound level of the all channels should be the same during the two auditions

What happens:
- the sound level of the channels, relative to each other, is different during the second audition (front channels are very quiet, the center channel is very loud, and the rear channels are louder than the front channel as well)

Last edited by KoD; 29th July 2012 at 11:56. Reason: bad wording
KoD is offline   Reply With Quote
Old 29th July 2012, 12:19   #11804  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,348
That doesn't make any sense, i checked the generated matrix, and it looks fine.

For left and right, the coeffs are like this, respectively:

Original Left/Right: 0.4117
Center: 0.2941
Surround Left/Right: 0.2941

If anything, Left/Right should be louder then the surrounds. Center coming out of two channels now instead of one before should have about the same volume as left/right.

Edit:
I analyzed the audio in that file, and it seems that the center and back channels are just encoded with more gain then the front left/right channels. Its not all that obvious when you play it as 6-channel, but the difference is there.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders

Last edited by nevcairiel; 29th July 2012 at 12:39.
nevcairiel is offline   Reply With Quote
Old 29th July 2012, 12:49   #11805  |  Link
msoltyspl
Registered User
 
Join Date: Apr 2007
Posts: 7
Regarding channel downmixing, I did some tests with my old test file (http://soltys.ziu.info/temp/ogg61.mkv) from 6.1 -> 2:0.

From what I can see, the default settings (aside LFE channel by default at 0) should roughly function analogously to this: http://i.imgur.com/pSjm5.png

If I go through ffdshow's mixer without enabling LAV's mixing, or leave the job to windows (for the record, many drivers have issues with handling 6.1 - be it channel order or levels, though x-fi seems to do it fine) - then the file plays with the same perceived loudness for all channels (splitting front and back at sqrt(2)/2 to left and right channels, and side left/right in 1:1 to left/right respectively).

If I enable LAV's mixing, then both front and back play noticably louder then the rest. I have to drag sliders down to around 0.35 - 0.4 to keep them at similar level. All settings/matrix checkboxes are unticked.

So perhaps there's something amiss, or maybe I missed something obvious.
msoltyspl is offline   Reply With Quote
Old 29th July 2012, 13:07   #11806  |  Link
Weirdo
Registered User
 
Join Date: Aug 2005
Posts: 231
Thanks for the constant updates. Any chance you might add an update check and notification for the LAV filters?
Weirdo is offline   Reply With Quote
Old 29th July 2012, 13:47   #11807  |  Link
KoD
Registered User
 
Join Date: Mar 2006
Posts: 567
The center and rear channels on the Microsoft file are indeed a bit louder than the front channels. However, the difference in loudness is very small, and by no means what I was hearing.


But now that you've mentioned the coefficients that are supposed to be there, I believe I now know why it's so loud for me.

I have uninstalled v0.50.5, and have installed 0.51.3 (I had no other 0.51 version installed previously). The editable matrix coefficients in the filter configuration page, after just having installed v 0.51.3, are at 0.71 for the center and surround channels, and 0 for the LFE channel, and not the values that you have mentioned in your post.

The tests above, I have done them using these default values that were there in the filter configuration.

After trying 0.29 for the center, and 0.29 for the surround channels, indeed, the awful difference between the front and back channels is gone. Now it sounds just like the wav file sounds, when playing it in Windows Media Player, or in foobar2000.

Unless I have changed the values in the user interface, and have no memory left about this, the default values in the filter configuration page are wrong, and should be the ones you mention in your post above.


PS: what should be the coefficient value for the LFE channel ? 0.29 seems too high for the LFE (the LFE channel sounds less loud in Windows Media Player, than in LAVAudio with 0.29 set for LFE) ? foobar2000 also seems to play the LFE channel in the original wav file much louder than WMP plays the LFE channel in the same file.

PS2: actually, using 0.29, the rear channels also sound a little less loud than WMP plays them... (but this is very slightly less loud, so maybe I'm imagining it).

Last edited by KoD; 29th July 2012 at 14:17. Reason: for PS2
KoD is offline   Reply With Quote
Old 29th July 2012, 14:13   #11808  |  Link
fairchild
Registered User
 
Join Date: Sep 2010
Posts: 321
All this mixing talk has me enthralled yet confused on what are the correct settings. Nev, should should I just leave the settings at 0.71, 0.71, 0 (Center, Surround, LFE) at their default settings when mixing to Stereo with only Clipping Protection enabled which is the default settings, or should I use 0.29, 0.29, 0?
__________________
MPC-HC/MPC-BE, Lav Filters, MadVR
CPU: AMD Ryzen 5 1600, Video: AMD Radeon RX Vega 56 -> TCL S405 55", Audio: Audio-Technica M50S
fairchild is offline   Reply With Quote
Old 29th July 2012, 14:15   #11809  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,348
Quote:
Originally Posted by KoD View Post
The editable matrix coefficients in the filter configuration page, after just having installed v 0.51.3, are at 0.71 for the center and surround channels, and 0 for the LFE channel, and not the values that you have mentioned in your post
What i listed above is after matrix normalization, what you configure is before.
The generated mixing matrix looks perfectly fine to me, so unless there is a bug somewhere in the library that actually does the mixing, i have no idea why there should be something wrong. In any case, that library is not my code.

0.71 for Center is the correct mixing level, that is just 1/sqrt(2) to reduce the volume to accomodate for splitting the channel from one to two. With 0.71, the perceived volume of the center should remain the same.
For surround you can argue what the correct level should be. I choose to also use 0.71 to make the volume of the surround a bit lower then the fronts. If you use 1 for surround, the volume of the surrounds should not change at all.

Anyway, i won't be looking at this much more, i have other things to do that are actually fun. If someone is sure that there is something wrong and wants to investigate further, be my guest. Shouldn't be all that difficult to determine if libavresample works as one might expect.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders

Last edited by nevcairiel; 29th July 2012 at 14:23.
nevcairiel is offline   Reply With Quote
Old 29th July 2012, 14:28   #11810  |  Link
KoD
Registered User
 
Join Date: Mar 2006
Posts: 567
Quote:
Originally Posted by nevcairiel View Post
What i listed above is after matrix normalization, what you configure is before.
The generated mixing matrix looks perfectly fine to me, so unless there is a bug somewhere in the library that actually does the mixing, i have no idea why there should be something wrong. In any case, that library is not my code.

0.71 for Center is the correct mixing level, that is just 1/sqrt(2) to reduce the volume to accomodate for splitting the channel from one to two. With 0.71, the perceived volume of the center should remain the same.
For surround you can argue what the correct level should be. I choose to also use 0.71 to make the volume of the surround a bit lower then the fronts. If you use 1 for surround, the volume of the surrounds should not change at all.

Anyway, i won't be looking at this much more, i have other things to do that are actually fun. If someone is sure that there is something wrong and wants to investigate further, be my guest.
Hi,

Well, with 0.71 as the coefficient in the filter configuration page, the file sounds wrong. A simple playback of the original wav file in Windows Media Player, and a playback of the mkv in MPC with LAVAudio doing the down-mixing, reveals that the sound is completely different.

Being Microsoft who has created the wav file, I imagine that it's properly mastered, the channels are properly flagged, and the way it sounds when playing in Windows Media Player is the way it should sound.

I understand your decision to not invest any more time in this. However, the down-mixing feature does not produce a correct output, and that's that then.

Side-note: using 0 for the LFE in the filter configuration, means there will be no LFE sent to the speakers at all, when downmixing to stereo; is this also intended ?

Last edited by KoD; 29th July 2012 at 14:30. Reason: bad wording
KoD is offline   Reply With Quote
Old 29th July 2012, 15:39   #11811  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,348
I suggest to give this version a try, i think i identified the problem in the mixing library and worked around it for the time being.

http://files.1f0.de/lavf/LAVFilters-...6-gc33e189.zip

Also, yes, 0 for LFE is intentional as the default value (a recommendation from Dolby when performing downmixes). But its a configuration and you're free to change it for your needs.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders
nevcairiel is offline   Reply With Quote
Old 29th July 2012, 15:50   #11812  |  Link
e-t172
Registered User
 
Join Date: Jan 2008
Posts: 589
Quote:
Originally Posted by nevcairiel View Post
Also, yes, 0 for LFE is intentional as the default value (a recommendation from Dolby when performing downmixes).
Indeed. I think that's because most stereo systems are unable to handle LFE frequencies. That would increase the risk of clipping with material with heavy LFE content.
e-t172 is offline   Reply With Quote
Old 29th July 2012, 16:34   #11813  |  Link
dansrfe
Registered User
 
Join Date: Jan 2009
Posts: 1,210
Quote:
Originally Posted by e-t172 View Post
Indeed. I think that's because most stereo systems are unable to handle LFE frequencies. That would increase the risk of clipping with material with heavy LFE content.
What if I have 2.1 satellite speaker system that only takes a 2.0 stereo input via single 3.5mm three-conductor plug but feeds LFE frequencies relatively cleanly to the subwoofer? By listening I can tell that the LFE frequencies are nicely separated by whatever mechanism the system uses.

What would be the best values for center, surround and lfe in this case?
dansrfe is offline   Reply With Quote
Old 29th July 2012, 16:38   #11814  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,348
Just increase the LFE to a value that sounds good to you, there aren't really any pre-determined values. A value of 1.0 might even work out OK so you get the original LFE volume.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders
nevcairiel is offline   Reply With Quote
Old 29th July 2012, 18:31   #11815  |  Link
KoD
Registered User
 
Join Date: Mar 2006
Posts: 567
Quote:
Originally Posted by nevcairiel View Post
I suggest to give this version a try, i think i identified the problem in the mixing library and worked around it for the time being.

http://files.1f0.de/lavf/LAVFilters-...6-gc33e189.zip

Also, yes, 0 for LFE is intentional as the default value (a recommendation from Dolby when performing downmixes). But its a configuration and you're free to change it for your needs.
Hi,

Thanks for sticking to it. Indeed, with the new build, the sound levels seem to be similar as when played with Windows Media Player, when using 0.71 in the filter configuration for the center and surround channels, with "Normalize Matrix" on. There might be a slight difference, with front an center channels a bit louder than with WMP, but I'm not certain, and it's not easy to notice it, anyway.


Side-note: for LFE, I'm using 0.12, to get the same apparent level as Windows Media Player when playing the 6 channel wav file.

Last edited by KoD; 29th July 2012 at 18:33. Reason: bad wording
KoD is offline   Reply With Quote
Old 29th July 2012, 18:38   #11816  |  Link
e-t172
Registered User
 
Join Date: Jan 2008
Posts: 589
Quote:
Originally Posted by nevcairiel View Post
Just increase the LFE to a value that sounds good to you, there aren't really any pre-determined values. A value of 1.0 might even work out OK so you get the original LFE volume.
That's not so simple. Dolby specs indicates the LFE channel should be 10 dB louder than any of the main channels (page 21). So, taking the main channels as reference (x1.0), the LFE signal should be fed to L and R with +7dB gain (10dB - 3dB), or x2.24.

Last edited by e-t172; 29th July 2012 at 18:43.
e-t172 is offline   Reply With Quote
Old 29th July 2012, 18:41   #11817  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,348
Quote:
Originally Posted by e-t172 View Post
That's not so simple. Dolby specs indicates the LFE channel should be 10 dB louder than any of the main channels. So, taking the main channels as reference (x1.0), the LFE signal should be fed to L and R with +7dB gain (10dB - 3dB), or x2.24.
It wouldn't be 10dB louder either when playing the original multi-channel format without downmixing either, so this shouldn't be required to be performed in the mixer (unless of course the A/D component is usually doing this).

My guess is that its a spec for the mastering of the file, or the decoder.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders
nevcairiel is offline   Reply With Quote
Old 29th July 2012, 18:53   #11818  |  Link
e-t172
Registered User
 
Join Date: Jan 2008
Posts: 589
Quote:
Originally Posted by nevcairiel View Post
It wouldn't be 10dB louder either when playing the original multi-channel format without downmixing either
Yes it would, because in this case the receiver does the additional amplification. Or if you're doing analog with a sound card, the sound card is supposed to do this, assuming it has decent bass management features (for example my Xonar does it). The Windows audio engine does it if you ask it to downmix 5.1 to stereo. So if you're doing the downmixing yourself, you need to adjust levels, or the LFE level will be wrong. The rule is simple: if you're mixing LFE with a main channel, the LFE signal should be 10dB louder.

Quote:
Originally Posted by nevcairiel View Post
so this shouldn't be required to be performed in the mixer (unless of course the A/D component is usually doing this).
Yes it is. Whatever downmixes the signal does it. If there's no downmixing, then the receiver does it.

Quote:
Originally Posted by nevcairiel View Post
My guess is that its a spec for the mastering of the file, or the decoder.
Sorry. You guessed wrong.

http://www.hometheater.com/content/b...nd-lfe-channel
http://www.hometheaterhifi.com/volum...pril-2000.html
http://www.dolby.com/uploadedFiles/z...nal/38_LFE.pdf

Here's a quote from the third link, official Dolby document:

Quote:
Originally Posted by Dolby
Consumer Dolby Digital products that reproduce multichannel sound must combine the LFE channel in the proper acoustic mixing ratio with the bass from the other channels for proper reproduction. [...] 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.
Besides, it actually makes sense: if you want a channel to be always 10dB louder than the rest, then it's better to adjust the level in the last item of the chain (i.e. the amplifier) so that dynamic range in the other channels do not have to suffer.

Last edited by e-t172; 29th July 2012 at 18:58.
e-t172 is offline   Reply With Quote
Old 29th July 2012, 19:01   #11819  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,348
Quote:
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.
Doesn't this say that in production the channel is adjusted to be 10dB louder? At least it sounds to me like that.

Quote:
Originally Posted by e-t172 View Post
Besides, it actually makes sense: if you want a channel to be always 10dB louder than the rest, then it's better to adjust the level in the last item of the chain (i.e. the amplifier) so that dynamic range in the other channels do not have to suffer.
Since when does Dolby make sense? Commercial audio already has the dynamic range butchered to death.

But anyway, the level can be configured, if i need to increase the maximum value i can do that.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders
nevcairiel is offline   Reply With Quote
Old 29th July 2012, 19:13   #11820  |  Link
e-t172
Registered User
 
Join Date: Jan 2008
Posts: 589
I already gave you three links. Here's another one, this time the actual Dolby Digital specification (page 53):

Quote:
Downmixing of the lfe channel is optional. An ideal downmix would have the lfe channel reproduce at an acoustic level of +10 dB with respect to the left and right channels.
There's also Wikipedia:

Quote:
The LFE channel is conventionally played back 10 dB louder than the main channels, giving significantly more recording headroom.
Genelec agrees too.

Oh, look, an ITU spec!

Quote:
Originally Posted by ITU
Recommendation ITU-R BR.1384 specifies that the LFE channel is recorded with a level offset of –10 dB for the recording and exchange of multichannel sound programme material, and this offset is compensated for in the reproduction system. For broadcasting applications where signal levels are compliant with Recommendation ITU-R BR.1384, the level of LFE channel should be reproduced with positive offset gain of 10 dB relative to the main channels on reproduction.
NOTE 1 – The film industry encodes the LFE channel such that a positive gain of 10 dB is required on reproduction and the reproduction level for DVD-Video is set to a positive gain of 10 dB relative to the main channels.
Let's see the ITU-R BR.1384 spec that it refers to:

Quote:
The LFE channel is recorded with a level offset of –10 dB. This offset is compensated for in the reproduction system, where the LFE loudspeaker has an acoustic output (within its low frequency passband) of +10 dB with respect to the other channels, when fed by a signal whose level is equal to the level of the signals feeding each of the L, C, R, LS and RS channels.
If that's still not enough for you, you can try it with any receiver or soundcard with bass management support: feed it a bass signal on a main channel, if bass management is configured correctly it will come out from the subwoofer; then feed it the same signal on the LFE channel, it will also come out from the subwoofer, but it will be 10dB louder.

Last edited by e-t172; 29th July 2012 at 19:23.
e-t172 is offline   Reply With Quote
Reply

Tags
decoders, directshow, filters, splitter


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 03:44.


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