View Full Version : Wanted: AVI generation from OpenGL view
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!
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...
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.......
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 !
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.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.