Problem with overlay color

Now I can get overlay to my screen without much cpu
consumption when I record the video to my files. It is
just what i need.
But I encounter a problem. The video I get has no
right color. It looks too blue. Those of red color
become blue ones. I have test the recored files which
have the normal color.
why cannot the overlayed video get the normal color?
what lead this ? Has anybody experieced this problem ?
If you have gotten the answer ,please tell me .
Thanks in advance!__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world’s greatest free email!
http://mail.yahoo.com/

I experienced it when I wanted to render 16-bits
buffer-surfaces to my screen display. I had to
convert the 16-bit buffersurface to a 32-bit surface
and then render the converted surface to my YUV surface.

In other words, convert it to 32-bit, convert it to the
desired YUV format and then render it to the YUV screen.
This is at least the sollution I used. The performance
wise this could be not the best sollution but it works
anyway :slight_smile:

See the overlay example in the SDL CVS.

Regards,

Niels Wagenaar> -----Oorspronkelijk bericht-----

Van: chaffmanus [mailto:chaffmanus at yahoo.com]
Verzonden: maandag 11 maart 2002 14:01
Aan: sdl
Onderwerp: [SDL] problem with overlay color

Now I can get overlay to my screen without much cpu
consumption when I record the video to my files. It is
just what i need.
But I encounter a problem. The video I get has no
right color. It looks too blue. Those of red color
become blue ones. I have test the recored files which
have the normal color.
why cannot the overlayed video get the normal color?
what lead this ? Has anybody experieced this problem ?
If you have gotten the answer ,please tell me .
Thanks in advance!


Do You Yahoo!?
Try FREE Yahoo! Mail - the world’s greatest free email!
http://mail.yahoo.com/


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

Now I can get overlay to my screen without much cpu
consumption when I record the video to my files. It is
just what i need.
But I encounter a problem. The video I get has no
right color. It looks too blue. Those of red color
become blue ones. I have test the recored files which
have the normal color.
why cannot the overlayed video get the normal color?
what lead this ? Has anybody experieced this problem ?
If you have gotten the answer ,please tell me .
Thanks in advance!

Sounds like you have your red and blue components swapped then. Instead of
RGB format, you have BGR format (or the other way around). Just my guess
anyway, since I don’t know what overlay is really all about anyway.
Something that lays on top of something else I would assume? :slight_smile: Maybe I’ll
figure it out someday.

-Jason

----- Original Message -----
From: chaffmanus@yahoo.com (tony Tong)
To:
Sent: Monday, March 11, 2002 8:01 AM
Subject: [SDL] problem with overlay color

I experienced it when I wanted to render 16-bits
buffer-surfaces to my screen display. I had to
convert the 16-bit buffersurface to a 32-bit surface
and then render the converted surface to my YUV
surface.

Maybe your experience is different from mine.I get the
yuv data from a *.yuv file.It’s not rgb color space.so
I think convertion should not be needed.
Morever, even when I set the 32 bit overlay surface ,
it got the same result.

my code :
SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER);
screen = SDL_SetVideoMode(352,288,32,SDL_HWSURFACE);
overlay = SDL_CreateYUVOverlay ( mywidth, myheight ,
SDL_YV12_OVERLAY, screen );
fp=fopen(argv[5],“rb”);
fread(map,1,mywidthmyheight3/2,fp);
if (SDL_LockYUVOverlay(overlay)<0) goto err;
overlay->pixels[0]=map;
overlay->pixels[1]=map+(mywidthmyheight);
overlay->pixels[2]=map+(mywidth
myheight)*5/4;
SDL_DisplayYUVOverlay(overlay,&drect);
SDL_UnlockYUVOverlay(overlay);

-----Oorspronkelijk bericht-----
Van: chaffmanus [mailto:@tony_Tong]
Verzonden: maandag 11 maart 2002 14:01
Aan: sdl
Onderwerp: [SDL] problem with overlay color

Now I can get overlay to my screen without much cpu
consumption when I record the video to my files. It
is
just what i need.
But I encounter a problem. The video I get has no
right color. It looks too blue. Those of red color
become blue ones. I have test the recored files
which> have the normal color.
why cannot the overlayed video get the normal color?


Do You Yahoo!?
Try FREE Yahoo! Mail - the world’s greatest free email!
http://mail.yahoo.com/

Now I can get overlay to my screen without much cpu
consumption when I record the video to my files. It is
just what i need.
But I encounter a problem. The video I get has no
right color. It looks too blue. Those of red color
become blue ones. I have test the recored files which
have the normal color.
why cannot the overlayed video get the normal color?

Sounds like a bug in the video driver for your card.
Does it happen on both Linux and Windows? How about other video cards?

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