views:

94

answers:

3

I want to make some GUI mockup program for video player, so my idea is just to show some menu pictures over real video being playback. I have working program made with C and SDL just to load pictures and make a slideshow, but i don´t know how to put this over video with transparencies.

Do you have a hint?

ps. i usually program with python and C, so if there is any solution with this two i highly appreciate.

Thanks!

+1  A: 

I think you can use this tutorial, to get a working video player in SDL: http://dranger.com/ffmpeg/tutorial01.html

The tutorial is using SDL and ffmpeg. In the "tutorial 01", the video frame is converted to 24-bit RGB, so you can just do some tricks and translate to a surface.

If you want the overlay, you can see this library: http://www.libsdl.org/projects/sdlyuvaddon/

There is a function (Get_YUV_From_Surface) to convert a surface to YUV. You will need to modify it to fit your needs, but you can see the function to get some ideas.

Dudaskank
+1  A: 

Suggestion: use Openframeworks

http://www.openframeworks.cc/documentation

It is in C++ though, and not C.

Check the documentation for class ofVideoPlayer

kazanaki
+1  A: 

You could render the video with OpenGL using a textured quad, and then do all your 2D drawing on top (with an appropriate 2D projection matrix setup) using GL.

Depending on your codec, you are quite likely to end up with YUV data (rather than RGB). Depending on the platform and your hardware, you may be able to use a native texture type, to avoid having to convert to RGB first.

By using alpha blending, you can easily come up with some very sophisticated looking UIs. You will probably want to look into something like FreeType to handle the font rendering, as this is one area of GL that is platform-specific and fiddly to get working.

There are loads of tools, scene graphs, widget libraries and so on for OpenGL you can use too.

gavinb