Making Movies
From Darwin
First you have to generate frame images. You can use
Whichever method you use to create the frames, we will assume that you now have a set of images, numbered consecutively, e.g., frame0000000001.png, frame0000000002.png, ... .
Encoding the movie
Create a movie from the frames using a video encoder. ffmpeg is fast and can handle large frames. It is installed on evolution (make sure your PATH contains /usr/local/bin and LD_LIBRARY_PATH contains /usr/local/bin). To encode at maximal quality and 25 frames per second, use
ffmpeg -r 25 -i 'frame%010d.png' -intra -sameq movie.mp4
Note that the files have to be numbered consecutively, so ffmpeg can find them: frame0000000001.png, frame0000000002.png, ... . On evolution, the script /home/jahn/bin/ffmpegframes accepts a list of arbitrarily named files or a directory instead of a pattern (and otherwise the same options as ffmpeg). It links the files with consecutive names to a temporary directory and runs ffmpeg on them.
The '-intra' option forces all frames to be 'intra' frames that do not depend on previous frames, i.e., the movie is just a sequence of independently compressed frames. This makes every frame seekable and allows stepping backwards through the movie, but also results in larger files.
The '-sameq' option makes ffmpeg attempt to maintain the quality of the input media. Since png is lossless, this will create an mpeg with the fewest artifacts possible. If the resulting file is too big, try reducing the quality, e.g.
ffmpeg -r 25 -i 'frame%010d.png' -qscale 10 movie.mp4
The value of -qscale ranges from 2 (highest) to 31 (lowest quality). Or you could request a specific bit rate (in bit/second):
ffmpeg -r 25 -i 'frame%010d.png' -b 24000000 -bt 8000000 movie.mp4
The option -bt specifies the tolerance in bitrate. Increase it if ffmpeg complains.
Limitations:
- most precompiled ffmpeg limit width,height <= 2048 pixels. You would have to recompile ffmpeg with higher VOFW and VOF values in libswscale/swscale_internal.h to get around this. On evolution, you can use /home/jahn/bin/ffmpeg which allows frames up to 16384x16384.
- If ffmpeg complains that it cannot generate mp4, either install the required codecs and recompile ffmpeg with mpeg4 support, or try changing the extension of the output file to mpg (e.g., movie.mpg). This will generate an mpeg1 video. Note, however, that mpeg1 and 2 only allow certain frame rates (>=15).
- we can currently play movies up to roughly 75 Megapixels/second (e.g. 2000x1500 at 25 fps) with all our applications. Higher-res ones may be possible with one of the applications.
- the aspect ratio of the whole wall is 8:3, e.g. 2000:750
