20130320
[gdash.git] / docs / replay_to_avi.html
blob54f5ca2cfff5730b514d10be66041d77a7ee7469
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
3 <head>
4 <title>GDash - saving replays as AVI files</title>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6 <meta http-equiv="Content-Language" content="en">
7 <meta name="author" content="Czirkos Zoltán">
8 <meta name="language" content="hu">
9 <link rel="stylesheet" href="style.css">
10 </head>
12 <body>
13 <h1>GDash - saving replays as AVI files</h1>
15 <h2>Converting a replay to an AVI file</h2>
16 <p>In the "C64-like" version of the game, you can save images of replays to create an AVI file.
18 <p>You can load a caveset in the main menu
19 by pressing the <b>L</b> key. After that, the <b>R</b> key will show the available
20 replays, as it would normally do in the game.
21 You can select the desired replay with the <b>up</b>/<b>down</b> arrow keys, and save it
22 with the space key. You are then required to select the filename prefix
23 for the files saved. The files saved have names like <i>out_00000000.png</i>, <i>out_00000001.png</i>
24 etc. for the video frames, and <i>out.wav</i> for the audio data. The filename
25 prefix is <i>out</i> in this case. You can also modify the folder where the
26 files are saved. Be sure that there are no files with those names already there.
27 They will be overwritten; also they might be incorrectly recognized by Avidemux
28 which will do the converting.
29 <p>
30 You can watch the replay during the saving process, it is shown in real time.
31 (Currently the saving cannot be speeded up.) Don't be surprised: there
32 will be no sound. But it is of course saved to the disk.
33 One minute of audio data takes around 5 megabytes of disk space, and the image
34 data rate is usually around 4 megabytes per minute.
35 <p>
36 When the files are saved, you will be shown the replays menu again. Press <b>ESC</b> to
37 quit the application.
43 <h2>Converting the files to AVI with Avidemux</h2>
44 <a href="#links">Avidemux</a> is a simple video conversion application which is freeware. It is
45 available on both Windows and Unix platforms. It has several built-in codecs, so it does not
46 require any external utilities to be installed.
47 <p>
48 The steps to convert the image files to an AVI movie are pretty straightforward.
50 <ul>
51 <li>Start up Avidemux.
53 <li>Choose <b>File|Open</b>, and select the first image file (eg. <i>out_00000000.png</i>) of your
54 project. Selecting the successive images is not required, as Avidemux will automatically
55 recognize them. You can now see the first frame of your animation.
57 <li>Click <b>Audio|Main&nbsp;Track</b> from the menu. For <b>Audio&nbsp;source</b>, select
58 <b>External&nbsp;WAV</b>.
59 Click browse, and import the wave file GDash has written (<i>out.wav</i>.)
61 <li>Select <b>Video|Frame&nbsp;Rate</b> from the menu. It should be set to 25 fps. That is the default
62 value in Avidemux and is also required for the GDash replays, but you should check to make sure it is ok.
63 <div class="center"><img src="avidemux_fps.png"></div>
65 <li>At this point you should be able to preview the video with the play button located at the
66 lower left part of the Avidemux window. You can also use the scroll bar to seek to any part.
68 <li>To save the AVI file, you have to select compression settings. Select <b>Video|Encoder</b> from
69 the menu. The recommended compressor is MPEG-4 AVC (x264) or MPEG-4 ASP (Xvid4 or lavc).
70 YouTube recommends x264.
71 <div class="center"><img src="avidemux_codec.png"></div>
73 <li>The sound codec must also be selected in a similar way. Click <b>Audio|Encoder</b> from the menu,
74 and select MP3 (LAME) or maybe Vorbis.
76 <li>You are now ready to save the video. Click <b>File|Save|Save&nbsp;Video</b>, select a file name
77 and Avidemux will convert your replay in a short time.
78 </ul>
81 The default quality settings are usually suitable for GDash replays. The resulting AVI file
82 is smaller than 1 megabyte/minute. However if you need even smaller files, or you want better
83 quality, you can use the two Configure buttons below the video and the audio codec combo
84 boxes to fine-tune compression settings.
85 <br>
86 When you are finished, you can delete the WAV file and the images as they are not needed anymore.
91 <h2>Converting the files to an AVI with MPlayer</h2>
92 On Unix, you can also use the command line to create the video.
93 The easiest way to do that is using the mencoder utility, which is
94 part of the <a href="#links">MPlayer</a> package.
95 The command line is:
97 <div class="command">
98 <span class="param">mencoder mf://out_*.png -fps 25 -ovc x264 -x264encopts bitrate=512 -audiofile
99 out.wav -oac mp3lame -lameopts preset=64 -o out.avi</span>
100 </div>
102 The meaning of the parameters are:
103 <dl class="param">
104 <dt class="param">mf://out_*.png
105 <dd>The name of the image files.
106 <dt class="param">-fps 25
107 <dd>This tells mencoder, that 25 image files make up a second of video.
108 <dt class="param">-ovc x264
109 <dd>Use x264 compression for the video (most advanced and also recommended by YouTube).
110 <dt class="param">-x264encopts bitrate=512
111 <dd>Target bitrate of video, 1024kbits/second. Usually 512 is
112 enough, but you can increase, if you see that the video is of bad quality.
113 <dt class="param">-audiofile out.wav
114 <dd>Tells mencoder that the audio input data is to be read from that file.
115 <dt class="param">-oac mp3lame
116 <dd>Audio compression is mp3.
117 <dt class="param">-lameopts preset=64
118 <dd>Audio quality; 64kbit/s is more than enough as the sound is mono.
119 <dt class="param">-o out.avi
120 <dd>Output filename.
121 </dl>
122 As simple as that. Optionally, if your mencoder does not support x264 encoding, you can use
123 libavcodec mpeg4. The command line to be used is:
125 <div class="command">
126 <span class="param">mencoder mf://out_*.png -fps 25 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=512 -ffourcc DIVX
127 -audiofile out.wav -oac mp3lame -lameopts preset=64 -o out.avi</span>
128 </div>
130 I recommend using the <span class="param">-ffourcc DIVX</span> option to increase compatibility with media players
131 in this case.
133 <h2>Upload and share</h2>
134 Everybody is encouraged to do that! Upload your replay to <a href="#links">YouTube</a> so other BD fans
135 can view it.
137 <h2>Links</h2>
138 <a name="links">
139 <ul>
140 <li><a href="http://www.youtube.com/watch?v=wO6vNa3cZLo">Sample video</a> on YouTube.
141 <li><a href="http://fixounet.free.fr/avidemux/">Avidemux</a> - video converter application. No codecs needed.
142 <li><a href="http://www.videolan.org/vlc/">VLC media player</a> - the recommended player for AVI files. With builtin codecs.
143 <li><a href="http://mplayerhq.hu">MPlayer</a> and the mencoder utility.
144 </ul>
146 </p></body></html>