How do I show an Mpeg2/3/4 video stream in an opengl scene
Posted on 2010-01-11
I am writing some OpenGL software to visualize data from multiple sources/sensors. Some of the sources include cameras that can create an MPEG video. I am wondering how to capture the video and render it in an OpenGL scene. (We are using OpenGL for cross platform purposes...linux...windows, etc). I really have two goals with this question,
First, how would I pull off individual frames from the MPEG video so that I can save them in memory, load them to a texture, and represent them in OpenGL (updating as new frames come in)?
Second, (and I'm not sure the best way to ask this), is there a way to tie a texture to an actual movie file and just play the movie file. Basically, I'd like to show the camera in 3D and the movie information coming off the camera (in a 3D scene, viewable from any angle). (The first approach is an acknowledged hack (as it requires a frame by frame grab and render.)
It is for a game-like application that relies on real-time real-world data.
I'd really appreciate help understanding this. Thanks in advance,