View Full Version : Reading frames in real time

06-04-2003, 01:18 AM
We need to take the frames of an OpenGL animation and to send them downstream, for example to feed a streaming encoder in order to view the animation in a web page or to send the frames to a professional video board. The problem is glReadPixels() is very slow and we hardly get more than 2 frames per second. The procedure we use is: Render frame, ReadPixels, dispatch the frame.
Can anybody figure out how to improve the frame rate? I have been told about manufacturer specific extensions to make asynchronous glReadPixels calls. Can anybody tell me anything about this approach or about a different one?

06-04-2003, 02:03 AM
download the NVIDIA SDK.
look into OpenGLSDK\src\shared folder. there is a file called "moviemaker.cpp". that's exactly what you are looking for.

06-04-2003, 08:20 AM
Make sure you read the EXACT format that the frame buffer is actually running in.

If you use 32-bit frame buffer, this would usually be GL_UNSIGNED_CHAR, GL_BGRA.

Also make sure you align your read buffers reasonably.

06-04-2003, 10:31 AM
Do a search on "glReadPixels" in this forum.