View Full Version : LAV CUVID Decoder - High Quality Hardware decoding for NVIDIA
hoborg
3rd May 2011, 19:48
If i ever get terribly bored, i might just buy a 5450 or some other very cheap model. But me getting bored, right, thats going to happen. :devil:
He,he :D
If you do, get 6450, it have UVD 3.0, it is already available with nerly the same price as 5450 :)
Hi,
Why doesn't this decoder work with Haali Renderer? I prefer Haali coz I do lots of screen capping when I watch movies or TV shows & for that I've to use framestep regularly to capture a perfect frame & Haali is the only renderer that works smoothly. All other renderers either get stuck or mess up the frames when using framestep back. So is there a way to make it work with Haali renderer?
AFAIK, the Haali renderer only accepts YUY2 and RGB32. LAV CUVID outputs NV12 or YV12. So no match.
I guess you could use ffdshow raw or something like that between the decoder and the renderer to convert to a different colorspace. I don't use it or know what the potential downsides are though.
nevcairiel
3rd May 2011, 21:07
YUY2 is a 4:2:2 pixel format, converting to that, if not done right, will seriously degrade your quality. Your best bet would be using ffdshows HQ RGB32 conversion..
SamuriHL
3rd May 2011, 21:12
Yes, otherwise you can find serious banding issues and other nasty problems. Make sure you use dithering if you go the RGB32 route.
BeNooL
3rd May 2011, 21:34
If I get the documentation correctly, this should work on a 8600 GTS card, right?
Anyone managed to get it to work? on XP SP3?
I tried and while I can get to the configuration screen, loading a file in MPC-HC I have no video displayed at all (after disabling FFDShow, current decoder).
My setup is maybe particular as I have the GeForce card as secondary card just for CUDA crunching in BOINC, the main card being a AMD 4550 card and that's where my displays are connected.
nevcairiel
3rd May 2011, 21:36
Hm, only a secondary card without a connected display? That might cause it to break .. i really cannot say with that setup, though.
If I get the documentation correctly, this should work on a 8600 GTS card, right?
Anyone managed to get it to work? on XP SP3?
worked fine for me when i was on xp, never have any issues using the old 8600gt, plays every thing great :)
BeNooL
3rd May 2011, 22:02
Hm, only a secondary card without a connected display? That might cause it to break .. i really cannot say with that setup, though.
Yes there is no physical screen connected to the GeForce card still in windows I activated the attached option to have a 'default monitor' showing otherwise the card becomes unavailable for CUDA work.
Aleksoid1978
3rd May 2011, 23:34
Bad Deinterlacing on this sample - http://aleksoid.tosei.ru/Test/Sample/LUXE%20TV%20HD.ts.
With internal MPC-HC DXVA Decoder look much better.
HeadlessCow
4th May 2011, 05:22
DGIndexNV works perfectly fine using CUVID on a second card with no monitor attached, so I would assume this works fine as well.
nevcairiel
4th May 2011, 06:46
Bad Deinterlacing on this sample - http://aleksoid.tosei.ru/Test/Sample/LUXE%20TV%20HD.ts.
With internal MPC-HC DXVA Decoder look much better.
The DXVA decoder does not do any deinterlacing.
In any case, its the hardware doing deinterlacing, you want to whine, whine at NVIDIA. :p
Aleksoid1978
4th May 2011, 08:15
The DXVA decoder does not do any deinterlacing.
In any case, its the hardware doing deinterlacing, you want to whine, whine at NVIDIA. :p
But with MPC-HC DXVA Decoder all look fine.
nevcairiel
4th May 2011, 08:31
Because the renderer deinterlaces then.
But anyway, i don't care how other decoders look. I cannot control how deinterlacing looks, except with the options i already have. If it fails do deinterlace some stream, its a NVIDIA problem.
tetsuo55
4th May 2011, 09:36
iirc it has to do with the output colorspace.
If you output nv12 and keep the interlace flags nvidia drivers should take it from there?
Ok! Thanks guys, will try ffdshows HQ RGB32 conversion!
ashlar42
4th May 2011, 21:11
Tried with BBC Life BD rips (VC-1 1080i50). Works great!
There's a strange interaction with the double frame rate setting. MadVR reports dropped frames like there's no tomorrow... But it's a lie, as everything is silky smooth. The same doesn't happen with MPEG2 interlaced material.
nevcairiel
4th May 2011, 21:53
if madVR reports dropped frames, there are dropped frames. My guess is that you're running on a lower refresh rate then 50Hz, then it has to drop frames to make it fit without you really seeing any stuttering.
ashlar42
5th May 2011, 08:23
Honestly, I'd say no. The lost frames start to be reported only when MadVR is playing in exclusive mode. As soon as I activate a menu in MPC-HC, MadVR switches to windowed mode and the lost frames stop to be reported. After three seconds, MadVR goes back to exclusive mode and lost frames are reported again.
Now, during the switch, there really is no change in playback smoothness. After six years of HTPC use I would most definitely notice if frames were lost by the hundreds. Heck, I get annoyed by a single glitch...
MadVR reports refresh rate as 50.000xxxx. Reclock reports refresh rate as 50.000. My Pioneer Kuro reports refresh as 50Hz. The refresh doesn't change when switching in and out of exclusive mode (the TV would indicate that happening).
I'm ready to provide whatever logs are needed to debug/evaluate this. But could you be so kind as to point me out how to activate debug logs or stuff like that in MPC-HC (I'm mainly a XBMC user).
Thanks!
nevcairiel
5th May 2011, 08:24
madVR has a debug logging feature, but thats somethign you should bring up in the madVR thread.
mark0077
5th May 2011, 20:11
nev, using the latest version of your filter and decoder, I tried playing the 25fps avi file from the following web page to test audio / video desync.
http://editorsean.com/blog/49-audiovideosynctest
I get no video when your video decoder kicks in. This is the info from the clip. I hope this helps. Its a GTX295, Windows 7 64bit.
Filter : LAV CUVID Decoder - CLSID : {62D767FE-4F1B-478B-B350-8ACE9E4DB00E}
- Connected to:
CLSID: {CEA8DEFF-0AF7-4DB9-9A38-FB3C3AEFC0DE}
Filter: C:\Users\Mark\Downloads\sound_in_sync_test.avi
Pin: Video 0
- Connection media type:
Video: Xvid 320x288 25.00fps 57kbps
AM_MEDIA_TYPE:
majortype: MEDIATYPE_Video {73646976-0000-0010-8000-00AA00389B71}
subtype: Unknown GUID Name {44495658-0000-0010-8000-00AA00389B71}
formattype: FORMAT_VideoInfo {05589F80-C356-11CE-BF01-00AA0055595A}
bFixedSizeSamples: 1
bTemporalCompression: 0
lSampleSize: 368640
cbFormat: 88
VIDEOINFOHEADER:
rcSource: (0,0)-(0,0)
rcTarget: (0,0)-(0,0)
dwBitRate: 57750
dwBitErrorRate: 0
AvgTimePerFrame: 400000
BITMAPINFOHEADER:
biSize: 40
biWidth: 320
biHeight: 288
biPlanes: 0
biBitCount: 24
biCompression: XVID
biSizeImage: 276480
biXPelsPerMeter: 0
biYPelsPerMeter: 0
biClrUsed: 0
biClrImportant: 0
pbFormat:
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0020: 96 e1 00 00 00 00 00 00 80 1a 06 00 00 00 00 00 –á......€.......
0030: 28 00 00 00 40 01 00 00 20 01 00 00 00 00 18 00 (...@... .......
0040: 58 56 49 44 00 38 04 00 00 00 00 00 00 00 00 00 XVID.8..........
0050: 00 00 00 00 00 00 00 00 ........
Also with your audio decoder, I get no sound after 1 or 2 seeks. Please let me know if you can reproduce or I can provide any more info etc. Thanks!
nevcairiel
5th May 2011, 20:17
The GTX295 does not support XVID decoding.
mark0077
5th May 2011, 20:19
Cool, so should the decoder reject so that something like ffdshow in my filter chain can take over? Is your filter currently able to check what the gpu supports like this or is it something that might be possible in a future version?
nevcairiel
5th May 2011, 20:30
I wish it would be easy to detect whats supported, but its not. :(
Some future version might do it.
Just untick the checkbox in the config.
mark0077
5th May 2011, 20:33
Thanks! Any ideas what might be up with the audio problem on seek. I'll see can I reproduce with other clips too.
mindbomb
5th May 2011, 20:44
gtx 295 doesnt support mpeg 4 asp hardware decoding
edit: wow, i was late on this one lol
Aleksoid1978
7th May 2011, 11:44
Crash at this sample https://rapidshare.com/files/460405805/Vier-001.mkv
Cyberlink and MPC-HC(rev. 3090) decoder play fine
nevcairiel
7th May 2011, 11:44
I told you before, crashes are in NVIDIAs code.
Aleksoid1978
7th May 2011, 13:59
I told you before, crashes are in NVIDIAs code.
But - we can skip the broken section, and continue playback.
yesgrey
9th May 2011, 16:41
Any possibility of adding an option to force deinterlacing on all sources independently of the interlaced flags state? For example an auto/force? If a file is bad flagged it's not possible to deinterlace it...
mark0077
9th May 2011, 16:49
I second this request :) Most of my PAL DVDs are badly flagged and end up being incorrectly deinterlaced to 50fps when they are 100% perfect in their original form at 25fps.
I actually have compiled a text file list of video files on my machine that really do need de-interlacing, and use a small script to set the ffdshow de-interlace registry option on / off before playback depending on whether I have the file listed. I'm now going to use lavcuvid for all of my decoding and will take advantage of the fact that it can use the hardware deinterlacers so an option to force on / force off would be fantastic. I'll set this on/off via registry before playback if possible... :)
nevcairiel
9th May 2011, 17:18
Any possibility of adding an option to force deinterlacing on all sources independently of the interlaced flags state? For example an auto/force? If a file is bad flagged it's not possible to deinterlace it...
I'm not sure i get it. Is there a way to have interlaced fields in a bitstream and make the decoder think its actually a full frame? Thats possible? I always thought fields and frames would be encoded differently
Anyhow, do you happen to have a sample file i can use to see if its actually possible to force deinterlacing?
madshi
9th May 2011, 17:35
You can encode interlaced content one field at a time, or you can encode it as frames. When it's encoded as frames, you can still mark the frames as being interlaced. I think you can also encode as frames without marking the frames as interlaced, even if they're interlaced. It's all pretty much a mess. E.g. let's talk about h264:
If "sequence_header.frame_mbs_only_flag" is set to 1 that means that all frames are progressive. If it's set to 0 then we basically don't know whether the content is progressive or interlaced. If "slice_header.field_pic_flag" is set to 1 then we have an interlaced field. If it's 0, it can be a progressive frame or an interlaced frame (interlaced frame = 2 interlaced fields weaved together and encoded as a frame). Then we have "picture_timing_SEI.pic_struct" which can mark a field/frame as one of {frame, top field, bottom field, tf+bf, bf+tf, tf+bf+tf, bf+tf+bf, frame doubling, frame tripling}. If the frame is marked as e.g. "tf+bf" you still don't know if it's film content marked for interlacing after decoding, or whether it's natively interlaced content. Then we have "picture_timing_SEI.ct_type" which can indicate native progressive, native interlaced or unknown content.
IMHO, for h264, if "sequence_header.frame_mbs_only_flag" is set to 1 you should not offer/do deinterlacing, because the video track should be truely progressive. And if "picture_timing_SEI.ct_type" indicates "progressive" or "interlaced" then you should probably trust that, too - although it can change from one frame to the next. But in all other cases it's probably not clear whether the source is progressive or interlaced. So you may want to offer the option to deinterlace. I don't really know, though, whether you can force CUVID to deinterlace, if it thinks it's not necessary...
yesgrey
9th May 2011, 18:30
Anyhow, do you happen to have a sample file i can use to see if its actually possible to force deinterlacing?
It's strange... Yesterday I thought the deinterlacing was not being done, but today I've tried and it seems to be working OK with the file I mentioned...
However, after cutting a small sample (http://www.megaupload.com/?d=0TUSOTHL) with mkvtoolnix (latest release) to upload to you, a new strange thing happened...
With the original file (backup from original DVD to mkv file using eac3to) the LAV CUVID says 59.94 fps, but with the cut sample it says 29.97fps. It seems mkvtoolnix broke something...
Dogway
9th May 2011, 18:39
Nvidia 9600M GT - driver 266.58
Core2Duo 2.53 T9400 1066FSB. 4Gb DDR3 533Mhz
Laptop WinXP SP3 x86
Just a little up to date of my post (http://forum.doom9.org/showthread.php?p=1493357#post1493357) of decoding speeds for different decoders.
Using the AVC sample of yesgrey's post (http://forum.doom9.org/showthread.php?p=1493275#post1493275). This time using graphstudio, and LAVSplitter 0.25.
All in weave.
ffdshow ffmpeg-mt 50.9 fps
Cyberlink PDVD10 47.2 fps
ffdshow libavcodec 31.8 fps
CoreAVC 2.5.5 22.8 fps
LAVCUVID 0.6 22.7 fps
edit: can LAVCUVID bypass decoding ASP if card doesn't support it? I tried playing a divx5 and screen was black.
nevcairiel
9th May 2011, 18:47
edit: can LAVCUVID bypass decoding ASP if card doesn't support it? I tried playing a divx5 and screen was black.
Currently not automatically. You can disable it on the properties page, however.
mindbomb
9th May 2011, 23:48
hey everyone.
I've been recommending this decoder to alot of ppl, and a small fraction of them have trouble installing it, despite having the latest vc runtime installed.
Any possible ideas why?
SamuriHL
9th May 2011, 23:51
UAC issues possibly.
nevcairiel
10th May 2011, 06:52
hey everyone.
I've been recommending this decoder to alot of ppl, and a small fraction of them have trouble installing it, despite having the latest vc runtime installed.
Any possible ideas why?
They also need a fairly recent NVIDIA driver, 260 series at least (CUDA 3.2 support).
Installation is otherwise pretty straight forward:
- Unpack
- Right-click install.bat -> Run as Administrator
- Done!
I'll create a installer at some point, should be trivial for this small filter.
I also have some plans to possibly ease up on the NVIDIA driver requirement, and detect at runtime which version of the APIs i can use.
oddball
11th May 2011, 08:09
I've got an issue wuth CUVID whcih I am not sure is an issue or not. If I put CUVID before ffdshow in MPC externals filters section. 25FPS and 29.97FPS material (well DVD remuxes actually) get frame doubled and messes with ReClock. I use ReClock for PAL speedown and I have to forcefully tell ReClock that it's 25FPS. If however I put it after ffdshow ReClock works as expected. Not sure if that's right though. I've not noticed any problems running it this way. I do not notice any interlacing issues either using both methods.
nevcairiel
11th May 2011, 09:10
If you put it after ffdshow, i'm sure ffdshow is actually doing the decoding.
Anyhow, it would seem like your DVDs are either interlaced, or the frames are at least marked as interlaced, and therefor the double framerate mode activates. In case you didn't notice, you can actually disable that option in the LAV CUVID settings.
oddball
11th May 2011, 09:39
Nope! CUVID is definitely the decoder. I know this because I have ffdshow's codecs disabled and when I right click on MPC in filters it shows CUVID there. Plus the CPU load is a lot less too. Yes I know you can turn off framerate doubling in CUVID but that does not answer my question. Why is it playing 25FPS after ffdshow in MPC and 50FPS before it? It makes no difference to playback from what I can see other than messing with ReClock if it's before ffdshow.
pankov
11th May 2011, 10:53
oddball, I apologize for intruding in your conversation with Nevcairiel but I don't understand what do you mean by "ffdshow is before CUVID" and still not decoding. How do you know it's "before"? Do you see it in GraphEdit/GraphStudio? Can you post the input and output pins properties of both filters?
oddball
11th May 2011, 11:40
I use ffdshow in the chain for deband, sharpening etc and yes I have tested to make sure ffdshow filters are actually working and it's not being bypassed when set in a different order in MPC external filters.
- Connected to:
CLSID: {62D767FE-4F1B-478B-B350-8ACE9E4DB00E}
Filter: LAV CUVID Decoder
Pin: XForm In
- Connection media type:
Video: MPEG4 Video (H264) 1280x720 23.81fps
AM_MEDIA_TYPE:
majortype: MEDIATYPE_Video {73646976-0000-0010-8000-00AA00389B71}
subtype: Unknown GUID Name {31435641-0000-0010-8000-00AA00389B71}
formattype: FORMAT_MPEG2_VIDEO {E06D80E3-DB46-11CF-B4D1-00805F6CBBEA}
bFixedSizeSamples: 1
bTemporalCompression: 0
lSampleSize: 1
cbFormat: 167
VIDEOINFOHEADER:
rcSource: (0,0)-(0,0)
rcTarget: (0,0)-(0,0)
dwBitRate: 0
dwBitErrorRate: 0
AvgTimePerFrame: 419999
VIDEOINFOHEADER2:
dwInterlaceFlags: 0x00000000
dwCopyProtectFlags: 0x00000000
dwPictAspectRatioX: 1280
dwPictAspectRatioY: 720
dwControlFlags: 0x00000000
dwReserved2: 0x00000000
MPEG2VIDEOINFO:
dwStartTimeCode: 0
cbSequenceHeader: 35
dwProfile: 0x00000064
dwLevel: 0x00000028
dwFlags: 0x00000004
BITMAPINFOHEADER:
biSize: 40
biWidth: 1280
biHeight: 720
biPlanes: 1
biBitCount: 24
biCompression: AVC1
biSizeImage: 0
biXPelsPerMeter: 0
biYPelsPerMeter: 0
biClrUsed: 0
biClrImportant: 0
pbFormat:
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0020: 00 00 00 00 00 00 00 00 9f 68 06 00 00 00 00 00 ........Ÿh......
0030: 00 00 00 00 00 00 00 00 00 05 00 00 d0 02 00 00 ............Ð...
0040: 00 00 00 00 00 00 00 00 28 00 00 00 00 05 00 00 ........(.......
0050: d0 02 00 00 01 00 18 00 41 56 43 31 00 00 00 00 Ð.......AVC1....
0060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0070: 00 00 00 00 23 00 00 00 64 00 00 00 28 00 00 00 ....#...d...(...
0080: 04 00 00 00|00 19 67 64 00 28 ac 34 e2 40 50 05 ......gd.(¬4â@P.
0090: bb 01 10 00 00 07 d0 00 01 76 a8 f1 83 18 98 00 ».....Ð..v¨ñƒ.˜.
00a0: 06 68 e8 8a cb 22 c0 .hèŠË"À
- Enumerated media type 0:
Set as the current media type
Actually I don't know how to show the info for where each portion starts and ends in the chain. All I know is that if I put CUVID above ffdshow in external filters it outputs 25FPS as 50FPS and if I put it below it outputs 25FPS correctly (As in ReClock see's it as 25FPS not 50).
nevcairiel
11th May 2011, 12:17
Like i said before, LAV CUVID does not care at all about any other components in the graph, or any other external factors. If it gets interlaced frames (or at least something marked as interlaced), it'll go and deinterlace them, doubling framerate in the process if enabled.
Whatever issues you're having, they are something specific to your setup, and not a problem in LAV CUVID.
PS:
The media type of that movie is extra weird. A frametime of 420000 is no standard frame rate in any universe - 25fps would be 400000, 24p either 416666 or 417083 (24fps and 23.976 fps)
jazzysmooth
14th May 2011, 07:50
It registers successfully, and I can use LAV Splitter and Audio decoder with no problem, but for the life of me I can't get LAV CUVID to be used.
Running NVidia 9300 onboard (Zotac motherboard) with 512 mb memory assigned in the bios and using the latest drivers (270.61). I've tried disabling all internal filters in MPC-HC (version 1.5.2.3104) and loading LAV CUVID in the external list and setting it to prefer, as well as blocking those decoders that get loaded in its place (MPC-Video Decoder, then Microsoft DTV-DVD Video Decoder). After those are both disabled, I typically get audio only when playing back files. Testing with MKV of Casino Royale (VC-1), and several others.
If I manually attempt to add LAV CUVID in GraphStudio, I'm unable to connect the pin.
Running Win7 32bit. Anybody have any suggestions?
e-t172
14th May 2011, 19:30
I installed LAV CUVID on an HTPC (GeForce 9400, HDMI, Windows 7), and it seems to exhibit strange behavior when it comes to video levels (16-235/0-255).
When displaying the Windows desktop, the NVidia card compresses 0-255 into 16-235 before sending it to the TV. That's exactly what I want it to do, since the HTPC is also used for non-video applications (e.g. viewing photos).
When playing videos using madVR, it still compresses the whole thing to 16-235 ; to compensate for that, I set madVR to expand video levels to 0-255. Up to this point, everything's normal and expected.
However, everything changes when I play 1080p videos using LAV CUVID. When I do this, the output is not compressed anymore. In other words, the card doesn't do anything to the signal anymore, and the original signal is sent directly to the HDTV. It does this only when the video is playing, and even in windowed mode (which makes it obvious when testing, the white level of a nearby Explorer window changes dramatically). If I stop the video, everything returns to the way they were.
It looks like the NVidia driver is trying to be "smart" and disables video levels conversion when playing CUVID-accelerated 1080p videos via HDMI. At first I was like, "Cool! This way I can simply set madVR to output untouched 16-235 and even preserve blacker-than-black/whiter-than-white information! Great!".
Well, not so great, because, as I just said, two conditions must be met for this to happen: LAV CUVID must be in used, and... the video has to be 1080p! The card will NOT do this when playing other resolution content (like 720p)...
This is a nightmare for me, because it means that either I configure madVR to leave the signal untouched and I have correct levels for 1080p only, or I configure madVR to expand and I have correct levels for everything except 1080p! Considering that this HTPC is used to watch 1080p and 720p content, this means that there is no good, definitive configuration possible...
So I stopped using LAV CUVID and reverted to ffdshow software decoding for the time being. What a waste. Is there any way I can stop the driver from "trying to be smart", or better yet, make it switch to "untouched output" for everything, not just 1080p?
(Remember that I still want correct levels for the Windows desktop and applications)
nevcairiel
14th May 2011, 19:35
Try turning off the DXVA Interop mode, otherwise - no idea. I use Full RGB on all my systems, and there is no option in the decoder API for this.
Can also try to play with the options in the NVIDIA Control panel for video level, if you dont have those set to RGB Limited already.
e-t172
14th May 2011, 20:15
Tried both, nothing changed :(
madshi
14th May 2011, 21:00
I don't really see how LAV CUVID can affect the output range. I mean, @nevcairiel, you're simply transporting the NV12 data back from the GPU to System RAM, without modifying anything, right?
@e-t172, are you using madVR's automatic display modes changer? Is it possible that when using LAV CUVID you're getting 1080p60 and thus madVR switches to 1080p60? And when using ffdshow, maybe you're using a different mode? Normally the standard NVidia TV modes all compress to 16-235, while all "custom resolutions" stay at 0-255. So my best guess is that when you get 0-255, you're running a custom resolution.
The best solution for NVidia users is IMHO to create custom resolutions for all output modes you need. This way you always get 0-255.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.