Log in

View Full Version : LAV CUVID Decoder - High Quality Hardware decoding for NVIDIA


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 [16] 17 18 19 20 21 22 23 24 25 26 27 28

madshi
3rd June 2011, 10:55
You're right. I'll try to compile it and do some basic tests to make sure it at least somewhat works so it can be used as a "demo" for my algorithm, but I don't promise anything. If I remember correctly, I got the algorithm working perfectly but the filter sometimes crashes in certain situations, or just randomly. However, if I'm not mistaken, it at least works for 5-10 minutes before the first crash, so it is still usable as a demo. I'll do my thing and get back to you.
Doesn't matter much if it crashes or even if it compiles. Neither nevcairiel nor I will just take your code and use it as it is. But looking at the underlying ideas and concepts might already be useful. More important than making it compile would be to add a bunch of comments explaining what the code does... :)

I can get you a bunch of samples with mixed content - I'll post some later today.
That'd be great.

Difficult to deinterlace samples are always very useful.

e-t172
3rd June 2011, 11:06
Doesn't matter much if it crashes or even if it compiles. Neither nevcairiel nor I will just take your code and use it as it is. But looking at the underlying ideas and concepts might already be useful. More important than making it compile would be to add a bunch of comments explaining what the code does... :)

There are some comments at strategic locations, but not much. The code is somewhat ugly (albeit arguably less ugly that the rest of ffdshow's code). Given that I wrote this code 2 years ago, it is unlikely I will be able to add more comments. That's why I'm trying to make it at least work, so that I'm not distributing broken code which would be even harder to understand (because it doesn't do what it's supposed to do).

roozhou
3rd June 2011, 11:42
Hi nevcairiel,
Why don't you start at pullup filter in mplayer?

LordMerlin
3rd June 2011, 11:56
Good day to all forum users.
Tell me please, video GT430 enough for proper operation of the decoder, or desirable At least 450?

nevcairiel
3rd June 2011, 12:44
Hi nevcairiel,
Why don't you start at pullup filter in mplayer?

I looked at several algorithms already, including the ones in the mplayer postprocessing library, thats not the problem.

ney2x
3rd June 2011, 12:51
Good day to all forum users.
Tell me please, video GT430 enough for proper operation of the decoder, or desirable At least 450?

GT430 is VP4 and Feature Set C according to wikipedia (http://en.wikipedia.org/wiki/Nvidia_PureVideo) . I think thats enough.

nevcairiel
3rd June 2011, 13:49
I would always go with a 440 or 450, because the 430 has a very limited memory bandwidth, and may run out of steam when doing some pixel shaders processing (like madVR does)

SamuriHL
3rd June 2011, 14:17
I love my 450. It makes my X2 4200+ actually usable with madVR. And is quite silent.

ney2x
3rd June 2011, 14:44
I hope madshi is here cause i did some comparison between LAV CUVID x86 vs LAV CUVID x64.

LAV CUVID 0.7 x86 - videos were "like" fast forwarding when seeking. (Is it normal?)

LAV CUVID 0.7 x64 - not so smooth and crisp because there is no madvr :/

nevcairiel
3rd June 2011, 14:48
The fast forward is kind of normal. After a seek,.there are a few frames that get delivered that are meant to init the decoder. I should probably throw those away instead of sending them to the renderer.

madshi
3rd June 2011, 16:21
madshi is here, but he won't do an x64 version anytime soon. End of story.

SamuriHL
3rd June 2011, 16:22
There's no way anyone could have possibly predicted that response, madshi. :D

ney2x
3rd June 2011, 16:43
madshi is here, but he won't do an x64 version anytime soon. End of story.

Oh well, I'm glad he said "soon". Better than never :cool:

Aegwyn11
3rd June 2011, 16:43
So I've got LAV CUVID and madVR working on my HTPC with a GT430 (Zotac one with the crazy fanless heatsink) and so far the experience is STELLAR. Even my wife noticed the difference in PQ.

So I decided to see if I might be able to get a similar setup working on my laptop. Its a Dell Studio 14z and the graphics are a 9400M G. According to nVidia's site, it lists it as HD capable for PureVideo, but it isn't listed on the Wiki site.

I'm using 64-bit Win7 on my laptop (my HTPC is 32-bit Win7). I used regsvr32 from the syswow64 directory to register LAV CUVID on my laptop.

Using 32-bit MPC-HC and either VC-1 or h.264 1080p 23.97 files, I get horrendous framerates (around 12-13) when using LAV CUVID. I'm using the compile from the first page of this post. If I use CoreAVC, it performs CUDA decoding and spits out a pristine 23.97 framerate. This is using the EVR Custom Pres. renderer.

Any ideas?

hmpt
3rd June 2011, 18:37
when playing MKv file,big size(>4G),Lav filter + coreavc coder+potplayer ,Fast Forward 4~5times in a short time,the picture will get stuck,only sound but picture still。

Aegwyn11
3rd June 2011, 20:18
Whoops, situation is a little different. I was using 0.6, didn't realize a new version had been posted. Installed 0.7 and the behavior changed.

Now using LAV CUVID as a decoder in MPC-HC (still 32-bit, running on 64-bit Windows), h.264 appears to decode just fine, but VC-1 is still decoding at the super slow rate of just over 12 fps.

Also, MPC-HC shows "Playing [DXVA]" for both VC-1 and h.264, but only shows "Playing" for Mpeg-2. Previously any time I used LAV CUVID, it would only show "Playing".

Any ideas?

nevcairiel
3rd June 2011, 20:38
I'm not 100% sure on the capabilities of the 9400M G. Maybe simply try installing GPU-Z and check the video decoder load/GPU load as well as the CPU load during playback? How does it look?
Also try unticking the "Use DXVA Interop" option.

Nevermind the display of DXVA in MPC-HC, its some kind of magic how it even detects that.

Aegwyn11
3rd June 2011, 21:59
With Mpeg-2, the GPU and video engine loads as reported by GPU-Z are very low (~10%ish). With VC-1 and h.264, the GPU load is in the mid-30's and the video engine load is in the 40's.

I already had the "Use DXVA Interop" unticked :(

I don't know that it matters a whole lot because when I enable MadVR, the GPU load shoots up into the 90's and it starts dropping frames like mad (maybe 5 a second?). Obviously this little GPU isn't powerful enough for MadVR at high resolutions :(

nevcairiel
3rd June 2011, 22:34
I dunno, those laptop IGPs are always a bit weird, especially the older models. Maybe it goes into a low power state and just doesn't have enough juice to decode. I cannot debug such problems without access to such a device.

e-t172
3rd June 2011, 22:35
I don't know that it matters a whole lot because when I enable MadVR, the GPU load shoots up into the 90's and it starts dropping frames like mad (maybe 5 a second?). Obviously this little GPU isn't powerful enough for MadVR at high resolutions :(


Have you tried downgrading madVR's scaling/quality options? This could make it usable on your GPU, as madVR's defaults are quite hungry.

GTPVHD
3rd June 2011, 23:15
9400M G is the same as ION chipset, 16SP VP3 GPU.

robpdotcom
4th June 2011, 01:38
Do you have any preference on how samples should be uploaded?

I have 5 samples of telecined material, totaling about 450MB. Basically, I looked for segments where the MPC-HC showed the frame rate changing while DScaler5 was being used. The samples are:

1) A local station flashed a banner across the screen during the program. (42MB)

2) A commercial break, where content switches from video to film several times - this is the longest sample, at just over 3 minutes. (285MB)

3) An emergency alert scrolls across the screen, accompanied by a resolution change - the frame rate never seemed to actually change, but I thought it might be interesting for testing. (51MB)

