PDA

View Full Version : Bind video texture to opengl primitive



Lukes
05-09-2011, 02:30 AM
Hello everybody,
I am currently working on a bomberman project and I am writing the menu(educational). I have been looking for a week now on how to bind a video to a opengl 3d model in this case a simple plane, so I have found a couple of libraries (ex : vlc) but it only works with the SDL library and I am not allowed to use anything else other than opengl. I am running out of ideas could you give me a couple hints or leads to help me out here.

Thanks everybody :) !

Alfonse Reinheart
05-09-2011, 02:57 AM
OpenGL doesn't handle video. If you have the output of video decompression, you can pass that image to OpenGL as a texture. But that's about it.

So you will need some kind of library to get the image at a particular time from a video.

Lukes
05-09-2011, 03:08 AM
Thank you for answering.
Yes, that is what I figured otherwise I would have probably found some tutorial on it otherwise.
Do you have any particular library in mind?
I was thinking opencv.

Thanks again.

The Little Body
05-09-2011, 12:27 PM
FFMPEG (http://www.ffmpeg.org/ ) is a good library for to handle video streams

You can find good tutorials here (http://dranger.com/ffmpeg/)

You can find a method for to map FFMPEG's video pictures into an OpenGL
texture here (http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=273942&page=5)

Lukes
05-30-2011, 02:02 PM
Thank you The Little Body, I used the opencv library which worked perfectly on ubuntu but for some mystical reason did not work on fedora 13. Well its weird so I will try the FFMPEG library.

Thanks Again :)

Lukes
05-30-2011, 02:03 PM
Btw, the problem with the fedora 13 was an issue with the GStreamer plugin.

The Little Body
06-04-2011, 08:19 PM
http://doc.fedora-fr.org/wiki/Lecture_de_fichiers_multim%C3%A9dia#Codecs_suppl.C 3.A9mentaires_FFmpeg

And me too, I have problems with FFMPEG update on my Fedora 14 box ... :(
(this is a mix between ffmpeg[-something]-0.6.3-1.fc14 and ffmpeg[-something]-0.6-4.20100704svn.fc14)

=> so I have manually installed ffmpeg-0.7-rc1 ...

==> on other side, the Fedora "Mise jour des logiciels" say always that it have dependances problems ... :(
(but no problem because the 0.7-rc1 work very well for me :) )