Sign in to follow this  

Simple video file format?

This topic is 3720 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I'm working on a little raytracer which I'd like to use to produce some short animations (render the scene, save it out as a frame of video, move some stuff, render the scene again, save it out etc etc). I'm trying to work out what file format would be the simplest thing to save the video out as. - I don't need to save out any audio - I would like the format to be something as universal and cross-platform as possible, the kind of thing that you can display on Windows, Linux and Mac boxes - I don't mind too much about the resulting file size - by which I mean I'd rather have simple code and a big resulting video file than complex code (or reliance on external libraries) and a smaller video file. - I could probably cope with having some kind of colour palette rather than full 24-bit RGB values, if that was necessary. - I'm writing in C/C++, if it makes any difference Any suggestions? I figured maybe GIF or some kind of AVI codec perhaps, but I don't know how cross-platform they are, or how easy it is to create those kind of files. Ideally I'd just like something where I can just write a file header saying "This is a video file of type FOO. It's size is X * Y pixels, and it's Z frames long", followed by just a series of images. Are there still such naive formats in reasonably common usage anywhere?

Share this post


Link to post
Share on other sites
You can try searching for '(ext) file format' where (ext) can be whatever file format you want to use. For example, http://www.google.com/search?q=GIF+file+format. You should find a webpage that explains what, exactly, all the random letters mean when you open such a file in a text editor. Or you could find a free DLL or library to do this for you automatically (from JPG, BMP, GIF, etc. frames).

Share this post


Link to post
Share on other sites
Hi, thanks for the replies.

I'm aware that the simplest option from a coding standpoint would be to save out a series of images and let another program do the conversion, and that trying to write my own video exporter as part of the program is kinda reinventing the wheel, but for various strange and complex reasons, I'd like my program to be a standalone thing with no reliance on other programs or libraries.

From hunting around a bit, it looks like GIF might be a workable solution, although that's based only on the fact that I managed to find a reasonably clear specification for it, and it's a file format I've heard of. If there's anything which is as simple (or simpler!) to write an exporter for and doesn't require indexed colour, I'd be interested in hearing about it.

Share this post


Link to post
Share on other sites
There is RAW format (AVI codec, different ones exist for DV and Qt), it should be natively supported by windows AVI players.

But for the life of me I cannot find the specification.

It basically involves using AVI file structure (just basic RIFF/IFF), and then dumping RGB frames. Perhaps someone else will find how the header needs to be set and the data ordered.

virtualdub source might also give some insight.

If you use this, you should be able to get playable video stream, and use any DirectMedia-compatible video editing software to compress it.

Share this post


Link to post
Share on other sites

This topic is 3720 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this