Re: [PyOpenGL-Users] q - glDrawPixels with YCbCr data?
Brought to you by:
mcfletch
From: Mike C. F. <mcf...@vr...> - 2007-12-16 20:21:31
|
David McNab wrote: > Hi all, > > I've been developing a python app using the FLTK widgets (via pyFLTK). > > A critical part of the app is drawing video frames onto a GL window via > glDrawPixels. (FLTK offers very basic support for GL windows, via its > Fl_GL_Window class). > > At the moment, it's working nicely as long as I pass the pixels data in > RGB format. But video editing works mainly with YCbCr format data, and > converting the data into RGB format is very costly for CPU cycles - > takes around 20ms on my 2GHz box. > > I've been told on #opengl that there is a way to set up an GL window so > that if passed YCbCr data, it will display with correct colours. > > I'm a complete n00b with all things GL, I haven't got weeks to meditate > on the Red Book etc. > > Is there a simple straightforward way via PyOpenGL to set up a GL window > so that it can work with YCbCr data passed in via glDrawPixels? > Afraid this is well out of my experience range. From 40 minutes or so of reading around and looking into the code that people are using, it seems there's an approach that can be used with fragment shaders for certain types of data, but that it won't work for every YUV data type out there. There are some other extensions that are specifically targeted at the task, but they seem to be reasonably rare. GStreamer seems to have a "bad" plugin that renders to OpenGL, but it's a "bad" plugin. http://www.mdk.org.pl/2007/11/17/gl-colorspace-conversions Sorry I don't have more information to give, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |