Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are my options for simple video formats?

I'm playing around with a simple ray tracer and I would like to end up with a short animated clip. Right now I'm rendering the scene to a bitmap. I would like the simplest motion picture format possible since I'll probably have to implement it from scratch (in erlang). Animated gifs come to mind. Is there anything else that would provide the same bang for the buck? I'm not interested in fidelity or high compression.

PS: I would like to avoid rendering the frames into individual files and combining them into a GIF or an AVI with external tool like ImageMagick.

like image 728
EightyEight Avatar asked Feb 07 '13 02:02

EightyEight


1 Answers

Write YUV4MPEG2 to a file or to standard output, and then use ffmpeg to encode it to something reasonable. YUV4MPEG is an uncompressed format and it's ridiculously simple, especially if you use non-interlaced 4:4:4.

Alternatively, use Motion JPEG, which is basically a bunch of JPEG frames in a container. Many (though not nearly all) video players can play MJPEG directly. I'm sure you already have access to a JPEG encoder, so turning a bunch of JPEG frames into an MJPEG stream is relatively simple.

like image 63
hobbs Avatar answered Oct 17 '22 07:10

hobbs