29.6.08

Dosbox video capturing how to

Hello, Masters of Orion.
I read this post recently and found out that it is out of date. So I decided to contribute a little to our community and write this post.

What I would like to share with you is that it is possible to capture video from the game without any auxiliary program, but using dosbox directly (starting from 0.65 version). To do that you need to open dosbox.conf file, find the string captures=capture and
replace it with path to any ‘EXISTING’ folder you like, where you want to place captured video, for example

captures=d:\captures

If you don't change this, by default recorded video will be placed to

c:\program files\dosbox-0.72\capture folder.

After you have done this, you can simply launch dosbox and start capturing video by pressing ctrl+alt+f5 buttons simultaneously. When you press it, file named orion2_000.avi will be created in your folder. IF you press ctrl+alt+f5 buttons again, video capturing will stop. By pressing it again it will renew recording to orion2_001.avi file.
 I was amazed how easy it was to capture video, but the problem was later with program to watch recorded video.
The problem is that dosbox writes video with special ZMBV codec. This codec is not widespread, but it is perfect for capturing game video.

The Win 32 Release of DOSBox already includes the necessary CODEC and install scripts needed to allow Windows Media Player (or almost any other movie player in Windows). If you installed the Start Menu shortcuts simply select Install movie codec and it will perform installation of the needed codec automatically.



However you won’t be given any message of completion of the installation, so you’ll have to check whether it was installed manually - by trying to play your movie.
If you didn't installed Start menu shortcuts, or under Linux and MacOS X you can use MPlayer (a popular command line video player) and it should be able to play the captured video without any special configuration. Also it is able to increase( ] button ) and decrease ( [ button ) speed of replay.
That's the basics, everyone can read about it here and here.

The size of the captured video is about 1gb per 3 hours of game, but you can compress it with winrar and it would take about 300mb space.
Also, you can reduce video size by using mencoder(part of mplayer)
I have tried different codecs to reduce video size and found out, that zmbv codec, used by dosbox is probably the best in size/quality ratio with one exception that you have to entirely discard sound from video.
Here is an example of the script:

mencoder -nosound -ovc copy orion2_*.avi -o moo2.avi

If you have several files like orion2_000.avi, orion2_001.avi orion2_002.avi etc.
They will be united into one file - moo2.avi
1Gb video will become 210mb with no video quality loss, but without sound. The reason for this is that dosbox stores sound entirely uncompressed in pcm format. You could try to compress sound too, using the for example the mp3lame codec.
Here is an example of the script:

mencoder -oac mp3lame -ovc copy orion2_*.avi -o moo2.avi

However I had a problem viewing such videos.
(but ffmpeg results were much worse, with the same settings )
You can get common divx video with satisfactory quality and same size 300mb using following commands:
The first pass:

mencoder -nosound -ovc xvid -xvidencopts pass=1:par=vga11:threads=128 goodmap3_*.avi -o xvid1.avi

In result you receive about 500Mb file
The second pass:

mencoder -nosound -ovc xvid -xvidencopts pass=2:par=vga11:threads=128:bitrate=-300000 goodmap3_*.avi -o xvid2.avi

In result you receive the desired 300mb file.
But this operation takes about 2 hours on my core 2 duo 2ghz processor.
Additionally, you can add compressed sound to video file by using the mentioned mp3lame decoder
Here is an example of the script:
The first pass:

mencoder -oac mp3lame -ovc xvid -xvidencopts pass=1:par=vga11:threads=128 goodmap3_*.avi -o xvid1.avi

The second pass:

mencoder -oac mp3lame -ovc xvid -xvidencopts pass=2:par=vga11:threads=128:bitrate=-300000 goodmap3_*.avi -o xvid2.avi

1 comment:

Philcha said...

VideoLAN's VLC player also plays DOSBox vids OK (without sound) - it has every non-proprietary codec built in, no more codec hell!

Loading...