Preparing XPilot videos for publication on YouTube etc.

Various tutorials
Post Reply
rotunda
Site Admin
Posts: 77
Joined: Wed Mar 24, 2010 2:19 pm

Preparing XPilot videos for publication on YouTube etc.

Post by rotunda »

To increase the popularity of XPilot, we need to publish more recordings on popular video services like YouTube or Google Video. But this is not so easy.

XPilot recordings use an own vector format. Any recording can be saved as a set of bitmaps (one per frame) and then put together into a video. If a lossless codec is used, the result will inevitably consume a lot of disk space. On the other hand, lossful codecs can significantly degrade the quality of vector pictures, especially text. All the most popular video services require input which is encoded with lossful codecs. That's why the goal of this thread is to come up with the best available way to encode single frames and then combine them.
rotunda
Site Admin
Posts: 77
Joined: Wed Mar 24, 2010 2:19 pm

Re: Preparing XPilot videos for publication on YouTube etc.

Post by rotunda »

A few simple things which can be done:
- make lines thicker, so that they are still visible clearly after encoding to a lossful format
- same about text - the font should offer thick letters
- apply anti-aliasing
rotunda
Site Admin
Posts: 77
Joined: Wed Mar 24, 2010 2:19 pm

Re: Preparing XPilot videos for publication on YouTube etc.

Post by rotunda »

As a side-note, one thing which has to be done before publishing an arbitrary XPilot recording is making sure whether it contains any sensitive data, e.g. in players' private messages. I'm adding a simple message filtering tool to the TODO list :-)
Angeba
Posts: 88
Joined: Sun Feb 06, 2011 11:23 pm

Re: Preparing XPilot videos for publication on YouTube etc.

Post by Angeba »

I have created a couple of animated GIFs recently. Here is how I do it.

Creating animated GIFs from a XPilot recording scene using `convert' from the ImageMagick package.

Save choosen frames as PPM files optionally compressed with gzip.
Do not use the `-compress' option of the replay program, because convert can not read *.ppm.Z (compressed) files.

Now run:
fps=12 # set the desired frame rate (probably that from the recording)
nice convert -loop 0 -delay 1x${fps} xp*.ppm.gz anim.gif

The `-loop 0' option states that the animation shall repeat forever.
After several cups of coffee it should have generated the animated gif file
`anim.gif'. It will contain all the previously saved frames (xp*.ppm.gz).
Try to view it in a web-browser. Or view it with ImageMagick's `animate'
program (the first loop is slow):
animate anim.gif
Or use `mplayer -loop 0 anim.gif'.

Another animated format is MNG, which works too, but playing it back
needs more processing power (about 4 times as gif here). I guess this
is because of a stronger compression algorithm. An anim.mng file is
a bit smaller (something like 30 percent less than gif).
Attachments
A small example GIF anim. Filesize about 800  KB.
A small example GIF anim. Filesize about 800 KB.
Butterfly-Robots_256x205_30sec_anim.gif (865.35 KiB) Viewed 3364 times
Angeba
Posts: 88
Joined: Sun Feb 06, 2011 11:23 pm

Re: Preparing XPilot videos for publication on YouTube etc.

Post by Angeba »

Other important things for GIF animations:

Use client settings suitable for a movie, for example:

export XPILOTRC=~/.xpilotrc; bloodspilot-client-x11 \
-join localhost -scalefactor 4 -speedzoommaxfact 2 -speedzoommaxspeed 100 -speedzoomaveragetime 2 -sparkprob 1 \
-linewidth 0 -showhitarea no -geometry 320x256+0+0 -hudScale 1 -hudRadarDotScale 1 -hudRadarScale 0.8 \
-gameFont '-*-fixed-*-r-*-*-7-*-*-*-*-*-*-*' -scorelistfont '-*-fixed-*-r-*-*-6-*-*-*-*-*-*-*' \
-messagefont '-*-fixed-*-r-*-*-6-*-*-*-*-*-*-*' -shotSize 14 -fuelnotify 99 -extHUDContents 'space space space \
space time packetSize loss drop fps netLag cLagMin cLagMax rBufStatus rBufEst space view power turnSpeed \
selfVel scaleFactor keys space playerStats' -maxfps 13

Especially use the `-geometry' option, to set the window size to that of the desired animation size.
This avoids the need to rescale the frames afterwards, which would always degrade the quality (very much).
While playing with such a low resolution setup, try to switch your X-server to a lower resolution.
This may be possible using CTRL-ALT-'+' and CTRL-ALT-'-' (several times), if the X-server is
configured to support these key combinations. Like that you can see/play better, because the
window will be magnified.


Note that the tools from the ImageMagick package (e.g. convert) consume very much memory. For an animation of several hundred frames, `convert' uses hundrets of MB of virtual memory (depending on frame dimensions).

I found another specialized tool `gifsicle' (from http://www.lcdf.org/~eddietwo/gifsicle/).
That is very lightweight, and also comes with a lightweight gif(anim) viewer (`gifview -a').
I only found that some animations it creates I could not play back with `mplayer'. That gave
some GIF-LIB error. So probably `convert' creates more portable anims.


Other hints:

Use a scene which starts with your ship on your base (reappeared), and which ends again with
your ship on your base (after a cash, or lost life). Even better end 1 frame before your
ship becomes visible again. Like that a looping animation doesn't jump when it restarts.
Post Reply