4) A commercial break with film and video, followed by the actual program.(53MB)

5) A clip of a program which actually has IVTC flags (none of the others have flags). I thought this one was interesting because Windows DTV-DVD decoder even seems to IVTC it, but not if using DXVA. (55MB)

I can place all the samples into a zip folder and upload it, or I can upload only the ones you are interested in.

Aegwyn11
4th June 2011, 03:13
Have you tried downgrading madVR's scaling/quality options? This could make it usable on your GPU, as madVR's defaults are quite hungry.

Yeah, thats how I got it down to ~5 fps dropped. With default settings it seems to be dropping more like half the frames. Oh well..


All this talk, along with a comment a page or two back (suggesting a 440 or 450 instead of the 430 due to memory bandwidth concerns) got me to thinking. I'm still inside 30 days on my 430 and could return it if necessary. With GPU-Z logging, I started playing a clip of the documentary Life (VC-1, 1080i) to see how much usage I'd get. I figured this would be a decent example of worst case as its 1080 AND requires deinterlacing. While playing this clip, here's what I got:

GPU Load - 50-66 (one outlier at 75)
Memory Controller Load - 22-26
Video Engine Load - 43-50

This was using MadVR at all default settings. Also, the "double framerate" option in LAV CUVID was unticked...got some weird artifacts with that (with that option ticked, the GPU Load and Memory Controller Load were about 10 higher, Video Engine Load was same).

What do you guys think? Is this card adequate, or should I swap it for something more powerful?

ney2x
4th June 2011, 03:16
when playing MKv file,big size(>4G),Lav filter + coreavc coder+potplayer ,Fast Forward 4~5times in a short time,the picture will get stuck,only sound but picture still。

That's a known problem of the "self-proclaimed" fastest decoder and updates 1/365, CoreAVC :D

