View Full Version : LAV Filters - DirectShow Media Splitter and Decoders
clsid
6th October 2017, 15:04
It always stores in the same registry key.
HKEY_CURRENT_USER\Software\LAV
MPC-HC stores the settings in a different key if you use the internal LAV Filters. It takes over settings management through API of LAV Filters.
HKEY_CURRENT_USER\Software\MPC-HC\MPC-HC\Internal Filters
The change in behavior is purely because you changed/reset settings.
mzso
6th October 2017, 16:14
It always stores in the same registry key.
HKEY_CURRENT_USER\Software\LAV
MPC-HC stores the settings in a different key if you use the internal LAV Filters. It takes over settings management through API of LAV Filters.
HKEY_CURRENT_USER\Software\MPC-HC\MPC-HC\Internal Filters
The change in behavior is purely because you changed/reset settings.
Thanks.
Though something indeed happens. LAV is not loaded, but apparently the microsoft decoder does. But somehow deinterlacing doesn't break on channel switching either. (It breaks when I set the microsoft decoder to be used directly)
Fabulist
7th October 2017, 12:37
Hello everyone. I would like to ask if anyone can suggest to me what I should do: I mix the back and side channels together, therefore the output comes out as 32bit Float (PCM from WASAPI) instead of the one closest to the file's native.
My receivers support up to 24-bit according to Windows, but 32bit output (from files or mixing) plays properly. Should I disable 32-bit outputs on LAV or leave it be?
Thank you in advance.
nevcairiel
7th October 2017, 12:46
Generally, you should just leave everything on and let the audio renderer deal with it.
Fabulist
7th October 2017, 13:13
Generally, you should just leave everything on and let the audio renderer deal with it.
I see, thank you. Is there anything else I should pay attention to?
I have PotPlayer's WASAPI set to bitexact mode and the default speaker output to "Same as input" and "32-bit (floating point)" - which for some reason do affect audio even though I thought they would not with LAV enabled.
For example; setting 32-bit on PotPlayer for some reason makes the volume slightly higher and changing the speaker output from "Same as input" to 5.1 seems to change output type, but I assumed "Same as input" is best considering LAV is enabled.
Are there any "best settings" to set these in order to avoid interference with LAV?
steakhutzeee
8th October 2017, 17:14
Evening :) I'm using MPC-BE with Madvr and LavFilters. Now, i'm not an expert so this is my actual configuration of audio and video lav. Are configured properly?
I'm experiencing an issue with an mkv with audio track in 'eac3' format. When opening it, i hear no audio. In the filter list there is no lav audio but there is Microsoft DTV-DVD audio decoder. With other audio format, like 'aac' i've no problem and i hear audio and see the audio lav filter active.
Btw this is my configuration:
https://postimg.org/image/1b6bdckv97/
https://postimg.org/image/9s0px03ppn/
In MPC-BE Internal Filters i've all of them deselected in 'Source Filters', 'Video Decoder', 'Audio Decoder'.
nevcairiel
8th October 2017, 17:35
You may need to disable E-AC3 bitstreaming if that happens, perhaps it isn't supported on your setup - which would cause a fallback to another decoder.
el Filou
8th October 2017, 17:37
What does your AVR display if you check the audio stream info? Does it recognize the Dolby Digital Plus stream correctly?
In MPC-HC there is an option to add specific external filters which you can then set a merit for, or block, or prefer.
If you want to avoid the MS Decoder and there is the same option in MPC-BE, try to add LAV Audio Decoder and set it to Prefer.
Is this the only file with E-AC3 you have a problem with? If you don't have any other, there are some here: MPlayer samples collection - E-AC3 (http://samples.mplayerhq.hu/A-codecs/AC3/eac3/)
Play them to see if it works with other files.
If the problem is only with one specific mkv, post its MediaInfo output here (only the section for audio)
steakhutzeee
8th October 2017, 18:22
You may need to disable E-AC3 bitstreaming if that happens, perhaps it isn't supported on your setup - which would cause a fallback to another decoder.
Yep, disabled and now works :) What you mean for "not supported on my setup"?
What does your AVR display if you check the audio stream info? Does it recognize the Dolby Digital Plus stream correctly?
In MPC-HC there is an option to add specific external filters which you can then set a merit for, or block, or prefer.
If you want to avoid the MS Decoder and there is the same option in MPC-BE, try to add LAV Audio Decoder and set it to Prefer.
Is this the only file with E-AC3 you have a problem with? If you don't have any other, there are some here: MPlayer samples collection - E-AC3 (http://samples.mplayerhq.hu/A-codecs/AC3/eac3/)
Play them to see if it works with other files.
If the problem is only with one specific mkv, post its MediaInfo output here (only the section for audio)
Tried with others eac3 from link you posted and same problem, i've to disable the eac3 bitstream to hear them work.
I've all lav filters configured as Preferred yet.
How can i see the AVR btw?
Thanks!
el Filou
8th October 2017, 19:34
What are you outputting sound to? Is it an all-in-one kit? A receiver?
Probably as nevcairiel said, your sound system can't decode Dolby Digital Plus.
steakhutzeee
8th October 2017, 19:48
What are you outputting sound to? Is it an all-in-one kit? A receiver?
Probably as nevcairiel said, your sound system can't decode Dolby Digital Plus.
I simply have my headphones plugged into the pc :P
nevcairiel
8th October 2017, 20:50
I simply have my headphones plugged into the pc :P
Then you should probably disable all bitstreaming options.
steakhutzeee
8th October 2017, 21:05
Then you should probably disable all bitstreaming options.
Why this?
nevcairiel
8th October 2017, 21:09
Because headphones usually don't have bitstream decoders for those compressed formats.
nussman
8th October 2017, 21:18
Bitstream = output encoded (ac3, e-ac3, dts etc.) audio signal
So your headphones need a built in decoder for all this formats or otherwise you will hear nothing (i.e. your test with bitstream).
P.S. I would really like a fallback in LAV for not supported bitstream formats, because many users are running into this problem.
http://www.dvbviewer.tv/forum/topic/60624-kein-ton-bei-bbc-world-hd-auf-astra-192/
http://www.dvbviewer.tv/forum/topic/59210-keine-audioausgabe-bei-hd-sender/
huhn
8th October 2017, 21:39
https://github.com/Nevcairiel/LAVFilters/issues/37
it would be better if people stop checking a check box because they can.
steakhutzeee
9th October 2017, 10:42
Well, of course i should have searched the solution because it's a well treated argument.
But after all i checked the option and then asked here, so i think this discussion is for help too, so i can learn and help others with same problem :)
Mikounou
9th October 2017, 12:24
Hello,
I have a problem with the lavfilters:
I can't bitstream DTS-HD HRA.
My reveiver (Onkyo RZ900) display only DTS but no sound.
No problem with other (Dolby Digital +, TrueHD, DTS or DTS-HD MA, DTS:X).
Even with latest nighly builds, same error...
I have tested many things, change all options in Lav Filters, but no luck :scared:
I am forced to uncheck each time the bitstream to activate the PCM conversion...
On some forums, they talk about a problem in the DTS header that would not be recognized on some amp.
Apparently when playing a DTS HD MA before the HRA track, the bitsream would work well (I did not manage to test)
Can you help me ? I have many BD with DTS-HD HRA tracks...
Thanks in advance
My config :
Windows 10 (latest update)
NVIDIA GTX 1070 (latest NVIDIA drivers)
Onkyo TX-RZ900 (latest firmware)
Latest MPC HC (nightly build)
varekai
9th October 2017, 12:34
Is it possible to have two versions installed?
I use BD-RB which requires LAVfilters 0.65 for avoiding audio sync issues.
Would like to use LAVfilters 0.70.2
sneaker_ger
9th October 2017, 12:53
What player do you use? MPC-HC comes with an internal LAV version.
(I know BD-RB users seem to stick to certain versions but I doubt using the latest will actually pose any problems.)
nevcairiel
9th October 2017, 13:28
Is it possible to have two versions installed?
No. DirectShow filters are registered in the system and as such only one can be installed/registered.
mzso
9th October 2017, 13:55
Is it possible to have two versions installed?
I use BD-RB which requires LAVfilters 0.65 for avoiding audio sync issues.
Would like to use LAVfilters 0.70.2
I tried doing this via registry tinkering for other reasons, but it failed. (LAV didn't load)
So I guess you need to compile your own version with a changed identifier/name from the 0.65 source.
varekai
9th October 2017, 14:39
@sneaker_ger
@nevcairiel
@mzso
OK, thanks for the info, appreciate it!
I use both MPC-HC and PotPlayer with madVR.
Compile my own version is way over my skills...
Gonna do some BD-RB testing with 0.70.2 installed.
aufkrawall
9th October 2017, 15:08
I notice some weird behavior with D3D11VA copyback: It roughly has twice as high CPU usage as DXVA2 copyback.
With EVR in MPC HC, this is just ~2% vs. ~4% CPU usage, but with madVR, it's ~6% vs ~12% (4k 50fps HEVC 10 bit video).
I noticed something similar with mpv.
Is D3D11VA somehow not as well suited as DXVA2 for copyback?
mark0077
10th October 2017, 18:57
Guys can I get a recommendation as to the best way to downmix content to 2.0 output. My cheap 5.1 system gave out on me so I have gotten a set of LS50 Wireless and plan to attach a sub to its sub output, as I normally don't really make a lot of use of the surround information anyways.
I'm wondering whats the consensus on the best way to downmix the likes of 5.1 to 2.0 without losing any of the LFE information. I want to send the full range of output to the speakers and decide from there how best to transfer the lower frequency content.
I have windows speaker configuration set to 2.0 and set that I have full range speakers (not that I think it even has any impact). I'm not sure which is best, to let windows mix whatever I throw at it, ie 5.1, down to 2.0, or use lav audios mixing to convert the 5.1 to 2.0. I know a lot of people use wasapi to try to avoid the windows mixer as its so bad. Is this still the case nowadays in Windows 10 and is using lav audio mixing + wasapi out from mpc still the best way to go?
Note: Whats throwing me off about bypassing lav audio decoder and just using mpc audio renderer, set to exclusive wasapi, is that the lfe channel in any surround sound test clips I have tried from say Dolby, still seems to be getting mixed into the 2.0.
e-t172
10th October 2017, 19:43
I'm wondering whats the consensus on the best way to downmix the likes of 5.1 to 2.0 without losing any of the LFE information. I want to send the full range of output to the speakers and decide from there how best to transfer the lower frequency content.
I don't know about the "consensus", but for me personally, I use the LAV Audio mixer with LFE set to 1.58 (=+4 dB, because ITU BS.775 LFE +10dB + two channels -6dB). That's the proper way to do it if you truly have a system that is capable of handling the full LFE output without overloading.
I have windows speaker configuration set to 2.0 and set that I have full range speakers (not that I think it even has any impact).
It doesn't. I have yet to find a scenario in which the "full range" setting in the Windows audio properties has any measurable effect.
I'm not sure which is best, to let windows mix whatever I throw at it, ie 5.1, down to 2.0, or use lav audios mixing to convert the 5.1 to 2.0.
I have measured the downmix coefficients that the Windows audio engine uses to downmix 5.1 to stereo. They are (for the left channel):
L = (L + -3dB*C + -10dB*LFE + -1dB*SL + -8dB*SR) * -10dB
These are weird coefficients that don't match the ITU BS.775 recommendation. I don't know why Microsoft decided to use these coefficients; maybe they're following different advice. As far as I know BS.775 is the standard to follow, which makes these coefficients wrong. This is the main reason why I use the LAV Audio mixer to downmix, not the Windows mixer.
I know a lot of people use wasapi to try to avoid the windows mixer as its so bad.
The Windows mixer is not "bad". Aside from the differences in downmixing coefficients that I've described above, you would be hard-pressed to find any perceivable difference in audio quality. Aside from very specific cases, most people who use WASAPI use it for dubious reasons (typically, an overparanoid obsession about getting "bit-perfect" output).
(The only case I know of where the Windows audio pipeline would degrade quality in perceivable ways is back in the days of Windows XP, where IIRC people had legitimate complains about the resampler not being good enough. The pipeline was completely revamped in Vista.)
Note: Whats throwing me off about bypassing lav audio decoder and just using mpc audio renderer, set to exclusive wasapi, is that the lfe channel in any surround sound test clips I have tried from say Dolby, still seems to be getting mixed into the 2.0.
I'm not sure what the problem is. If your sub is capable of handling it, then LFE should be included in the 2.0 downmix.
mark0077
10th October 2017, 19:56
Wow thanks for the replies e-t172, very informative. My only worry about LFE being detectable when using mpc audio renderer set to exclusive wasapi (lav mixer disabled), was that I thought in that case there was no mixer whatsoever involved, so I'm just confused as to whats mixing the LFE into the 2 channels in that particular case. Maybe its mpc renderer itself in this case (although i don't have it set to mix channels at all). I just want to know what pieces of software are involved in the various combinations. I'll use your approach of using lav audio to downmix and I'll use 0.71, 0.71 and 1.58 as recommended.
My main reason for trying to use wasapi in various cases (winamp / mpc) is so that I can play a mix of say 44.1khz and 48khz content, and my understanding is with wasapi there should be no conversion, where as without it, the mixer is converting to whatever I have set in windows sound settings.
Thanks again.
el Filou
10th October 2017, 20:32
I have yet to find a scenario in which the "full range" setting in the Windows audio properties has any measurable effect.It's used by the "Bass Management" feature available in the Enhancements tab in Windows' sound control panel.
e-t172
10th October 2017, 20:32
My only worry about LFE being detectable when using mpc audio renderer set to exclusive wasapi (lav mixer disabled), was that I thought in that case there was no mixer whatsoever involved, so I'm just confused as to whats mixing the LFE into the 2 channels in that particular case.
Maybe its mpc renderer itself in this case (although i don't have it set to mix channels at all). I just want to know what pieces of software are involved in the various combinations.
If you're playing 5.1 content using WASAPI Exclusive and a 2.0 output, and playback works (i.e. it doesn't fail to start), then something has to have downmixed it in some way. In WASAPI Exclusive Windows will not downmix; if an application tries to open an audio device in exclusive mode and the channel count doesn't match, Windows simply refuses to comply. LAV Audio will not downmix if you don't tell it to, so that indeed only leaves the MPC Audio Renderer as the only remaining step in the pipeline that could possibly have downmixed the audio.
My main reason for trying to use wasapi in various cases (winamp / mpc) is so that I can play a mix of say 44.1khz and 48khz content, and my understanding is with wasapi there should be no conversion, where as without it, the mixer is converting to whatever I have set in windows sound settings.
That's technically true, but I wouldn't bother. No-one can tell the difference.
It's used by the "Bass Management" feature available in the Enhancements tab in Windows' sound control panel.
Ah, that makes sense. I never used Windows Bass Management settings, so that explains why I couldn't tell what this option was for.
mogli
11th October 2017, 07:31
I have measured the downmix coefficients that the Windows audio engine uses to downmix 5.1 to stereo. They are (for the left channel):
L = (L + -3dB*C + -10dB*LFE + -1dB*SL + -8dB*SR) * -10dB
Interesting, how have you measured them? Did you account for phase changes?
Alot of people and companies suggested different mixing coefficients. Some switch phase for the surround channels or even apply adaptive loudness correction to some or all channels, e.g. have the surround channels louder in general but attenuate them when the front channels get loud.
So for now there's no reason to believe MS is doing anything wrong (here), they just use another method than the simplest one proposed by ITU.
Regarding WASAPI vs DirectSound the former is definitely much harsher here and the latter softer. Not saying this has anything to do with quality. Actually DS sounds more pleasing to my ear. I guess MS is doing some polishing of the sound with DS (not that I'm aware of having any effects activated) but not with WASAPI.
e-t172
11th October 2017, 09:58
Interesting, how have you measured them? Did you account for phase changes?
Alot of people and companies suggested different mixing coefficients. Some switch phase for the surround channels or even apply adaptive loudness correction to some or all channels, e.g. have the surround channels louder in general but attenuate them when the front channels get loud.
I measured them by playing a test tone through each input channel in turn and measuring the level as it comes out the other hand. I'll admit I didn't try to determine whether it's doing any "clever" stuff like phase manipulation or non-linear processing. I was just trying to determine what the coefficients looked like in the simple, naive case so that I could compare them to other downmixers. I did not spend much time on it.
So for now there's no reason to believe MS is doing anything wrong (here), they just use another method than the simplest one proposed by ITU.
Well, in my book not following the international standard qualifies as "doing it wrong", but I guess it's a matter of debate. Ideally it should default to ITU-R BS.775 and perhaps allow the user to select another approach in the settings.
Regarding WASAPI vs DirectSound the former is definitely much harsher here and the latter softer. Not saying this has anything to do with quality. Actually DS sounds more pleasing to my ear. I guess MS is doing some polishing of the sound with DS (not that I'm aware of having any effects activated) but not with WASAPI.
Assuming nothing is broken on your system (e.g. your audio drivers are not doing dubious things behind your back), I cannot accept such claims. By default, aside from downmixing, the only thing the Windows audio engine does is mixing, sample format conversion, and sample rate conversion (if required). These cannot make the sound "harsher", "softer", or have any other audible effect unless they are done in a badly broken way, and they're not. This can easily be verified by e.g. using a virtual audio device (like Virtual Audio Cable) and then making loopback measurements: you'll find that there is no measurable difference whatsoever as the audio goes through the Windows audio engine and back again, aside from the obvious benign stuff that anyone would expect, like dithering noise.
littleD
11th October 2017, 20:39
Hi nevcairiel
i know that dx11va just arrived, but did you happen to dig in dx12 video pipeline yet? :) Would be that anything useful or just bloat? Some header with video interfaces in win 10 SDK d3d12video.h
nevcairiel
11th October 2017, 20:40
DirectX 12 doesn't add anything useful for video.
mogli
18th October 2017, 15:13
I have measured the downmix coefficients that the Windows audio engine uses to downmix 5.1 to stereo. They are (for the left channel):
L = (L + -3dB*C + -10dB*LFE + -1dB*SL + -8dB*SR) * -10dB
LFE is off by -10dB, should be -20dB, rest is correct. When using back channels instead of surrounds it's -1dB*BL + -6dB*BR.
So one can see what MS tries to accomplish:
Include all channels, even LFE, but at a very low level to assure no overload occurs.
Lower the stereo separation for surrounds and back channels to place them between center and fronts to hopefully decrease the masking.
Not a bad idea, I guess.
mclingo
19th October 2017, 14:35
Hi, started getting an odd problem recently, it either LAV or MADVR causing it but I cant decouple these to diagnose further. There seems to be a problem where changing back and forth from 1080p to 2160p and 3D I get a loss of handshake and I have to use DEVCON reset to get it back.
This is what happens (both KODI and MPC)
I play a 3D movie, after a few seconds on a blank screen my TV switches 3D mode and plays the movies no problems. If I stop the movie the TV comes out of 3D mode and then I get black screen.
If I put my HTPC into 1080p resolution this doesnt work so its something to do with how MADVR and LAV filters are dealing with refresh rate and resolution switching.
Any ideas anyone?
nevcairiel
19th October 2017, 17:23
That is not an area LAV interacts with. Actual output is not touched in any way, only decoded frames are being send onwards.
Pat357
19th October 2017, 21:19
Hi, started getting an odd problem recently, it either LAV or MADVR causing it but I cant decouple these to diagnose further. There seems to be a problem where changing back and forth from 1080p to 2160p and 3D I get a loss of handshake and I have to use DEVCON reset to get it back.
This is what happens (both KODI and MPC)
I play a 3D movie, after a few seconds on a blank screen my TV switches 3D mode and plays the movies no problems. If I stop the movie the TV comes out of 3D mode and then I get black screen.
If I put my HTPC into 1080p resolution this doesnt work so its something to do with how MADVR and LAV filters are dealing with refresh rate and resolution switching.
Any ideas anyone?
What modes have you listed in Madvr settings ?
When your screen is black and you go to 1080p, does it matter if your 1080p mode has a different FPS ?
like 3D 2160p 23p -> stop -> 1080p24 or 1080p50 (does this work ?)
From my experience, Madvr does handle changes in FPS very well, but if only other things change, like (2160p -> 1080p) or (3D -> not 3D) changes, it doesn't switch.
What actually means no FPS changes -> no switching !
huhn
20th October 2017, 10:24
d3d11 native with VP90 isn't working properly for me the video is totally distorted. D3D11 copyback works fine DXVa too.
nvidia 385.69
1060
VP9 profile 0
nevcairiel
20th October 2017, 10:43
If copy back works and native doesn't, madshi will need to to investigate this. He'll likely want a sample.
huhn
20th October 2017, 10:47
http://filehorst.de/d/cJnymJbo
could someone else please confirm the issue?
el Filou
20th October 2017, 12:05
Plays fine for me using d3d11 native.
1050 Ti 385.69, Windows 1703 x64, LAV latest nightly and madVR 0.92.7.
I'm using 32-bit players only though.
huhn
20th October 2017, 12:17
i guess i found the issue.
it's the CPU queue if it is over 48 it will start to produce garbage frames. with h264 is only goes to 39-40 with vp9 is uses the full 128.
so i don't know if madVR or lavfilter should stop at 39-40.
el Filou
20th October 2017, 12:20
nevcairiel warned not to go above 32 or something. ;)
huhn
20th October 2017, 12:27
did he? that a bummer the 128 subtitle queue is very useful...
nevcairiel
20th October 2017, 12:49
I've been considering limiting the number of buffers for decoding all formats forcefully to 32, but HEVC and H.264 seem to be fine with up to 127 buffers (which is the hard-limit in DXVA/D3D11) - although with those more advanced codecs, not all buffers are available to the renderer, since the decoder internally needs a bunch as well for reference frames and whatnot.
I added a hard-limit of 32 for VP9 now anyway, just like VC-1 which seems to also have that issue.
P.J
20th October 2017, 13:18
It seems D3D11 is useless for Nvidia Optimus =/
Wish I could use 940MX's de-interlacer...
huhn
20th October 2017, 13:19
i personally only need/use a high CPU queue (ignoring the subtitle queue here) for live streams to get a bigger buffer.
but maybe it is better to buffer more of the decoded stream i guess the queue settings in lav source could be used for this but i have no clue what could be a possible improve and it is hard to test buffering issue of live streaming. and what is a packet is is a frame a gop is it different from codec to codec...
nevcairiel
20th October 2017, 13:21
LAV Splitters final output queue should be mostly packet=frame, it re-assembles those as best as it can, which for the modern codecs should be fine.
huhn
20th October 2017, 13:33
it set it to some unreasonable setting like 4096 mb and 3600 packets and my mpc-hc memory usages got down from ~240 to ~145 even pausing the stream doesn't increase the buffer.
i guess a reasonable buffer would be 3-5 secs so your default settings.
aufkrawall
20th October 2017, 13:33
i personally only need/use a high CPU queue (ignoring the subtitle queue here) for live streams to get a bigger buffer.
This basicially means half of the buffer size for doubled framerate, which is bad since higher framerate means higher bitrate.
A clean solution would be a buffer in seconds like mpv does.
A CPU queue of 8 in madVR should work for livestreaming with youtube-dl though.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.