PDA

View Full Version : Show a bitmap video in OpenGL



Doctor100
08-18-2014, 02:56 AM
Hi,

how can I upload bit maps and show it as video in OpenGL?

Thanks

Agent D
08-18-2014, 05:16 AM
You could theoretically show short animations by uploading to a texture array or 3D texture and running through the slices.

If it actually has to be a longer video, I suggest using a texture array or 3D texture as a ring buffer, precacheing a few frames and continously loading the next frames as the existing ones are displayed.

Doctor100
08-19-2014, 12:50 AM
Ok ,can u give an example to it? or put a link? Thanks :-)

Agent D
08-19-2014, 12:58 AM
A few things first:

I never implemented or saw such a thing, this is just an idea how it could be done
You didn't specify what your video source is
Loading actual video files is already enough of a pygalgia as is
There are probalby already implementations out there that simply copy frame by frame into a texture using glTexSubImage2D (did you try a google search?)
this here (https://en.wikipedia.org/wiki/Ring_buffer) should provide a useable explanation of what ring buffers are
this here (http://www.opengl.org/wiki/Array_Texture) should provide a useable explanation of what array textures are