CruNcher
4th June 2011, 08:35
I dunno, those laptop IGPs are always a bit weird, especially the older models. Maybe it goes into a low power state and just doesn't have enough juice to decode. I cannot debug such problems without access to such a device.

Actually in theory they should be even faster as they are most of the time directly connected to speedup memory transfers though for non VPx heavy based Shader operations 16SP so 2 SM are a little to low :). Also these days many user run a lot of stuff in the background and frame drops on Windows can't be avoided if something pools every x second somewhere the hardware for example or uses harsh timers under 500ms.

e-t172
4th June 2011, 19:03
Okay, as promised, here is my IVTC patch for ffdshow. I didn't manage to make it work with the old ffdshow revision (which is nearly impossible to compile correctly with MSVC++ 2010), so I figured it was easier to just port it to the latest ffdshow revision (r3867).

Patch against ffdshow-tryout r3867 adding an inverse telecine (pulldown removal) filter to the ffdshow video filter chain
Author: Etienne Dechamps (e-t172) <e-t172@akegroup.org>

Usage: apply this patch, build with MSVC++ 2010, and use the new "Pulldown removal" filter in the ffdshow video filter list.
There is also a new OSD option to monitor the state of the filter during playback.
IMPORTANT: you should disable the option "Detect soft telecine and average frame durations" in the ffdshow decoder options. This option seems to interact badly with the new filter.

DISCLAIMER: this code is provided "as-is" and is probably full of bugs. It is a merely a proof-of-concept, and is not suitable for everyday use.

I don't have the time nor the motivation to maintain or improve this patch, so don't waste your time reporting bugs or asking for new features.

Download: http://www.e-t172.net/files/ffdshow-r3867-pulldown-et172.7z
The archive contains the patch and a 32-bit ffdshow.ax binary compiled in release mode (ffdshow-tryout r3867 + patch, MSVC++ 2010), in case anyone wants to give it a try. I did a few basic tests and it didn't crash after all, however the filter still has some bugs which results in bad decisions (mistakes) in some corner case situations.

The code is licensed under the WTFPL (http://en.wikipedia.org/wiki/WTFPL).

madshi
4th June 2011, 19:06
Thanks, e-t172, appreciated. Cool license... :D

edison
4th June 2011, 19:25
version 0.8?
http://1f0.de/lav-cuvid/guide/
Starting with version 0.8, LAV CUVID comes with an Installer

Dogway
4th June 2011, 19:31
@Aegwyn11: You might have the same problem as me, check my old post (http://forum.doom9.org/showthread.php?p=1493030#post1493030). Although my posts were very well ignored until I insisted up to becoming near annoying.
I own a 9600m gt in a laptop too, maybe its not the same problem, maybe yes...

nevcairiel
4th June 2011, 19:42
version 0.8?
http://1f0.de/lav-cuvid/guide/

I just have to remember to put the installer in 0.8, and that line isn't wrong. Its just not released yet. :p


Okay, as promised, here is my IVTC patch for ffdshow. I didn't manage to make it work with the old ffdshow revision (which is nearly impossible to compile correctly with MSVC++ 2010), so I figured it was easier to just port it to the latest ffdshow revision (r3867).

Thanks! I'll look over it tomorrow and see what can be used.

Selur
4th June 2011, 20:31
@edison: thanks for compiling a 64bit version! :)

nevcairiel
4th June 2011, 21:01
@edison: thanks for compiling a 64bit version! :)

There is an official 64-bit version now, what are you thanking him for. :p

Selur
5th June 2011, 10:51
didn't see the official one,.. stopped looking for it after reading your first replies regarding 64bit ;)
(so thanks to you for adding a 64bit build :D)

nevcairiel
5th June 2011, 15:08
LAV CUVID Decoder 0.8

0.8 - 2011/06/05
- LAV CUVID now comes with an Installer
- Support for using NVIDIA GPUs which have no connected display
- Limit MPEG-4 ASP decoding to VP4 (and newer) GPUs
- Options to force a specific output pixel format
- Renamed and refactored some options

Download: Installer (32/64-bit, CUDA 4.0+) (http://files.1f0.de/cuvid/LAVCUVID-0.8.exe) - 32-bit (CUDA 4.0+) (http://files.1f0.de/cuvid/LAVCUVID-0.8.zip) - 64-bit (CUDA 4.0+) (http://files.1f0.de/cuvid/LAVCUVID-0.8-x64.zip) -- 32-bit (Older CUDA) (http://files.1f0.de/cuvid/LAVCUVID-0.8-LegacyCUDA.zip)

This build mainly improves the user-experience. An installer, some reworded options, and LAV CUVID will now detect if your GPU is capable to decode MPEG-4 ASP, so you don't get black screens anymore.

In addition to this, LAV CUVID now really supports GPUs that have no display attached, however this has one disadvantage. GPUs without a display do not have a D3D Adapter, so i cannot create the Direct3D Interface for CUVID. This means, the HQ DXVA processing (previously DXVA Interop) option will have no effect.

In related news, i put up some content pages on my website about LAV CUVID and my other filters, its still a work in progress, but better then only having this thread here. You can find those at http://1f0.de/lav-cuvid/

SamuriHL
5th June 2011, 15:11
Thanks, Nev! I appreciate the installer for sure. :)

