PDA

View Full Version : render a avi file from ffmpeg header to opengl with sound



azrael11
09-10-2010, 04:11 PM
Did you ever find a simple program that can render a avi file from ffmpeg header to opengl cube or plane with sound ?

If someone do that and want to help me just post ....

Thanks...

User137
10-10-2010, 10:07 AM
There is at least this nehe article:
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=35
There is Delphi source at the bottom.

azrael11
11-10-2010, 11:17 AM
There is at least this nehe article:
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=35
There is Delphi source at the bottom.

Yes i know about this tutorial but it is based in the very old vfw.pas and it's not cross compiling....
That's why i mention about the ffmpeg library....

I found the headers for the ffmpeg library and is up to date... from the http://ultrastardx.sourceforge.net/ but is based in SDL ...

User137
11-10-2010, 01:18 PM
Well, basically it comes down to this line:

glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 256, 256, 0, GL_RGB, GL_UNSIGNED_BYTE, data);
That is the only OpenGL related thing needed to know, rest comes down to getting the data out, frame by frame. I would imagine you don't need SDL for this at all, i guess SDL reads the data from the library same way. It would be unnecessary and step that would slow down the rendering.

data is simply pointer to array containing R,G,B bytes per pixel. If you could for example draw a frame in given time to Bitmap/DIB you would be able to read the pixeldata. It's what the tutorial does.

Brainer
13-10-2010, 04:46 AM
Hm, I can imagine it is terribly slow for 1080p movies!

I've once talked to a guy who did a research on using mplayer front-end with his apps, maybe you could look into this further?