PDA

View Full Version : grabbing videos from OpenGL (slightly OT)



JanHH
01-23-2004, 12:46 PM
Hello,

sorry if this is OT but I need to know http://www.opengl.org/discussion_boards/ubb/wink.gif. Is it possible to create a movie from an OpenGL drawing window? At the moment, we use a video camera to film the screen.. not the best solution, I guess. Are there programs that are able to grab the window contents and create a movie from it? Or should the program write screenshots to files using glReadPixels() and there's a program around that creates movies out of a series of screenshots?

thanks,
Jan

Adrian
01-23-2004, 12:59 PM
I save BMP screenshots using readpixels and then use bbmpeg to convert them to a movie. bbmpeg is free and can be found here http://members.cox.net/beyeler/bbmpeg.html
You'll want to generate the .lst file automatically from your program.

[This message has been edited by Adrian (edited 01-23-2004).]

orbano
01-23-2004, 02:36 PM
there are plenty of bmptoavi, bmptompeg converter tools, like animation tools. but i thonk there are better ways for copying your scrren, like rendering into texture (with the upcoming superbuffer extension you will be able to do this at quite acceptable performance, while creating lots of screenshots and using readpixels is extremely slow).
or as an alternative, ther are screen capture programs that are able to do this job (e.g. corel capture, included in the corel draw package)

Korval
01-23-2004, 02:46 PM
i thonk there are better ways for copying your scrren, like rendering into texture (with the upcoming superbuffer extension you will be able to do this at quite acceptable performance, while creating lots of screenshots and using readpixels is extremely slow).

If I recall correctly, isn't the only way to actually read pixel data from server-side memory to client side memory glReadPixels? So, whether or render to a texture, pbuffer, or to the screen, you still need to do a glReadPixels to get the data back, so that it can be saved.

Alessandro_dup1
01-23-2004, 04:05 PM
Take a look here: http://www.cgshaders.org/shaders/show.php?id=47

It's a cg project with the functionality to record avi movies encoded in divx.

Adrian
01-23-2004, 04:47 PM
Originally posted by orbano:
using readpixels is extremely slow

Geforces can readback at 50M pixels/sec. So at 1024x768 thats >60 fps. Radeons on the other hand readback at about a third of that speed.

JanHH
01-23-2004, 05:03 PM
thanks for all your help :-).

Jan

jwatte
01-23-2004, 05:53 PM
Alas, ReadPixels() is stalling and synchronous, so while you can read back 50 MPixels/s (in 16-bit mode; there's not enough bandwidth to get 32-bit pixels at that speed) you can't also render at that speed. If you want to use the CPU for simulation, too, the speed starts being quite low, unfortunately.

We ended up with two solutions:
1) Use a high-quality video camera and a slow phosphorous screen to film to betamax. Worked OK.
2) Use the "TV Out" of a graphics card, and record to DV tape. Worked OK. Most cards have a black border, to compensate for overscan AND allegedly to discourage movie piracy; the Radeons could make their fringe smaller than the GeForces.

We've specced out what to do for the next revision: a DVI->component video scan converter, and a component video capture card. We would have done this the last time around, but these things have long delivery times which didn't fit with our schedule at the time.

Then we down-sampled to 480x320 and 15 fps for publishing on the web. D'oh! :-) (We also made a high-quality DVD for press purposes)

Cyranose
01-23-2004, 06:32 PM
Originally posted by JanHH:
Hello,

sorry if this is OT but I need to know http://www.opengl.org/discussion_boards/ubb/wink.gif. Is it possible to create a movie from an OpenGL drawing window? At the moment, we use a video camera to film the screen.. not the best solution, I guess. Are there programs that are able to grab the window contents and create a movie from it? Or should the program write screenshots to files using glReadPixels() and there's a program around that creates movies out of a series of screenshots?

thanks,
Jan

Assuming you're on windows, the NVidia SDK contains a file called MovieMaker.cpp that shows how to use the video-for-windows and GDI to create an AVI from an OGL app fairly easily. It's definitely faster than normal glReadPixels, though not a magic solution.

Adrian
01-24-2004, 01:04 AM
Originally posted by jwatte:
Alas, ReadPixels() is stalling and synchronous, so while you can read back 50 MPixels/s (in 16-bit mode; there's not enough bandwidth to get 32-bit pixels at that speed).

With PDR readpixels is asynchronous also it takes performance up to ~50MPixels/sec from ~40MPixels/sec, thats for 32 bit pixels. http://www.opengl.org/discussion_boards/ubb/Forum3/HTML/008155.html

I just tried a real world test without PDR and got a readback speed of 38 fps at 1024x768 @32bit. (I didnt save to disk)


[This message has been edited by Adrian (edited 01-24-2004).]