ney2x
5th June 2011, 16:24
Thanks! You're unstoppable! What more can I ask for? ... a tray icon :D

ranpha
5th June 2011, 17:26
....or maybe, finally, finish off Haali Media Splitter with video editions + ordered chapters + external segment linking in .mkv files? <--- the only reason why I still put up with the idiosyncrasies of Haali Media Splitter.

edit: Whoops, sorry, I think I am on LAV FIlters thread.

oddball
5th June 2011, 21:43
When playing the Big Buck Bunny clip 1 at http://www.w6rz.net/ I get garbled output from both MPC-HC's internal MPEG2 decoder, LAV CUVID and PowerDVD. The only decoder that decodes it non-garbled is ffdhow's LibMPEG2 decoder. It matters not which renderer or splitter combination I use.

Can you look into this?

nevcairiel
5th June 2011, 21:46
Thats a 4:2:2 encode, LAV CUVID for example doesn't even support this. Might be the same issue for the other decoders if they try to use DXVA.
Its just missing some code to refuse the file in this case, but i don't know much about the mpeg2 headers.

oddball
5th June 2011, 21:51
Seems to work with ffdshow and any of the splitters just as long as ffdshow is the decoder (Libavcodec or LibMPEG2 it matters not). But CUVID is a no show. Likewise MPC-HC's and PowerDVD's decoders cannot handle it.

nevcairiel
5th June 2011, 21:52
Like i said, the hardware only supports 4:2:0 content, 4:2:2 is not supported. So any decoder using CUVID or DXVA will fail.

oddball
5th June 2011, 21:58
Any chance 4:2:2 will be supported in future builds?

nevcairiel
5th June 2011, 22:00
Didn't I just say that the hardware doesn't support it? :)

Underground78
5th June 2011, 22:33
Thats a 4:2:2 encode, LAV CUVID for example doesn't even support this. Might be the same issue for the other decoders if they try to use DXVA.

There is a check for that in MPC-HC internal decoder since rev 3123 (https://sourceforge.net/apps/trac/mpc-hc/changeset/3123/trunk).

oddball
5th June 2011, 23:44
There is a check for that in MPC-HC internal decoder since rev 3123 (https://sourceforge.net/apps/trac/mpc-hc/changeset/3123/trunk).

Using 3180 Madshi's build. It no worky. I mean software decoding not DXVA is messed up in all except ffdshow. But I have posted this in the MPC-HC thread now so no need to carry on in this thread. Thx.

oddball
6th June 2011, 00:34
Found another clip LAV CUVID will not decode correctly. Again ffdshow does.

http://trailers.apple.com/movies/independent/therift/therift-tlr1_h1080p.mov

Cyber-Mav
6th June 2011, 00:51
Thanks! You're unstoppable! What more can I ask for? ... a tray icon :D

a tray icon would be icing on the cake.

nevcairiel
6th June 2011, 06:49
What do people want a tray icon for?
I can understand people requesting icons for LAV Splitter, because you could then use it to switch streams and chapters on players that don't support it.
But LAV CUVID? It doesn't have any functionality that you need to access during playback! Just activate it, sit back, and enjoy! :)

I doubt there will *ever* be a tray-icon for LAV CUVID.

nevcairiel
6th June 2011, 06:53
Found another clip LAV CUVID will not decode correctly. Again ffdshow does.

http://trailers.apple.com/movies/independent/therift/therift-tlr1_h1080p.mov

Did you at least check the clip if its not 4:2:2 again, and wasting my time?
Btw, deep links on that trailers page don't work anyway.

madshi
6th June 2011, 07:05
I guess people ask for a tray icon for 2 reasons:

(1) So they can change the LAV CUVID settings through the tray icon instead of having to right click the video -> filters -> properties. Doing it through the tray icon is noticeably better if you have a 2 monitor setup, with the video running on secondary monitor. The tray icon will then be on the primary monitor, allowing you to change settings without interrupting fullscreen video playback on the secondary monitor.

(2) Seeing that tray icon in the tray bar is a very quick way to tell which filters are being used. If you don't see that tray icon you know that a "wrong" filter was selected by MPC-HC. I find this useful e.g. for the Haali Splitter. Whenever I see the Haali icon in the tray bar, I know that the Haali Splitter is being used. That's just "nice" as a quick way to see which splitter is currently being used.