Convert a replay to a video
Extract pictures
Since X-Moto 0.4.0, you can extract screenshots while playing/replaying.
At command line (or in a .bat) you can use the following options:
- --videoRecording : enable video recording
- --videoRecordingSizeDivision DIVISION : Change video size (1=full, 2=50%, 4=25%)
- --videoRecordingSizeFramerate FRAMERATE : change framerate
Example:
xmoto --videoRecording myvideo1 or xmoto -r replay_555.rpl --videoRecording myvideo1 --benchmark
Note that in this example, -r is used so that the game directly starts the replay and --benchmark make X-Moto close automatically once the replay is ended. You don't need these options, you can choose to start xmoto normally, then go into the replay tab, and choose a replay. X-Moto will start to record the video only when the replay will be started. You can even close the X-Moto window when you want (the end of the replay will not be recorded).
This creates a directory called ~/.xmoto/Video/myvideo1 where you can find all the pictures taken according to the framerate and size. The is a pictures.lst file which lists all the files.
Convert frames to a video
To convert the frames, just read xmoto.log : you can find in it the command you've to run to convert the frames to the video.
Example:
transcode -i ~/.xmoto/Video/myvideo1 -x imlist,null -y xvid,null -f 20 -g 800x600 \ --use_rgb -z -o ~/.xmoto/Video/myvideo1.avi -H 0 # -w 500
- transcode is required to run this command, but you can use any video tool to build the video
- -w can be used to change the bitrate, and then, make a smaller video.
Using Mplayer/mencoder
to make my youtube video I did the following:
- Dump a replay to jpegs:
xmoto -r ~/.xmoto/Replays/replayname.rpl --videoRecording DirNameForPics --videoRecordingSizeDivision 1
- Turn it into an avi file:
mencoder "mf://DirNameForPics/*.jpg" -fps 20 -of avi -o output.avi -ovc lavc
- Glue several .avi files together:
mencoder -oac copy -ovc copy -o output.avi input1.avi input2.avi
- Add sound:
mencoder -oac copy -ovc copy -o output.avi -audiofile /Path/to/the/file/file.mp3 input.avi