21

I have an application that does video processing such as color transforms, scaling and translations using OpenGL. I'm mostly working with BGRA (1xGL_BGRA) or YUVA (4xGL_R) video, i.e. including alpha.

Now I would also like to do some high quality deinterlacing. I've noticed that Nvidia supports high quality hardware accelerated de-interlacing through their "PureVideo" functionality. Basically what i'd like to do is to send in a interlaced OpenGL texture with x number of color channels and get out two progressive textures.

My question is how do I access this functionality easiest, and most efficiently (possibly in interop with OpenGL)?

I've been looking at DXVA and OpenMax, but both seem rather focused on playback (not deinterlace processing, i.e. non-relevant options such as frame-rate needs to be set etc...) and no-alpha formats...

ronag
  • 49,529
  • 25
  • 126
  • 221
  • 1
    What defines 'high quality' deinterlacing? If you just want to take an image and split it into two via alternating pixel rows you can do that pretty easily in a shader, but I'm not a video expert and I'm not sure if that's what you mean. – Tim Mar 15 '12 at 21:18
  • 1
    I mean something along the lines of spatial-temporal deinterlacing. What you are suggesting is horrible quality. – ronag Mar 15 '12 at 21:23
  • 1
    You can look here http://guru.multimedia.cx/deinterlacing-filters/ to see the difference, between "high" and "low" quality deinterlacing. – ronag Mar 15 '12 at 21:50
  • Just out of interest, things like deinterlace and so on are trivial with gStreamer. Perhaps you should think about 3rd party libraries for this kind of stuff than doing it yourself? – Robinson Mar 20 '12 at 17:06
  • I alrdy use ffmpeg for de-interlacing, but it's not gpu accelerated. – ronag Mar 20 '12 at 17:12
  • for highest-quality deinterlacing, frame-rate is actually essential – std''OrgnlDave Mar 22 '12 at 20:19
  • @OrgnlDave: What are you talking about? – ronag Mar 23 '12 at 21:40

3 Answers3

5

gStreamer libraries have good de-interlacing modules. You can use a directshow module to display the results in a window, or process the frames yourself by hooking into various events. We're using this at work at the moment for all of our video processing needs.

Robinson
  • 9,666
  • 16
  • 71
  • 115
  • 2
    Doesn't seem to be gpu-accelerated. – ronag Mar 20 '12 at 17:11
  • 1
    With gStreamer it depends on the module you link into the pipeline. There's a 'gldeinterlace' module that is GPU accelerated, for example. In fact there are about 10 GL modules of various kinds that you can link. – Robinson Mar 20 '12 at 17:13
  • I'm alrdy using ffmpeg yadif deinterlace which seems to have better quality than what gStreamer offers. – ronag Mar 20 '12 at 17:14
  • 1
    gldeinterlace (http://gst-plugins-gl0.10.sourcearchive.com/documentation/0.10.1/gstgldeinterlace_8c-source.html) seems interesting, though it doesn't use PureVideo and seems to be a "low-medium" quality filter. – ronag Mar 20 '12 at 17:16
3

Based on your clarified requirements, it looks like VDPAU is the closest match to what you desire. Complication: it's for Unix-based operating systems, not Windows.

If you're locked to Windows, DXVA is the way to go. If you're operating in a cross-platform environment, OpenMAX is the way to go. And if you're open to suggestions beyond those you've already given in your question, the rest of these are worth pursuing.

MrGomez
  • 23,788
  • 45
  • 72
  • This doesn't rly add anything more than reconfirming that I probably need to use DXVA or OpenMax, which I alrdy stated in my question. Though neither of these seem to have a simple way of doing what I want, nor do they support any formats with alpha. – ronag Mar 23 '12 at 17:25
  • @ronag Actually, it does. Note that the best I can do is a closest match, because your query is unsatisfiable for the intersection of `Windows & Alpha & Hardware Support`. The easiest of these restrictions to relax in a development environment, `Windows`, gives you a tool that hadn't been brought to the discussion previously. VDPAU is supported by Nvidia and [appears to have alpha support](http://http.download.nvidia.com/XFree86/vdpau/doxygen/html/group__misc__types.html). I don't believe your query is otherwise satisfiable without rolling your own solution or extending existing ones. – MrGomez Mar 23 '12 at 18:36
  • Unfortunately, windows is a requirement. Though it is interesting that VDPAU has alpha support. – ronag Mar 23 '12 at 18:48
  • @ronag Out of curiosity, is Nvidia support also a requirement? ATI and Intel have competing solutions. – MrGomez Mar 23 '12 at 19:03
  • @MrGomesz: Unfortunately yes, most end-users have Nvidia cards. – ronag Mar 23 '12 at 21:25
0

Point 1: You will have to go via DirectX if you want to have hardware accelerated deinterlacing with good quality.

Point 2: Apart from the options others have named (DXVA and OpenMAX) there is at least the Intel Media SDK for Quicksync accelerated deinterlace, which has not been named, and which offers a per frame deinterlacing via its VPP video preprocessing filters.

Point 3: To go from DirectX to OpenGL on NVidia: http://developer.download.nvidia.com/opengl/specs/WGL_NV_DX_interop.txt

Christopher Oezbek
  • 23,994
  • 6
  • 61
  • 85