Recording to an AVI file
I want to record what happens in an OpenGL program to an AVI file. How would I do this? Would I take the variable used in updating the buffer and somehow transfer the data to an AVI, frame by frame? Or would I do something else??
--------------------------------------
I am the master of stories.....
If only I could just write them down...
I am the master of ideas.....If only I could write them down...
for every frame you would have to render it, and then read the pixels on the screen, and save that data to the avi file.
I'm not sure how the data is stored though... And if you don't want HUGE files you should find a way to compress it (RLE?)...
[edited by - James Trotter on April 26, 2003 10:23:11 AM]
I'm not sure how the data is stored though... And if you don't want HUGE files you should find a way to compress it (RLE?)...
[edited by - James Trotter on April 26, 2003 10:23:11 AM]
Just a quick thought from me, do you really need an AVI. Like, is it going to be a recorded demo that does a replay of a sequence. If so you could save the actuall game state to a file and make a function that can replay this states in the game. If you don''t understand what I mean just let me know and I''ll try and explain.
-Patrik Willbo
-Patrik Willbo
Well, the advantages to saving it to an AVI is quite obvious, really. When rendering the AVI you are only rendering the frames anyway, so it doesn''t matter what sort of effects you use in your demo, or whatever... While you probably couldn''t do radiosity in real-time in your application, you can compute it and save the scene with real-time radiosity into the AVI. That''s why cinematics from alot of games (Diablo 2, Warcraft 3, etc.) look SOOO great!
James Trotter knows exactly what I''m trying to do! Obviously, these scenes that I will be making will not be as good as those in professional games, but they will be better than normal graphics, for one reason. While making these scenes, the graphics can go as slow as they want to. I could have something that would take 1 frame per second to create run at 60 frames per second after it has been made into an AVI.
--------------------------------------
I am the master of stories.....
If only I could just write them down...
--------------------------------------
I am the master of stories.....
If only I could just write them down...
I am the master of ideas.....If only I could write them down...
I''ve done some stuff like this, erm...lets see:
AVIFileOpen(), AVIFileCreateStream(), AVIStreamWrite() etc
look it up in the platform SDK. Not hugely difficult though, like writing bitmaps, only one per frame. You set the frame rate in the AVI header info, so you can take as long as you like rendering each frame (obviously
) Compression is relatively easy too, tho I cant remember how you do it off the top of my head, it''s in the platform SDK as well.
George. F
"Who says computer games affect kids, imagine if PacMan affected us as kids, we''d all sit around in a darkened room munching pills and listening to repetitive music....uh oh!"
AVIFileOpen(), AVIFileCreateStream(), AVIStreamWrite() etc
look it up in the platform SDK. Not hugely difficult though, like writing bitmaps, only one per frame. You set the frame rate in the AVI header info, so you can take as long as you like rendering each frame (obviously

George. F
"Who says computer games affect kids, imagine if PacMan affected us as kids, we''d all sit around in a darkened room munching pills and listening to repetitive music....uh oh!"
George. F"Who says computer games affect kids, imagine if PacMan affected us as kids, we'd all sit around in a darkened room munching pills and listening to repetitive music....uh oh!"
Why not look in the tutorial that teachs how to play an AVI? Maybe there you''ll find the answers on how to record. There must be similar, or use the same headers or libraries...just a thought...not sure...
"Steel and Fire,Spreading the Holy Word,Dirty Liars,The truth has never been told" - Primal Fear
I have a class that reads and creates AVI''s using screenshots captured with glReadPixels. You can download it if you want. It''s at www.freewebs.com/avariant
I''ve used it to do exactly what you are discussing, typically with particle effects that take thousands of polys.
I''ve used it to do exactly what you are discussing, typically with particle effects that take thousands of polys.
if you wanna make cinematics, why dont you model them in 3dstudio or something and make a animated avi?
Thats how the pro''s do it...
Sorry if my answer is lame, im tired...
Thats how the pro''s do it...
Sorry if my answer is lame, im tired...
Real-Time things are better...rather than playing the AVI...but you might be using high-tech special effects just like in 3DS Max,it rensers the smaller image in about 1-2 secs and for real-time you need minutes->hours,but I really don`t think youre gonna get the same quality though...
You might try to do what the programmer from "Serious Sam :FE/SE"
the record function,it actually records all the modifications of all the objects in the game,like a multi savegame,but less space I gues...It might also function like a direct script...
Good luck on saving/rendering the AVI ...
You might try to do what the programmer from "Serious Sam :FE/SE"
the record function,it actually records all the modifications of all the objects in the game,like a multi savegame,but less space I gues...It might also function like a direct script...
Good luck on saving/rendering the AVI ...
Relative Games - My apps
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement