Reputation: 1463
I have written an openGL application and would like to produce a video of the graphics shown on the Glut window. Do you know how to do it?
From a previous question at SO, I know that one possible solution is to use glReadPixels to get the frames that were rendered by openGL and then use the FFmpeg library to produce the video. I don't really know how to use FFmpeg, so I'm not sure how I could write a program which takes the frames and outputs the video. Although the link is broken in the original question, I've found this example of video encoding, that may be useful for anyone trying to help.
Two questions:
lablgl
and lablglut
. Any ideas on how the FFmpeg ideas could be implemented in that case?Upvotes: 4
Views: 1619
Reputation: 9547
A variation on the png answser : output to bmp. Create a white image of the same size in Paint (or whatever is available on mac), open it with notepad, isolate the file header (for 800*600 it's 42 4D 36 F9 15 00 00 00 00 00 36 00 00 00 28 00-00 00 20 03 00 00 58 02 00 00 01 00 18 00 00 00-00 00 00 F9 15 00 00 00-00 00 00 00 00 00 00 00 00 00 00 00 00 00 27 ), append results of glReadPixels, flush, close.
So yeah, lots of files, but usually not a problem since most openGL apps don't use the hard drive too much.
( I know, it's quite dirty, but it's the simplest method to implement - I did it on the train once, without any documentation )
Upvotes: 2
Reputation: 96197
To capture video for a demo the best way is probably fraps
Upvotes: 0