[hatari-devel] new support for avi recording
npomarede at corp.free.fr
npomarede at corp.free.fr
Wed Oct 7 23:57:22 CEST 2009
Hello,
after quite some time, I finally completed the avi recording support I
started 2 months ago.
This mode will create some video+audio recording of Hatari with as little
overhead as possible.
Although the avi support is modular and could be extended with support for
other audio/video codecs, I chose to use only some lossless and low cpu
codecs. This way, you can record a game while playing it, without
suffering slowdown.
Sound is saved as 16 bits stereo pcm (same as the wav recording option).
Video can be saved as uncompressed 24 bits BMP images or as PNG images.
No frames are skipped, so you will get a full 50 or 60 Hz video in the
end.
The BMP format uses very few cpu but requires a lot of disk space and some
fast disk to be able to record all the frames.
The PNG format uses a compression level of 4, which gives a good tradeoff
between disk space and cpu usage.
The following options were added :
--avirecord : immediatly starts recording (useful when restoring a
memory snapshot)
--avirecord_vcodec : choose between BMP and PNG (default is png)
--avirecord_fps : force frame rate (useful if the program changes frame
rate, such as boot sequence where the shifter starts at 60 Hz then goes
to 50 Hz) (default is 50)
--avirecord_crop : remove all gui element (status bar) from the recorded
video (default is yes)
--avirecord_file : choose destination file (default is hatari.avi)
For the GUI, I replaced the 'record animation' option with 'record AVI' as
quick hack. Feel free to add back 'record animation' button if someone
requires it (but I think that 'record avi' supersedes this mode, so we
shouldn't need it anymore).
For better results, don't use "zoom low res" option, as this will require
4 times more data to compress and a lot more cpu.
Although it's possible to extend the codec list, I think using bmp and png
should be enough. This mode is not supposed to be a full ffmpeg
implementation, but a way to record Hatari's output in real time in a
lossless format.
Videos can then be recompressed using mencoder or ffmpeg to use h264 codec
and mp3 for example.
example :
hatari --memstate ~/Emul/ST/hatari.sav/nostalgic_intro.sav -z 1
--avirecord --avirecord_fps 50 --avirecord_crop y --avirecord_file
/tmp/hatari.avi
Happy recording of your faves demos !
Nicolas
PS : OSX version certainly needs to be updated to add avi_record.c to the
project.
More information about the hatari-devel
mailing list