Intro to YUV Overlays

Hi everybody,

I need to add video playback to my SDL-based framework. I found a
tutorial that uses ffmpeg and YUV overlays to show an AVI, which is
pretty much what I need.

I’m considering how to integrate this to the framework. The main problem
is that I can’t find any document explaining how are the SDL Overlays
supposed to be used. The documentation does explain the functions but I
didn’t find any “big picture” article. Any suggestions?

Thanks,

    --Gabriel________________________________________________________________________

Gabriel Gambetta
Mystery Studio - http://www.mysterystudio.com
Gabriel’s Stuff - http://www.mysterystudio.com/gabriel

I’m considering how to integrate this to the framework. The main problem
is that I can’t find any document explaining how are the SDL Overlays
supposed to be used. The documentation does explain the functions but I
didn’t find any “big picture” article. Any suggestions?

SDL YUV overlays are basically surfaces in a non-RGB colorspace. Hardware
accelerated implementations often use the video card overlay hardware so
they don’t reside in the 2D framebuffer.

Do you have any specific questions?

See ya,
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment

El lun, 09-07-2007 a las 16:29 -0700, Sam Lantinga escribi?:

I’m considering how to integrate this to the framework. The main problem
is that I can’t find any document explaining how are the SDL Overlays
supposed to be used. The documentation does explain the functions but I
didn’t find any “big picture” article. Any suggestions?

SDL YUV overlays are basically surfaces in a non-RGB colorspace. Hardware
accelerated implementations often use the video card overlay hardware so
they don’t reside in the 2D framebuffer.

Do you have any specific questions?

Thanks, Sam. The thing is my framework actually uses Direct3D or OpenGL
to draw stuff over the SDL screen, so it appears I can’t use SDL YUV
overlays at all - I’ll have to convert the YUV data to RGB into a SDL
image and work as usual.

Thanks!
–Gabriel________________________________________________________________________
Gabriel Gambetta
Mystery Studio - http://www.mysterystudio.com
Gabriel’s Stuff - http://www.mysterystudio.com/gabriel

Thanks, Sam. The thing is my framework actually uses Direct3D or OpenGL
to draw stuff over the SDL screen, so it appears I can’t use SDL YUV
overlays at all - I’ll have to convert the YUV data to RGB into a SDL
image and work as usual.

Take a look at SDL’s software overlay support, there’s already optimized
code to do that there.

Thanks!

You’re welcome!

-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment

If you are using shaders, you can make the conversion within a fragment
shader.

You just need to make the conversion before applying the color you got
from the texture look up.

Different yuv data types can be directly converted to rgb so you can use
the format that is the natural output of your source material. So the
only cpu intensive task is the decoding of the data.On Tuesday 10 July 2007, Gabriel Gambetta wrote:

El lun, 09-07-2007 a las 16:29 -0700, Sam Lantinga escribi?:

I’m considering how to integrate this to the framework. The main
problem is that I can’t find any document explaining how are the
SDL Overlays supposed to be used. The documentation does explain
the functions but I didn’t find any “big picture” article. Any
suggestions?

SDL YUV overlays are basically surfaces in a non-RGB colorspace.
Hardware accelerated implementations often use the video card
overlay hardware so they don’t reside in the 2D framebuffer.

Do you have any specific questions?

Thanks, Sam. The thing is my framework actually uses Direct3D or
OpenGL to draw stuff over the SDL screen, so it appears I can’t use
SDL YUV overlays at all - I’ll have to convert the YUV data to RGB
into a SDL image and work as usual.