Free and Open Source real time strategy game with a new take on micro-management

Difference between revisions of "Video Creation Howto"

From Globulation2

Jump to: navigation, search
m (typo fox)
m (category:en)
 
(9 intermediate revisions by 5 users not shown)
Line 7: Line 7:
* First check that you do have enough space in your <code>GLOB2_DIR/videoshots</code>, where <code>GLOB2_DIR</code> is <code>~/.glob2</code> on Unix and installation directory on Windows. By enough space, I mean '''lot's of space'''. Each frame will be an uncompressed bmp file, so for 640x480 images you'll roughly need 1 MB per frame. There is 25 frames per second, so count 1.5 GB per minute of game.
* First check that you do have enough space in your <code>GLOB2_DIR/videoshots</code>, where <code>GLOB2_DIR</code> is <code>~/.glob2</code> on Unix and installation directory on Windows. By enough space, I mean '''lot's of space'''. Each frame will be an uncompressed bmp file, so for 640x480 images you'll roughly need 1 MB per frame. There is 25 frames per second, so count 1.5 GB per minute of game.
* <code>-r640x480</code> sets a low resolution, remember, the 1.5 GB per minute is only for 640x480 images, switch to 1280x1024 and you'll get around 6 GB per minute.
* <code>-r640x480</code> sets a low resolution, remember, the 1.5 GB per minute is only for 640x480 images, switch to 1280x1024 and you'll get around 6 GB per minute.
* <code>-G</code> disables OpenGL acceleration, as there seems to be a bug in SDL when exporting the framebuffer using GL.
* <code>-G</code> disables OpenGL acceleration, as there seems to be a bug in SDL when exporting the framebuffer using GL but test as with OpenGL it looks better and it works on some machines.


