Skip to content

Encoding Videos

J.B. Langston edited this page Apr 7, 2019 · 3 revisions
.. index::
   pair: Encoding; Videos

Encoding Videos

To create a video, make and xaf file first (the easiest way to do this is to use the record function in the file menu). Then you need to render the animation. XaoS can output sequences of ordinary PNG images, that can later be used by a video encoder.

Generating image sequences for video

To generate an image sequence, choose Render Animation from the Misc menu. You can also use the following command on the command line:

xaos -render [filename] -size 352x240 -antialiasing -renderframerate 24 -basename [basename]

File to render ([filename]) is the name of the xaf file, Basename ([basename]) is the name used as the base filename for rendered images. This should also include the path where you want to save the images. XaoS adds a four digit sequence number and .png extension to this name automatically.

You might also want to change the resolution. Make sure that the resolution you choose is supported by the video codec you wish to use.

The framerate can also be altered. Make sure you choose a framerate that is supported by the video codec you wish to use.

Antialiasing (-antialiasing) is used to produce anti-aliased images. It takes a much longer time and much more memory to calculate them, but resulting images are better for video compression and they result in a much smaller video file. (the same is true of JPEG images)

On the other hand, the other XaoS rendering option Always Recalculate (-alwaysrecalc) (which disables XaoS's zooming optimizations) is not recommended. If that's used, the sequence of animation then contains quite a lot of extra information, which increases size of video file, but because of the codec's lossy compression it is hard to see any difference, so it's not worth it.

Rendered files

Once you start it, XaoS will generate thousands of frames. They take quite a long time to calculate and save, and consume plenty of disk space. (e.g. to render part 1 of the tutorial you need about 60MB and half an hour of time).

All images are named [basename]framenum.png. For example intro0001.png is the first frame of the animation intro. If consecutive frames are the same, XaoS doesn't save them, so some frames may be missing. If your encoder can't handle that, you will need to write a simple script which will fill in the gaps by means of mv or symbolic linking.

A list of all filenames is saved into the file [basename].par, where each line is the name of one frame. The names repeat here if necessary, so you can use this file to supply filenames to the encoder.

Encoding videos

Once XaoS has generated the png files for each frame of the animation, you can use a third-party video encoder to convert the sequence of images into a video file. We currently recommend the following encoders, which support a wide variety of video codecs and file formats:

ffmpeg

mencoder (part of mplayer)

These are both command line tools. If you prefer a graphical tool, you may prefer Quicktime Pro from Apple. However, this software costs approximately US $30. Although QuickTime may be easier to use, the two free encoders above are just as capable once you learn how to use them.

Clone this wiki locally