Overlay and subtitles

Hello,
I’m coding a video player, and I would like to print subtitles on the video. I
use overlay for print video on the screen. I’ve try to use SDL_ttf for print
text, but the problem is that the text and the video are not printed on the same
time. So I’ve found a librarie named sdlyuvaddon, which can transform a
SDL_Surface in SDL_YUVSurface, and then blit SDL_YUVSurface with SDL_Overlay.
But it’s seem not working very good. So if someone have an idea for printing
text on overlay. Thx.

LeNain wrote:

SDL_Surface in SDL_YUVSurface, and then blit SDL_YUVSurface with SDL_Overlay.
But it’s seem not working very good. So if someone have an idea for printing
text on overlay. Thx.

If your project is GPL there are nice outline font yuv routines in mplayer.

Otherwise write your own font code, I don’t think that existing toolkit
like SDL_ttf or also using directly freetype may help you to write on
yuv surfaces since you have to handle anyway the U V components that are
usually 1/4 of the luminance.

Bye,
Gabry