===2. Add website banner===
===2. Add website banner===
Line 25: Line 25:
Now that you have a serie of png, named <code>VIDEOSHOT_NAME.0000000000</code> to <code>VIDEOSHOT_NAME.XXXXXXXXXX</code> where <code>XXXXXXXXXX</code> is the number of frames minus 1 (all numbers begin from 0 don't they?), you can encode an ogg movie, suitable for wikimedia commons:
Now that you have a serie of png, named <code>VIDEOSHOT_NAME.0000000000</code> to <code>VIDEOSHOT_NAME.XXXXXXXXXX</code> where <code>XXXXXXXXXX</code> is the number of frames minus 1 (all numbers begin from 0 don't they?), you can encode an ogg movie, suitable for wikimedia commons:
ffmpeg2theora VIDEOSHOT_NAME.%10d.png -o VIDEOSHOT_NAME.ogg
ffmpeg2theora VIDEOSHOT_NAME.%10d.png -o VIDEOSHOT_NAME.ogg
or an mpeg/avi movie, suitable for youtube/your parent's DVD player:
or a mpeg movie, suitable for your parent's DVD player:
ffmpeg VIDEOSHOT_NAME.%10d.png -o VIDEOSHOT_NAME.mpeg
ffmpeg -i VIDEOSHOT_NAME.%10d.png VIDEOSHOT_NAME.mpeg
for better quality use:
ffmpeg VIDEOSHOT_NAME.%10d.png -o VIDEOSHOT_NAME.avi
ffmpeg -mbd rd -flags +trell -cmp 2 -subcmp 2 -g 100 -pass 1/2 -i VIDEOSHOT_NAME.%10d.png VIDEOSHOT_NAME.mpeg
or with mjpegtools:
png2yuv -f 25 -Ip -L0 -j VIDEOSHOT_NAME.%010d.png | mpeg2enc -f3 -b 2000 -q 1 -o VIDEOSHOT_NAME.m2v
( Play around with the options if you succeed. Especially the "-b n" option (bitrate). )

or a mpeg4 movie suitable for youtube (limited to 320x240 (-s), 10 minutes (-t 599)) :
ffmpeg -i VIDEOSHOT_NAME.%10d.png -vcodec mpeg4 -t 599 -s 320x240 -b 500 -aspect 4:3 VIDEOSHOT_NAME-320x240.avi


Also look at [http://ffmpeg.mplayerhq.hu/faq.html FFmpeg FAQ] for ffmpeg specific information.


Tools that can translate png to video:

* [http://www.v2v.cc/~j/ffmpeg2theora/ ffmpeg2theora],

* [http://ffmpeg.sourceforge.net/ ffmpeg],

* [http://mjpeg.sourceforge.net/ mjpegtools]

===Traps===
These tools failed on too big PNGs with a weird error. So try exactly the way described above with some 50 frames before giving up on modified versions!

===1-3 Alternative Procedure ===
Independent of glob2 you can try [http://recordmydesktop.sourceforge.net/ recordmydesktop] to record the whole desktop
as a video including sound but with lesser quality. Also the glob2 url will miss.

[[Category:en]]
[[Category:Contributor_Resources]]

Latest revision as of 15:49, 2 October 2009

It is rather straightforward to create videos from globulation 2 games, thanks to the videoshot feature.

1. Export videoshot from glob2

You first need to export the videoshot from glob2. To do this, run glob2 with the following flag:

glob2 -G -vs VIDEOSHOT_NAME -s640x480
  • First check that you do have enough space in your GLOB2_DIR/videoshots, where GLOB2_DIR is ~/.glob2 on Unix and installation directory on Windows. By enough space, I mean lot's of space. Each frame will be an uncompressed bmp file, so for 640x480 images you'll roughly need 1 MB per frame. There is 25 frames per second, so count 1.5 GB per minute of game.
  • -r640x480 sets a low resolution, remember, the 1.5 GB per minute is only for 640x480 images, switch to 1280x1024 and you'll get around 6 GB per minute.
  • -G disables OpenGL acceleration, as there seems to be a bug in SDL when exporting the framebuffer using GL but test as with OpenGL it looks better and it works on some machines.

2. Add website banner

A video showing glob2 without mentioning its web site is not very usefull. The trick here is to use imagemagick's tool mogrify to convert the raw bmp to png images with a text banner. To that end, you can use a simple perl script such as this one:

#!/usr/bin/perl
my @files = glob("*.bmp");
foreach $file (@files)
{
	print "Processing $file\n";
	system("mogrify -format png -pointsize 35 -fill white -draw 'text 40,450 \"http://www.globulation2.org\"' $file");
}

The script above works fine for 640x480 images and will convert every bmp in the current directory to png with the banner. Do not forget that the new pngs will use additional disk space that might be as high as half the size of the original bmp, so do not forget to get enough free space.

3. Encode the video

Now that you have a serie of png, named VIDEOSHOT_NAME.0000000000 to VIDEOSHOT_NAME.XXXXXXXXXX where XXXXXXXXXX is the number of frames minus 1 (all numbers begin from 0 don't they?), you can encode an ogg movie, suitable for wikimedia commons:

ffmpeg2theora VIDEOSHOT_NAME.%10d.png -o VIDEOSHOT_NAME.ogg

or a mpeg movie, suitable for your parent's DVD player:

ffmpeg -i VIDEOSHOT_NAME.%10d.png VIDEOSHOT_NAME.mpeg

for better quality use:

ffmpeg -mbd rd -flags +trell -cmp 2 -subcmp 2 -g 100 -pass 1/2 -i VIDEOSHOT_NAME.%10d.png VIDEOSHOT_NAME.mpeg

or with mjpegtools:

png2yuv -f 25 -Ip -L0 -j VIDEOSHOT_NAME.%010d.png | mpeg2enc -f3 -b 2000 -q 1 -o VIDEOSHOT_NAME.m2v

( Play around with the options if you succeed. Especially the "-b n" option (bitrate). )

or a mpeg4 movie suitable for youtube (limited to 320x240 (-s), 10 minutes (-t 599)) :

ffmpeg -i VIDEOSHOT_NAME.%10d.png -vcodec mpeg4 -t 599 -s 320x240 -b 500 -aspect 4:3  VIDEOSHOT_NAME-320x240.avi


Also look at FFmpeg FAQ for ffmpeg specific information.


Tools that can translate png to video:

Traps

These tools failed on too big PNGs with a weird error. So try exactly the way described above with some 50 frames before giving up on modified versions!

1-3 Alternative Procedure

Independent of glob2 you can try recordmydesktop to record the whole desktop as a video including sound but with lesser quality. Also the glob2 url will miss.

Misc