PDA

View Full Version : Wanted: AVI generation from OpenGL view



RalfVoigt
04-19-2000, 04:12 AM
For Windows NT: How can I generate AVI movies from an OpenGL view?
Are there special window classes? Sample code is highly welcome!

drumminj
04-19-2000, 05:10 AM
I don't know if there's an easier way to do this, but I've done this by capturing the framebuffer to a series of .TGA files, then using a freeware program called bmp2avi which will take those and make the avi. I'm not sure if this is what you're looking for...

J

Eric
04-19-2000, 11:13 PM
What I do is rendering the scene in a DIB (offscreen) and use the DIB to create each frame of my AVI file. You should have a look at all the AVI file functions of the Win32 API. You will need to include vfw.h and link to vfw32.lib.

Pay attention : some codecs don't support some pixel formats.......

Eric

P.S. : you might also create your frames with a glReadPixels of the frame buffer. The problem is that if the size of the window is changed during the recording process, you're AVI will look strange !

Antoche
04-20-2000, 01:32 AM
One tip : if you use Win32 functions to init your OpenGL window, you can specify WM_DRAW_TO_BITMAP (ot smthg like that) in your PixeFormatDescriptor instead of DRAW_TO_WINDOW. I didn't try it, but it seems designed for what you want to do. The reference says it outputs the framebuffer into a buffer in the memory that you can access.
Check it out and tell us what you get.