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 July 2012, 19:38 | #11801 | Link |
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). |
28th July 2012, 19:47 | #11802 | Link |
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 |
29th July 2012, 11:40 | #11803 | Link | |
Registered User
Join Date: Mar 2006
Posts: 567
|
Quote:
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 |
|
29th July 2012, 12:19 | #11804 | Link |
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. |
29th July 2012, 12:49 | #11805 | Link |
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. |
29th July 2012, 13:47 | #11807 | Link |
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 |
29th July 2012, 14:13 | #11808 | Link |
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 |
29th July 2012, 14:15 | #11809 | Link | |
Registered Developer
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,348
|
Quote:
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. |
|
29th July 2012, 14:28 | #11810 | Link | |
Registered User
Join Date: Mar 2006
Posts: 567
|
Quote:
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 |
|
29th July 2012, 15:39 | #11811 | Link |
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 |
29th July 2012, 16:34 | #11813 | Link | |
Registered User
Join Date: Jan 2009
Posts: 1,210
|
Quote:
What would be the best values for center, surround and lfe in this case? |
|
29th July 2012, 16:38 | #11814 | Link |
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 |
29th July 2012, 18:31 | #11815 | Link | |
Registered User
Join Date: Mar 2006
Posts: 567
|
Quote:
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 |
|
29th July 2012, 18:38 | #11816 | Link | |
Registered User
Join Date: Jan 2008
Posts: 589
|
Quote:
Last edited by e-t172; 29th July 2012 at 18:43. |
|
29th July 2012, 18:41 | #11817 | Link | |
Registered Developer
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,348
|
Quote:
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 |
|
29th July 2012, 18:53 | #11818 | Link | ||||
Registered User
Join Date: Jan 2008
Posts: 589
|
Quote:
Quote:
Quote:
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:
Last edited by e-t172; 29th July 2012 at 18:58. |
||||
29th July 2012, 19:01 | #11819 | Link | ||
Registered Developer
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,348
|
Quote:
Quote:
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 |
||
29th July 2012, 19:13 | #11820 | Link | ||||
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:
Quote:
Oh, look, an ITU spec! Quote:
Quote:
Last edited by e-t172; 29th July 2012 at 19:23. |
||||
Tags |
decoders, directshow, filters, splitter |
|
|