Display text with SDL_DisplayYUVOverlay?

I have a program that uses SDL_DisplayYUVOverlay() to display frames
from a video.
I have been able to put text on an animated sdl surface with

message = TTF_RenderText_Solid(font, str, textColor) followed by
SDL_BlitSurface(message, NULL, screen, &dest_rect ) where message 

and screen are SDL_Surfaces.

Can someone tell me how to get text to appear using
SDL_DisplayYUVOverlay()?

thanks,
Bob

Bob,

I have been trying to come up with a way to do the same thing. From
what I gather, you need to take the RGB pixels of the TTF surface and
convert them to the appropriate YUV pixels and blit/raster them to the
YUV overlay pixels.

I don’t know if you are familiar with tvtime, but it has a bunch of
routines for blitting YUV lines/pictures/etc. to a YUY2 overlay. Might
be a little helpful.

I would think that there would be some type of package available for
this type of stuff, but I haven’t seen anything yet…

Shane

bob self wrote:> I have a program that uses SDL_DisplayYUVOverlay() to display frames

from a video.
I have been able to put text on an animated sdl surface with

message = TTF_RenderText_Solid(font, str, textColor) followed by
SDL_BlitSurface(message, NULL, screen, &dest_rect ) where message 

and screen are SDL_Surfaces.

Can someone tell me how to get text to appear using
SDL_DisplayYUVOverlay()?

thanks,
Bob


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Shane M. Walton wrote:

Bob,

I have been trying to come up with a way to do the same thing. From
what I gather, you need to take the RGB pixels of the TTF surface and
convert them to the appropriate YUV pixels and blit/raster them to the
YUV overlay pixels.

I’m totally new to SDL. I searched google groups for
SDL_DisplayYUVOverlay and only find 7 references
and most of those have to do with compiling / linking problems. If I get
the text SDL_Surface converted to a YUV overlay
how do you copy from one YUV overlay to another one. I don’t see any
functions in SDL that do that.

I don’t know if you are familiar with tvtime, but it has a bunch of
routines for blitting YUV lines/pictures/etc. to a YUY2 overlay. Might
be a little helpful.

I started looking at tvtime and it looks promising. I found
videotools.h:void blit_colour_packed4444()
videotools.h:void blit_colour_packed422()
plus some other copying functions in copyfunctions.c. I don’t know which
one to focus on. Have
you used any of these? Do you know which of these functions would
convert rgb to SDL-compatible yuv format?

I would think that there would be some type of package available for
this type of stuff, but I haven’t seen anything yet…

Shane

These seem like basic functions that should be in SDL.

Bob

You could try the YUV-addon, but I didn’t find it very useful, it only
supports 420P and seemed buggy as it doesn’t claim to be bug free.

http://www.libsdl.org/projects/sdlyuvaddon> -----Original Message-----

From: sdl-bounces+swalton75=cox.net at libsdl.org [mailto:sdl-
bounces+swalton75=cox.net at libsdl.org] On Behalf Of bob self
Sent: Thursday, March 16, 2006 5:45 AM
To: A list for developers using the SDL library. (includes SDL-announce)
Subject: Re: [SDL] display text with SDL_DisplayYUVOverlay?

Shane M. Walton wrote:

Bob,

I have been trying to come up with a way to do the same thing. From
what I gather, you need to take the RGB pixels of the TTF surface and
convert them to the appropriate YUV pixels and blit/raster them to the
YUV overlay pixels.

I’m totally new to SDL. I searched google groups for
SDL_DisplayYUVOverlay and only find 7 references
and most of those have to do with compiling / linking problems. If I get
the text SDL_Surface converted to a YUV overlay
how do you copy from one YUV overlay to another one. I don’t see any
functions in SDL that do that.

I don’t know if you are familiar with tvtime, but it has a bunch of
routines for blitting YUV lines/pictures/etc. to a YUY2 overlay. Might
be a little helpful.

I started looking at tvtime and it looks promising. I found
videotools.h:void blit_colour_packed4444()
videotools.h:void blit_colour_packed422()
plus some other copying functions in copyfunctions.c. I don’t know which
one to focus on. Have
you used any of these? Do you know which of these functions would
convert rgb to SDL-compatible yuv format?

I would think that there would be some type of package available for
this type of stuff, but I haven’t seen anything yet…

Shane

These seem like basic functions that should be in SDL.

Bob


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

It looks like mplayer has an OSD as well, and it supports almost all RGB and
YUV color schemes. It looks like they create an alpha buffer based on the
destination and the image to overlay and use it to make a transparent blit.

The good news is that pretty much all the blit (osd_write) calls are
optimized for given architectures.

It would be really sweet if this could be integrated into SDL or at least a
nice little addon to handle YUV_Surface and RGB_Surface.

Shane> -----Original Message-----

From: sdl-bounces+swalton75=cox.net at libsdl.org [mailto:sdl-
bounces+swalton75=cox.net at libsdl.org] On Behalf Of bob self
Sent: Thursday, March 16, 2006 5:45 AM
To: A list for developers using the SDL library. (includes SDL-announce)
Subject: Re: [SDL] display text with SDL_DisplayYUVOverlay?

Shane M. Walton wrote:

Bob,

I have been trying to come up with a way to do the same thing. From
what I gather, you need to take the RGB pixels of the TTF surface and
convert them to the appropriate YUV pixels and blit/raster them to the
YUV overlay pixels.

I’m totally new to SDL. I searched google groups for
SDL_DisplayYUVOverlay and only find 7 references
and most of those have to do with compiling / linking problems. If I get
the text SDL_Surface converted to a YUV overlay
how do you copy from one YUV overlay to another one. I don’t see any
functions in SDL that do that.

I don’t know if you are familiar with tvtime, but it has a bunch of
routines for blitting YUV lines/pictures/etc. to a YUY2 overlay. Might
be a little helpful.

I started looking at tvtime and it looks promising. I found
videotools.h:void blit_colour_packed4444()
videotools.h:void blit_colour_packed422()
plus some other copying functions in copyfunctions.c. I don’t know which
one to focus on. Have
you used any of these? Do you know which of these functions would
convert rgb to SDL-compatible yuv format?

I would think that there would be some type of package available for
this type of stuff, but I haven’t seen anything yet…

Shane

These seem like basic functions that should be in SDL.

Bob


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Shane M. Walton wrote:

You could try the YUV-addon, but I didn’t find it very useful, it only
supports 420P and seemed buggy as it doesn’t claim to be bug free.

I tried this. I can get a rectangle of garbage to overlay on the screen
but that’s about it and it crashes when I free the surface.
I don’t know about yuv formats. It looks like I’ll have to read about that.

Bob