View Full Version : LAV Filters - DirectShow Media Splitter and Decoders
KoD
30th January 2016, 18:46
24 bit audio works perfectly fine with other files. When lav audio is set to downmix to stereo, it outputs 32 bit floats, and it still has the same issue. When I play any other file which is also decoded to 24 bit ints or 32 bit floats, they play fine too. It's only with this file that the sound is not ok.
Again, please test the file. I would have not posted this issue, without testing first.
nevcairiel
30th January 2016, 18:54
I tested your file and it plays fine with WaveOut for me.
The last remaining theory is that its TrueHD's fault. TrueHD is "special" in the sense that it has extremely short audio frames, 0.833ms usually (in contrast, DTS is 10.6ms and AC3 is 24ms). These short audio frames can cause some audio renderers to "screw up".
LAV already has some buffering in place to collect a few and output them as one to avoid issues with such audio renderers. However, maybe the limit I set is not strong enough for your WaveOut device, so I could potentially try to increase that a bit, and see if it helps.
sneaker_ger
30th January 2016, 18:59
@KoD
Can you test this remux of your file (https://www.sendspace.com/file/1x2c95)? It has the timecodes redone by mkvmerge.
KoD
30th January 2016, 19:13
The issue happens no matter what sample format is forced in lav audio: 16, 24, 32 bit integer, or 32 bit float. It's still there. And any other file (also other TrueHD audio muxes) work fine, no matter the output sample format.
Why is VLC saying that the input sample size is 32 bit while lav says it's 24 bit though?
However, maybe the limit I set is not strong enough for your WaveOut device, so I could potentially try to increase that a bit, and see if it helps.
How do I do that?
@KoD
Can you test this remux of your file (https://www.sendspace.com/file/1x2c95)? It has the timecodes redone by mkvmerge.
Thanks for trying to help. Unfortunately, it does not fix the issue. :(
sneaker_ger
30th January 2016, 19:14
How do I do that?
You don't, he has to change it in his code.
Actually, he already did. Try the upcoming nightly version.
KoD
30th January 2016, 19:22
Ok, I will try it and report back.
hu1kamania
30th January 2016, 20:00
I'd be prepared to bet this content is actually shot progressive, but transmitted in interlaced, with the bug added, so it is actually mixed content.
I'm not sure which bug you're referencing, the "Direct3D interop" bug that nevcairiel mentioned, simultaneous rendering limitations of CUDA with Windows 10 or is it related to MadVR? I get the most inconsistent results with MadVR. I'd be curious to know more.
That particular channel plays a lot of older Film based content. Like old westerns, as well as 80's and 90's action movies. I used the watermark in my example because it's good for a quick test.
What it really comes down to, between CUVID, DXVA2, yadif, and w3fdif deinterlacers, is their ability to handle sharp edges. For example, a lot of text on the screen during a commercial will appear to pulse as the deinterlacer tries to sync up, or a characters glasses might appear more aliased, any hard edges really. Motion further exacerbates the issue. I get the best results from CUVID, followed by yadif. It's a very pronounced difference. This is consistent with most content.
If I can figure out how to consistently capture an exact frame, I will submit screenshots between the four.
This might be a case where DXVA2 deinterlacing is not providing the quality that CUVID used to, or I could be totally insane! :p
huhn
30th January 2016, 20:19
could share a sample?
hu1kamania
30th January 2016, 20:39
could share a sample?
Sure thing :)
hu1kamania
30th January 2016, 23:12
could share a sample?
http://www.filedropper.com/sample1_1
Here is a sample where pretty much anything looks better than hw deinterlacing via MadVR. Comparing yadif to CUVID is more difficult with this sample.
Keep in mind, I'm using Windows 10 and CUVID via Nvidia's 350.12 driver.
nevcairiel
30th January 2016, 23:23
http://www.filedropper.com/sample1_1
Here is a sample where pretty much anything looks better than hw deinterlacing via MadVR. Comparing yadif to CUVID is more difficult with this sample.
Keep in mind, I'm using Windows 10 and CUVID via Nvidia's 350.12 driver.
That file seems to be telecined, not interlaced.
You need a IVTC, not a deinterlacer.
Disable all deinterlacers in LAV (both CUVID and Software), and set madVR in processing -> deinterlacing to "disable automatic source type detection" -> "force film mode". It should report a constant 3:2 cadence in the OSD and show the video without artifacts.
The artifacts from telecined and interlaced content often look very similar, but in contrast to interlaced, telecined can be fully restored to its original image without any quality loss, if done properly.
Generic deinterlacers are often not capable of doing this, hence dedicated Inverse-Telecine (IVTC) algorithms.
hu1kamania
31st January 2016, 00:09
That file seems to be telecined, not interlaced.
You need a IVTC, not a deinterlacer.
Disable all deinterlacers in LAV (both CUVID and Software), and set madVR in processing -> deinterlacing to "disable automatic source type detection" -> "force film mode". It should report a constant 3:2 cadence in the OSD and show the video without artifacts.
The artifacts from telecined and interlaced content often look very similar, but in contrast to interlaced, telecined can be fully restored to its original image without any quality loss, if done properly.
Generic deinterlacers are often not capable of doing this, hence dedicated Inverse-Telecine (IVTC) algorithms.
Thank you for elaborating on the difference between telecined and interlaced. I'll bet you've had to do it a thousand times for the less knowledgeable folks like myself. No doubt you're hitting at the heart of the matter here.
Force Film Mode works fantastic in this specific clip, but this clip is a commercial for a sports program. Golf to be precise. When the program resumes, it becomes jerky, thus it's mixed content right?
CUVID provides IVTC as well, and it seems to provides more consistent results with most content that I view. It's closer to "set it and forget it", when compared to MadVR's auto setting.
This wasn't the case when I used newer drivers in Windows 8.1. At that time CUVID hw deinterlacing was on par with MadVR set to Auto, so CUVID was pointless. Switching to a much older driver; 350.12 in Windows 10, I got better results. 350.12 should work even better in Windows 8.1, but I'm not going back to find out.
As the only two options for IVTC are DXVA2 and CUVID, and CUVID is practically defunct, this might be an issue to take up with madshi. I don't know how much control you guys have over hardware deinterlacing, so bringing DXVA2 in line with older CUVID might not be feasible. If what I'm reporting is even accurate.
huhn
31st January 2016, 00:49
maybe there is just a bug in madVR just check EVR for DXVA deinterlancing.
for all of my test CUVID and DXVA2 where identical they even made the same major mistakes.
hu1kamania
31st January 2016, 01:13
maybe there is just a bug in madVR just check EVR for DXVA deinterlancing.
for all of my test CUVID and DXVA2 where identical they even made the same major mistakes.
Could be, I'll check it out. I'd be happy to identify a bug.
What sorts of mistakes?
hu1kamania
31st January 2016, 03:28
The more I look at it, the more I realize the problem is tied to MadVR's struggle with mixed content. Here is a second sample, a continuation of the last. Here you can see where MadVR falls short, and CUVID stays smooth throughout.
http://www.filedropper.com/sample2
MadVR set to auto (defaults to Video in this case) struggles with the car commercial, but does well with the golf portion. Force it to Film, and the inverse is true. CUVID does well with both. Could this indicate a bug with MadVR?
huhn
31st January 2016, 10:48
if EVR looks better yes.
KoD
31st January 2016, 11:45
Regarding the issue (http://forum.doom9.org/showthread.php?p=1755407#post1755407) I reported with waveout on that sample with TrueHD audio, I'm happy to report that the build with increased buffer size has done the trick. Now the sample plays fine through both the optical S/PDIF output and through the nvidia hdmi out, while before it failed with both. Thanks for identifying the cause and fixing the issue!
Manni
31st January 2016, 13:00
Feature request:
Would it be possible to select a different bitstreaming option for Atmos and Dolby TrueHD and for DTS-HD and DTS:X?
Some AVRs, including all D&M models, are not able to apply DSU to DTS:HD tracks or Neural:X to Dolby TrueHD tracks after the upgrade to the DTS:X f/w. This is a limitation of the implementation.
The only workaround is to output the audio track as LPCM to be able to apply any upmixer, but then of course you have to change that setting again when you want to decode Atmos or DTS:X, as these need to be bitstreamed for the AVR to get the metadata and decode them.
So the solution would be to enable bitstream only for Atmos and DTS:X tracks, and leave them as LPCM for all the other formats, including HD audio tracks.
I hear jRiver is able to do this, so I was wondering if LAV would be able to make this distinction as well, maybe thanks to progress with Mediainfo or other libraries in reporting the presence of metadata in the HD Audio track.
Thanks for considering this!
nevcairiel
31st January 2016, 13:16
I have no plans to make bitstreaming any more conditional than it is right now.
I don't really want to need to parse the entire bitstream just to find out if its supposed to be bitstreamed.
Manni
31st January 2016, 13:25
I have no plans to make bitstreaming any more conditional than it is right now.
I don't really want to need to parse the entire bitstream just to find out if its supposed to be bitstreamed.
Thanks for the quick reply.
I understand but why would you need to parse the whole file? Can't you use the reporting from mediainfo? It supports Atmos since December (not sure about DTS:X).
I was only suggesting to split the bitstreaming options (so for example to be able to select different options for Atmos and TrueHD), not for you to add any logic, as different users will want different things depending on their AVRs capabilities/limitations.
nevcairiel
31st January 2016, 13:32
I also don't want to add a dependency on some external library just for some obscure feature.
Manni
31st January 2016, 13:33
I also don't want to add a dependency on some external library just for some obscure feature.
Thanks, I understand.
Manni
31st January 2016, 14:13
One last question, I don't think LAV supports keyboard shortcuts? A shortcut to enable/disable bitstreaming globally would be a fine solution.
I wonder how iRiver and Mediainfo detect Atmos vs TrueHD. I guess they do parse the file, as Mediainfo also reports the bitrate.
By the way it's still obscure now because the DTS:X update only landed on the 28th of January for the first AVR supporting it (the Denon X7200WA).
It will get worse as other models are upgraded and users lose the ability to cross-upmix between formats, especially if other manufacturers like Yamaha have the same limitation.
Of course if you have no interest in immersive audio I can see why there is no motivation to address this.
Again, thanks for the time you took to consider this. I won't ask again, promise :).
nevcairiel
31st January 2016, 14:54
Maybe you should address this loss of existing functionality with the manufacturers instead.
amayra
31st January 2016, 16:41
Q: Will you write a Subtitle Filter?
A: Its possible, nothing has been determined yet.
can you give me a % for chance you make a VSFilter (or XySubFilter) alternative
Manni
31st January 2016, 17:39
Maybe you should address this loss of existing functionality with the manufacturers instead.
I'm not asking you to fix anything for the manufacturers, I'm asking for a feature. It is your right not to be willing to implement it. Again, thanks. I won't ask again. :)
hu1kamania
31st January 2016, 20:28
if EVR looks better yes.
Not surprisingly, EVR reacted the same as MadVR set to auto. With the overlay up, there is a clear distinction between CUVID and DXVA2. Here are some screenshots illustrating this point:
CUVID1 (http://i.imgur.com/sITtTsG.jpg)
CUVID2 (http://i.imgur.com/HXJifIf.jpg)
DXVA2_1 (http://i.imgur.com/8Ds92FN.jpg)
DXVA2_2 (http://i.imgur.com/3iinuWY.jpg)
Notice the difference between peaks? There is something going on here. :confused:
nevcairiel
31st January 2016, 20:32
Not surprisingly, EVR reacted the same as MadVR set to auto. With the overlay up, there is a clear distinction between CUVID and DXVA2. Here are some screenshots illustrating this point:
CUVID1 (http://i.imgur.com/sITtTsG.jpg)
CUVID2 (http://i.imgur.com/HXJifIf.jpg)
DXVA2_1 (http://i.imgur.com/8Ds92FN.jpg)
DXVA2_2 (http://i.imgur.com/3iinuWY.jpg)
Notice the difference between peaks? There is something going on here. :confused:
That is irrelevant, its only the difference of sending 29.97 or 59.94 to the renderer (before and after deinterlacing), it makes frame timing different and therefor the graph.
huhn
31st January 2016, 21:02
it's not the same frame quality can't be judged this way.
hu1kamania
31st January 2016, 21:13
That is irrelevant, its only the difference of sending 29.97 or 59.94 to the renderer (before and after deinterlacing), it makes frame timing different and therefor the graph.
This can been viewed in each screenshot, at the top as Frame Rate, correct?
I don't know if this is getting into the realm of a MadVR feature request, and MadVR design philosophy but, I don't to have an option in EVR or MadVR of sending 59.94. Perhaps that is a bad idea?
The best I can do is enable yadif to 50p/60p or disable MadVR's deinterlacing and enable CUVID at 50p/60p.
huhn
31st January 2016, 21:46
this part said it get's 29i so it is deinterlanced to 59p. so everything is working as intended.
CUVID fails hard on your first screen BTW.
hu1kamania
31st January 2016, 22:21
this part said it get's 29i so it is deinterlanced to 59p. so everything is working as intended.
CUVID fails hard on your first screen BTW.
Are you talking about the logo? I see that too. These screenshots are not taken at the exact same frame. In the CUVID sample the scene is beginning to fade. That said, I wouldn't be surprised if there was some visual differences between the two decoders.
Everything is working as intended, and yet MadVR/EVR struggles to render that sample smoothly from start to finish. CUVID or yadif at 50/60p provides a more consistent experience.
baii
31st January 2016, 22:47
Just tried out w3fdif, to me it seems that it definitely have less artifact(horizontal ziggy line thingy) for motion vs HW(AMD direction or vector adaptive), but it kind of have the "soap opera" effect like a real TV. I guess I just got used to HW deinterlace, vs watching real TV.
huhn
31st January 2016, 22:54
This can been viewed in each screenshot, at the top as Frame Rate, correct?
I don't know if this is getting into the realm of a MadVR feature request, and MadVR design philosophy but, I don't to have an option in EVR or MadVR of sending 59.94. Perhaps that is a bad idea?
The best I can do is enable yadif to 50p/60p or disable MadVR's deinterlacing and enable CUVID at 50p/60p.
the stats are meaningless they show no delayed, dropped or reapeated frame so everything is fine in the stats.
hu1kamania
31st January 2016, 23:35
the stats are meaningless they show no delayed, dropped or reapeated frame so everything is fine in the stats.
Correct, I misunderstood what was happening. With CUVID and yadif deinterlacing it gets converted before it reaches MadVR/EVR. Without CUVID hw deinterlacing or yadif, it happens with MadVR or EVR.
My sample from start to finish plays back more smoothly without MadVR or EVR doing the deinterlacing. Is this by design?
My understanding of what I'm seeing is evolving, thank you for your patience as I work through this.
huhn
1st February 2016, 00:19
deinterlancing quality of telecine content is so bad for me right now that there has to be a bug in the way how madVR, EVR or my system is using DXVA2 deinterlancing.
nvidia DXVA2 deinterlancing should have a field matching algorithm but that is clearly not working.
it is currently w3fdif for interlanced and madVR film mode for 3:2 telecine.
hu1kamania
1st February 2016, 01:07
deinterlancing quality of telecine content is so bad for me right now that there has to be a bug in the way how madVR, EVR or my system is using DXVA2 deinterlancing.
nvidia DXVA2 deinterlancing should have a field matching algorithm but that is clearly not working.
it is currently w3fdif for interlanced and madVR film mode for 3:2 telecine.
This must be the case. Do you show the same results with AMD?
I think Nvidia was on the right track with CUVID, but it's in the past now. I like the switch to DXVA2 but I believe something was lost somewhere along the way.
Barring an unlikely update, CUVID is dead to me now. I'll be moving back to DXVA copy-back, and I'll suffer along with you.
I'm confident a solution will surface someday. The knowledge displayed here might not show it, but I've been following the development of video play back for close to fifteen years. I'll continue to follow the work of people like nevcairiel and madshi. The work they do is inspiring.
Future concerns with DXVA2 deinterlacing will be directed towards MadVR. Thanks for your patience huhn! I've enjoyed the journey. ;)
huhn
1st February 2016, 01:11
deinterlancing is totally broken with crimson.
and because nvidia deinterlancing isn't working for me doesn't mean it isn't working in general and it worked fine on interlanced content.
unknownsoldierX
1st February 2016, 17:34
Win 7 x64
AMD HD2400 card
I can't get DXVA to work for VC-1/WMV3 in MPC-HC. Going by this (https://trac.mpc-hc.org/ticket/2518), the internal filters do not work with this card. I was using ffdshow tryouts, and I tried disabling the internal wmv3 filter and adding ffdshow as an external, but that still didn't give me DXVA.
Now I have LAV set as the external video and audio filters. LAV and MPC-HC are both set to DXVA2 (copy-back). When I right click on playing video and check filters, it shows that it is using the LAV video decoder, but I can tell it's definitely not using DXVA.
nevcairiel
1st February 2016, 17:35
VC1/WMV3 is not supported on old AMD cards like that one, sorry.
NikosD
2nd February 2016, 11:32
Win 7 x64
AMD HD2400 card
I can't get DXVA to work for VC-1/WMV3 in MPC-HC.
Interesting card, I copy from Wikipedia:
Several reports from owners of HD 2400 Pro suggest the card do not fully support hardware decoding for all H.264/VC-1 videos.
The device driver, even with the latest stable version, seem to only honor hardware decoding for formats specified in the Blu-ray and HD-DVD specification.
As a result of such restriction, the card is not deemed very useful for hardware video decoding since the majority of the H.264/VC-1 videos on the net are not encoded in those formats (even though the hardware itself is fully capable of doing such decoding work).
This device driver restriction has led to the development of a third party driver patch, "ExDeus ATI HD Registry Tweak", to unlock the potential of HD 2400 Pro for full support of H.264/VC-1 hardware video decoding.
The link for that "ExDeus ATI HD Registry Tweak" are:
http://home.comcast.net/~exdeus/ati-hd2x00/
http://www.avsforum.com/t/872538/ati-radeon-hd-2x00-2400-2600-2900-series-owners-thread/2010#post_11622510
http://www.avsforum.com/t/872538/ati-radeon-hd-2x00-2400-2600-2900-series-owners-thread/2100#post_11659897
Also, you could try MPC-HC v1.6.9 or older.
omarank
2nd February 2016, 14:21
With the latest LAV nightly, DTS/ DTS-HD audio is broken when played in MPC-HC 32 bit. The problem does not manifest in MPC-HC 64 bit and JRiver MC. By broken, I mean the sound is all garbled.
I am using LAV filters as external filters in MPC-HC. When the internal filters are used in the latest nightly of MPC-HC 32 bit (v1.7.10.101.x86), there is no problem.
nevcairiel
2nd February 2016, 14:25
Everything works perfectly fine here.
If you are using the Internal Audio Renderer in MPC-HC, I would personally still advise against it, I can easily make it break in various ways.
In any case you need to provide more details. MPC-HC 32-bit is usually the platform I test the most on and generally also develop on, so if that would be broken, I would hope to notice.
omarank
2nd February 2016, 17:46
Ok, I did more testing and found that the problem is manifested only in WASAPI exclusive output. When I use the Internal Audio Renderer, the sound is garbled with WASAPI excl output. When I use Reclock, I get all noise (static) with WASAPI excl output. DirectSound and WaveOut output work fine.
In case of JRiver Media Center, both the Event Style and Non Event Style WASPI excl output work perfectly.
I was using v0.67.0-66 build before upgrading to v0.67.0-72. I tried reverting to the older build. There is no such problem with that build.
Please let me know what other information I need to provide to help you reproduce/ diagnose the problem.
nevcairiel
2nd February 2016, 18:25
You could try the other intermediate nightly versions to check when it started specifically, like, does it already happen with 0.67.0-70 from two days ago?
Personally I don't see why or how it should have broken, in particular only with exclusive mode, there is nothing special to that mode for an audio decoder. It just hands out audio.
Also, do all files break with DTS? Just some? What does that LAV Audio status page say when a broken file is playing? Did it say something different in a previous version?
GCRaistlin
2nd February 2016, 18:29
How do I enable new deinterlacing engine? I see only "YADIF" in the properties.
sneaker_ger
2nd February 2016, 18:32
What build are you using? You need a recent nightly version to test the new deinterlacer.
omarank
2nd February 2016, 19:19
You could try the other intermediate nightly versions to check when it started specifically, like, does it already happen with 0.67.0-70 from two days ago?
Personally I don't see why or how it should have broken, in particular only with exclusive mode, there is nothing special to that mode for an audio decoder. It just hands out audio.
Also, do all files break with DTS? Just some? What does that LAV Audio status page say when a broken file is playing? Did it say something different in a previous version?
Just checked v0.67.0-70. The problem does not happen with that build.
Yes all videos with DTS/ DTS-HD track exhibit the problem. LAV audio status page shows the input audio codec correctly – whichever DTS track is there. For example, Input: dts-hd ma; 6 / 0x60f; 48000, 16bit Integer; Output: PCM; 2 / 0x3; 48000; 32bit Float.
Just observed one more thing – the problem happens in seeking only. If I let a movie play from the starting, there is no problem.
When the audio is garbled, video plays in slow motion.
GCRaistlin
2nd February 2016, 20:02
sneaker_ger
Sorry, my fault. It's available in the latest MPC-HC nightly.
nevcairiel
2nd February 2016, 20:05
Just checked v0.67.0-70. The problem does not happen with that build.
Yes all videos with DTS/ DTS-HD track exhibit the problem. LAV audio status page shows the input audio codec correctly – whichever DTS track is there. For example, Input: dts-hd ma; 6 / 0x60f; 48000, 16bit Integer; Output: PCM; 2 / 0x3; 48000; 32bit Float.
Just observed one more thing – the problem happens in seeking only. If I let a movie play from the starting, there is no problem.
When the audio is garbled, video plays in slow motion.
I found the problem, it was a rather weird one. Will be fixed in the next nightly.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.