View Full Version : LAV CUVID Decoder - High Quality Hardware decoding for NVIDIA
nevcairiel
3rd April 2011, 21:03
I can play 60fps content just fine on madVR.
CruNcher
3rd April 2011, 21:10
Hmm strange i tried that 4 girls stream it tasks VP2 a lot here http://forum.doom9.org/showthread.php?p=1477571#post1477571 impossible to get 60 fps with that on VMR even Cyberlink DXVA only goes up to 53 fps
Hmm but with Madvr and Haali in combination with LAV CUVID (no connection to Haali actually falls back to Video Renderer), CoreAVC CUDA or CUDA Video Decoder its really problematic almost every frame drops away you don't even need a OSD to see that over here ;)
Arggggghhhh
http://img715.imageshack.us/img715/9756/heavyjitterhaalicoreavc.png
do you see what i see ??? that could explain it
lets see what i send madshi over with madnv12test ;)
D3D9 Surface speed test:
NV12: upload 440 fps, download 554 fps, trick download failed
YV12: upload 76 fps, download 17 fps, trick download failed
A8R8G8B8: upload 431 fps, download 262 fps, trick download failed
Forcing CoreAVC Nvcuvid to NV12 only on Madvr is indeed much faster though still more of a Slideshow compared to DXVA :(
GTPVHD
6th April 2011, 10:41
VP2 and VP3 doesn't have enough performance to decode 60FPS videos, only VP4 can do it. Upgrade to a VP4 enabled Nvidia GPU.
http://www.nvnews.net/vbulletin/showpost.php?p=2352086&postcount=325(VP4)
http://www.nvnews.net/vbulletin/showpost.php?p=2375607&postcount=339(VP4)
H264 DECODING (1920x1080): 66 frames/s
http://www.nvnews.net/vbulletin/showpost.php?p=2392864&postcount=364(VP3)
H264 DECODING (1920x1080): 52 frames/s
http://www.nvnews.net/vbulletin/showpost.php?p=2289028&postcount=306(VP2)
H264 DECODING (1920x1080): 44 frames/s
sneaker_ger
6th April 2011, 13:16
VP2 and VP3 doesn't have enough performance to decode 60FPS videos, only VP4 can do it. Upgrade to a VP4 enabled Nvidia GPU.
How bitrate dependent is this? I got some 70 fps on 1080p with a VP3 on a quick graphstudio benchmark.
mark0077
6th April 2011, 19:14
Hi nevcairiel, your tweak of disabling vc-1 frame time correction in the lav splitter fixed my random frame drops here and there.
Now comparing your decoder to ffmpeg-mt, unfortunately I still get more dropped frames and I have an idea where incase its any help.
When I was tweaking my avisynth mvtools scripts recently, and when i didn't know about ffmpeg-mt, I would find that certain scenes in 1080p movies brought up my cpu usage just that little bit, I assume due to more detailed scenes / higher bitrate. Whatever the reason, I would get 1,2, maybe a bunch of even 10 frame drops all at once in these busy scenes. I noticed that cpu and gpu usage was still very very low (core i7 920 @ 3.7ghz, gtx 295). So I found that the simple switch to the multithreaded decoder spread the load that little bit so that the increases in cpu / gpu usage during those busy scenes wasn't enough to overload one core of my cpus.
Now I see the very same behaviour with your decoder. I get frame drops in these busy scenes again, that I don't with ffmpeg-mt. I'm basically asking is there anything in your decoders code that puts any sort of load on the cpu that could also be made to be multithreaded. I have a strong feeling that if this was possible, that I could also see 0 frame drops with your decoder like I do with ffmpeg-mt as none of my cpu cores would reach a point where I would get dropped frames. Feel free to ask any questions about my setup if you're interested in pursuing any possible enhancements. :)
I'm outputting from lav splitter -> lav cuvid decoder -> nv12 -> ffdshow + avisynth -> nv12 -> madVR -> GTX295
nevcairiel
6th April 2011, 19:23
The decoding is all done in hardware, i cannot really change how that works. However, there are some ways to improve the pipelining, like right now i only have one output buffer, which once its filled with a picture, gets send to the renderer. What i will do is allow more output buffers (which will increase memory usage on the GPU, though), and then queue them up for sending to the renderer - this might help in "busy" situations.
mark0077
6th April 2011, 19:25
Thanks navcairiel, I'll test out any changes that you might be able to make and report back whenever any new builds are available :) Keep up the good work.
CruNcher
6th April 2011, 20:10
VP2 and VP3 doesn't have enough performance to decode 60FPS videos, only VP4 can do it. Upgrade to a VP4 enabled Nvidia GPU.
http://www.nvnews.net/vbulletin/showpost.php?p=2352086&postcount=325(VP4)
http://www.nvnews.net/vbulletin/showpost.php?p=2375607&postcount=339(VP4)
http://www.nvnews.net/vbulletin/showpost.php?p=2392864&postcount=364(VP3)
http://www.nvnews.net/vbulletin/showpost.php?p=2289028&postcount=306(VP2)
What was the sample i get 52 fps (VP2) on a 60 fps sample which tasks according to GPU-Z the Video Engine @ 95% it's not that easy to confirm if all test different sample complexities ;)
Virtual_ManPL
7th April 2011, 17:37
FYI - CUDA Toolkit 4.0 RC2 (32bit & 64bit) (http://developer.nvidia.com/cuda-toolkit-40)
Waiting for 64bit release of LAV CUVID Decoder :devil:
tiny
8th April 2011, 18:26
Possible bug?
The framerate of pure interlaced sources is not doubled in the output with force bob enabled. It happens with all renderers.
Tested using MPC-HC 1.5.2.3018 on WinXP SP3. CPU: C2D @ 2.13GHz, GPU: GTS450.
Tom Keller
9th April 2011, 00:17
Using MPC-HC 1.5.2.3018 with a couple of 1080p H.264 clips @23.976fps (on WinXP SP3; C2D E6600 @2,4Ghz; 9600GT with driver version 267.24) i always experience some very high cpu consumption here (around 50-55%) with almost every video renderer... except madVR :confused: . I counter checked with GraphStudio - same there.
So using VMR9 or EVR with the LAV CUVID Decoder simply gives me a higher cpu load, than pure software decoding :eek: ... and therefore occasional stuttering. The only exception is madVR as video renderer - this lowers my cpu consumption to a total of 13-17% playing the same files.
Any suggestions on what may be the reason of this behavior?
roozhou
9th April 2011, 16:40
Using MPC-HC 1.5.2.3018 with a couple of 1080p H.264 clips @23.976fps (on WinXP SP3; C2D E6600 @2,4Ghz; 9600GT with driver version 267.24) i always experience some very high cpu consumption here (around 50-55%) with almost every video renderer... except madVR :confused: . I counter checked with GraphStudio - same there.
So using VMR9 or EVR with the LAV CUVID Decoder simply gives me a higher cpu load, than pure software decoding :eek: ... and therefore occasional stuttering. The only exception is madVR as video renderer - this lowers my cpu consumption to a total of 13-17% playing the same files.
Any suggestions on what may be the reason of this behavior?
Did you tried overlay mixer? This has the least cpu and GPU comsumption under WinXP.
Tom Keller
9th April 2011, 17:56
I did. Always the same: 50-55% cpu load, occasional stuttering and a bit of a laggy mouse cursor while playing. But no problem using madVR.
EDIT: I assume the problem is in some kind related to the NV12 colorspace, since CoreAVC behaves the same, when setting NV12 as only output format :eek: . CoreAVC doing fine though, using its internal colorspace conversion.
So when using LAV CUVID Decoder plus ffdshow for colorspace conversion there are no problems (with around 20-30% cpu load).
I guess i'll have to wait, till the LAV CUVID Decoder supports colorspace conversion itself and therefore different output formats. Or (maybe) a different graphics driver helps(?)...
EDIT 2: Tried GeForce driver versions 267.91 & 270.51 - no change at all :( .
Carpo
9th April 2011, 18:42
only thing stoping me from using this decoder is the fact that it using it and madvr means i dont get any subtitles, other than that, they are a winning team
sneaker_ger
9th April 2011, 18:45
only thing stoping me from using this decoder is the fact that it using it and madvr means i dont get any subtitles, other than that, they are a winning team
This is not the fault of LAV CUVID but most likely a misconfiguration on your side.
SamuriHL
9th April 2011, 18:51
Yea, I use it with madVR and the latest MPC-HC and I get subs. They work great for me.
Carpo
9th April 2011, 18:58
Yes, some how auto load subtitles was unticked, which is strange because i cant remember unticking it, and shouldn't be unticked on a fresh install of MPC-HC :/
pankov
10th April 2011, 14:06
nev,
I've just changed my video card from ATI 5750 to NVidia GTX 460 SE so I can use your decoder, cause I need hardware deinterlacing and often subtitles at the same time which is not possible with any other decoder out there but I'm sad to report that it's not working as I expected.
If you try the following sample
http://www.mediafire.com/?em2ouktaqfvd36f
(the same BBC-HD sample from the World Cup - Argentina vs. Nigeria that crashes VSFilter)
with MS DTV-DVD Video decoder and EVR you'll see perfect fluid motion.
With LAV CUVID decoder it's somewhat strange - if I pause the video I get the same picture, so it's not Bob-ed but it's not Vector Adaptive that I get with MS' decoder. .... or it could be that the frames are not sent to the deinterlacer in the correct order. I'm just guessing here but I hope you have some control over this and you can fix it.
Just to say that the problem is not only with this sample but with others that don't have subtitles or simply use a splitter (like Haali's) that doesn't expose the embedded DVB subtitles.
nevcairiel
10th April 2011, 14:19
Well one difference is that when decoding it normally and letting EVR do the deinterlacing, you will actually get 50fps to the renderer, while when the decoder does it, it gets reduced to 25fps (no frame doubling). I don't know if/how i can influence that behaviour though..
pankov
10th April 2011, 15:03
I see now that you are absolutely right but I hope you'll be able to find a solution to output all 50/60 deinterlaced frames.
Till then can you, please, add an option to output the interlaced frames/fields and set the appropriate interlaced flag so we can use the hardware deinterlacer in the renderer?
madshi
10th April 2011, 15:27
Well one difference is that when decoding it normally and letting EVR do the deinterlacing, you will actually get 50fps to the renderer, while when the decoder does it, it gets reduced to 25fps (no frame doubling). I don't know if/how i can influence that behaviour though..
Interesting. So what does that mean for IVTC? I guess LAV CUVID outputs 30p for NTSC/ATSC interlaced movie content?
pankov
10th April 2011, 21:16
Nev,
I think I've found a problem when using LAV CUVID and subtitles. To be precise LAV CUVID + DirectVobSub.
From my tests I noticed that these two don't work at all and sadly that's the only way to show subtitles in ZoomPlayer.
I think I've also found the reason but I'll be happy if you confirm and probably fix it in the future. From your posts I understand that currently LAV CUVID supports NV12 output while DirectVobSub doesn't support it at all. :( It still supports YV12 and from madshi's posts in the madVR thread I understood that these two formats are almost the same - there is a quick and lossless transformation between them.
So my question is "do you plan to add YV12 support to your decoder?" ... or NV12 support to VobSub if it's easier ... or I better ask the MPC developers for the last one?
nevcairiel
10th April 2011, 21:17
The hardware decoder always outputs NV12, and i currently have no plans to write code to convert it into anything else, sorry.
italospain
10th April 2011, 21:27
nev,
I've just changed my video card from ATI 5750 to NVidia GTX 460 SE so I can use your decoder, cause I need hardware deinterlacing and often subtitles at the same time which is not possible with any other decoder out there but I'm sad to report that it's not working as I expected.
If you try the following sample
http://www.mediafire.com/?em2ouktaqfvd36f
(the same BBC-HD sample from the World Cup - Argentina vs. Nigeria that crashes VSFilter)
with MS DTV-DVD Video decoder and EVR you'll see perfect fluid motion.
With LAV CUVID decoder it's somewhat strange - if I pause the video I get the same picture, so it's not Bob-ed but it's not Vector Adaptive that I get with MS' decoder. .... or it could be that the frames are not sent to the deinterlacer in the correct order. I'm just guessing here but I hope you have some control over this and you can fix it.
Just to say that the problem is not only with this sample but with others that don't have subtitles or simply use a splitter (like Haali's) that doesn't expose the embedded DVB subtitles.
There is no problem to get Subtitles with Hardware Deinterlacing with Zoom Player at least with ATI Cards.
I use ffdshow raw filter after CoreAVC (output set to Y12) to aktivate NV12 BOB and subtitles. It fixes CoreAVC wrong field order too.
I do the same with DScaler IVTC Mod for mpeg2 (doesnt support NV12) but this way i get hardware deinterlacing and subtitles.
pankov
10th April 2011, 21:29
:(
I guess I should read better next time before deciding on changing hardware just on hunches that it will solve all my problems.
At the moment both my dreams (VA deinterlacing with madVR and VA deinterlacing + subtitles) are unfulfilled :(
but nevertheless thanks for all your hard work
pankov
10th April 2011, 21:36
italospain,
are you saying that you get the great quality of the Vector Adaptive deinterlacing that we get with the MS decoder?
I simply can't imagine how it's possible for ffdshow to add subtitles to an interlaced video stream and still keep it unmolested and send it to the renderer. btw which renderer are you using?
can you, please, post (or if it's better to send them as PM - to not pollute this thread) some screenshots of your ffdshow settings?
italospain
10th April 2011, 21:57
italospain,
are you saying that you get the great quality of the Vector Adaptive deinterlacing that we get with the MS decoder?
I simply can't imagine how it's possible for ffdshow to add subtitles to an interlaced video stream and still keep it unmolested and send it to the renderer. btw which renderer are you using?
can you, please, post (or if it's better to send them as PM - to not pollute this thread) some screenshots of your ffdshow settings?
yeah i get vector adaptive deinterlacing.
there are no special ffdshow settings only nv12 and bob and subtitles
I have made a ffdshow Profile for interlaced material (*.mkv-i in ffdshow Profiles) together with Smart play Profile of Zoom player (use EVR & ffdshow raw filter(NV12 BOB Subtitles) only for interlaced material otherwise madVR(YV12 Weave DirectVobSub))
if you dont want CoreAVC you can use ffdshow decoder the subtitles works fine with hardware deinterlacing.
oh and there is a bug in Zoom Player Version 6 the subtitles must be external to be shown by ffdshow (you can do it with MKVtoolnix)
sorry for the wrong thread
italospain
11th April 2011, 10:28
Interesting. So what does that mean for IVTC? I guess LAV CUVID outputs 30p for NTSC/ATSC interlaced movie content?
for ATI Cards you can activate Hardware IVTC like Hardware Deinterlacing (NV12 & BOB & EVR)
pankov
11th April 2011, 11:54
yes,
but the question madshi aks is will the decoer (LAV CUVID) know that the framerate is change from 30 fps (29.940) to 24fps (23.976) and be able to tell it to renderer (madVR)
roozhou
11th April 2011, 14:31
Compared to deinterlace, IVTC is quite easier. IMO it is not very difficult to add an adaptive IVTC option to the renderer.
nevcairiel
11th April 2011, 14:38
From what i can tell, it does actually do IVTC (as in combining the fields properly), but it doesn't remove the extra frames. There are some flags that are set on the decoded frames that would indicate this, i have however no actual evidence that they are always set properly. If it sets them, i could easily just adapt the frame timings to account for the 29.97 -> 23.976 change.
Currently, my time is however focused on other projects. This was really more of a toy project, to see if it can be done, and turns out, it was super easy, and was working beautifully - so i decided to share it. :)
SamuriHL
11th April 2011, 14:56
Currently, my time is however focused on other projects. This was really more of a toy project, to see if it can be done, and turns out, it was super easy, and was working beautifully - so i decided to share it. :)
And I don't think anyone is more happy about that than I am. :) It really makes my bedroom HTPC 100x more useful to me. VERY appreciated. :)
CruNcher
11th April 2011, 15:22
Nev will a future LAV CUVID version support chain fallback if 4:2:2 H.264 or 10-bit Bitstreams are detected both aren't supported by Nvcuvid ? if the Decoder cant detect it you could try it with the Splitter and then let the Decoder fallback to the Dshow Graph using the next Decoder Filter (just leave the decision to the automatic Graph connection) this would be really awesome and fix major Playback problems being able to fallback to Mainconcepts Decoder :) Same for Mpeg-2 Studio Bitstreams trying to forcefully playback them is wrong :(
I really doubt VP4 now supports any of these Bitstreams
nevcairiel
11th April 2011, 15:33
If the source/splitter sets the profile properly on the media type, it would be possible to check that. Anything above High is not supported (High 10, High 4:2:2, High 4:4:4). I know that at least my splitter can detect the proper profile, although i don't have any 10bit or H264 4:2:2 sources.
As an alternative, i could check the SPS/PPS in the extradata, if the splitter supplys that. (Most do, but its not required if streaming MPEG-TS H264 in AnnexB format)
Some samples to confirm would be nice, especially 10bit.
CruNcher
11th April 2011, 16:40
http://www.mediafire.com/download.php?q468dp9he6mj3bz <- AVC High 4:2:2 Level 4.0
http://samples.mplayerhq.hu/MPEG2/mpeg422/422_sample_from_DVB.mpeg <- Mpeg-2 4:2:2 aka Mpeg-2 Studio Profile
http://www.mediafire.com/download.php?ukdh5txb1czq0hi <- High 10 ?
x264 lossless = High 4:4:4 (huuge please create one ;) )
roozhou
11th April 2011, 16:53
@nevcairiel
When will you make the source code of LAV CUVID public?
CruNcher
11th April 2011, 17:12
Hehe roozhou would be a nice thing to have in x264dshow, though if you force it it should work already like CoreAVC CUDA does though the fallback for unsupported streams would also fix x264dshow CoreAVC CUDA issues and give it support that a lot of encoder frameworks lack currently combined with Mainconcepts Decoders ;)
Though i see a problem with x264 lossless as also Mainconcept will try to playback that and it should better fall back to either CoreAVC,DiAVC or ffmpeg, though with some merit fiddling this shouldn't be a big issue.
nevcairiel
12th April 2011, 06:47
Hey, so regarding IVTC, i had a 60i VC-1 stream from a HD-DVD, which is supposed to be played back as 24p - and surprise, the CUVID decoder does actually produce and output a proper and fluid 24p stream.
FWIW, So did other commercial decoders like Cyberlink and ArcSoft - ffdshow plays it as 29,97fps however (moving too fast and getting out of sync very badly!)
I guess it will do its job IVTC'ing as long as the pulldown flags in the bitstream are properly set.
I dunno if this is a special case for HD-DVD content - as evidenced by ffdshow it cannot be played back at 30fps at all, because the frames are apparently not there, so it doesn't have to decimate them, but i was still kinda happy that it just worked. :)
madshi
12th April 2011, 07:33
Hey, so regarding IVTC, i had a 60i VC-1 stream from a HD-DVD, which is supposed to be played back as 24p - and surprise, the CUVID decoder does actually produce and output a proper and fluid 24p stream.
FWIW, So did other commercial decoders like Cyberlink and ArcSoft
That's not too big a surprise. Almost all PC VC-1 decoders have always treated HD DVD 60i movie files as being 24p, because the files clearly say so. Practically the files are 24p with added 60i flags. The decoders are simply ignoring the 60i flags. The real problem are files where the 3:2 pulldown is hard coded. Meaning, the file actually contains 60 interlaced fields. There it's dramatically more difficult for decoders to actually output perfect 24p.
roozhou
12th April 2011, 10:47
Madshi is right. When referring to IVTC, we always talk about hard-telecined videos.
SamuriHL
12th April 2011, 13:39
And it gets even more complicated when those streams are added to an MKV container, but, let's not go there right now.
spartan711
13th April 2011, 20:01
so just to clarify, using nev's video decoder, with madshi's madvr, will allow for hardware de-interlacing with subs? And essentially the best PQ from hardware?
pankov
13th April 2011, 23:39
sadly, no
For the moment (and it's not even certain that this is fixable) LAV CUVID decoder will not output the doubled framerate which results in jerky playback.
You get nice deinterlaced picture but with judder which is not acceptable for sports ... or anything else if you are serious about your quality experience.
spartan711
13th April 2011, 23:50
hm...I'm having trouble getting subtitles to show using mpc-hc+CUVID+MadVR+Arcsoft Audio HD decoder. Any tips?
pankov
13th April 2011, 23:57
You have to use one of the latest versions (not older than two weeks or so) of mpc-hc to have subtitles with madVR.
Actually I don't use MPC-HC but I'm just following it's and madVR's threads so may be somebody else can be more helpful
sneaker_ger
14th April 2011, 00:28
You have to use one of the latest versions (not older than two weeks or so) of mpc-hc to have subtitles with madVR.
Actually I don't use MPC-HC but I'm just following it's and madVR's threads so may be somebody else can be more helpful
Yes, you need a recent revision from here (http://xhmikosr.1f0.de/) and activate "Auto-load subtitles" under "Playback" in MPC-HC's options.
spartan711
14th April 2011, 00:33
and it workingggg. Wohoo! That was so painless! I have HD audio decoding, and amazing PQ! All within half an hour. This is such a great solution, thank you nevcairiel.
SamuriHL
14th April 2011, 00:39
It really is am amazing solution. Once the title selection is available from within MPC-HC, quite frankly, commercial players are replaced as far as I'm concerned. :)
spartan711
14th April 2011, 01:23
hmm... I am having some trouble switching subtitles, or changing anything once they are loaded. To reiterate, I can turn them off by not loading them from the mpc-options. However, if that option is on, then I cannot change anything involving subs from the madVR tray icon. Anyone have any solutions? Sorry, I know this is not the right thread for this, so after this, I'll be posting in the madVR thread.
I have had no problems with the decoder! Windowed mode is not smooth, but I don't watch it in windowed, so that's ok for me.
sneaker_ger
14th April 2011, 01:31
It depends on the splitter where you can switch the tracks. For Haali and LAV you can use "filters" or the madVR icon, for MPC-HC's internal filter you use the "subtitle" menu.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.