Here's one showing the main mechanic of Life Eater:
I'm developing in GNU/Linux, and I use a setup that has never been mentioned on TIGForums (according to google). I thought I'd share my method with the community. Short version is:
recordmydesktop +
ffmpeg. This is a command line approach with some bash scripting. Takes time to setup, but boy does it pay off. Right now making a GIF for my game takes only two quick commands: one to record a video, the other to select a time interval and convert it to GIF. What follows is a step-by-step description of what I did. You can use this as a basis for your own setup.
1. Determine the cropping rectangle (optional)My game runs in a browser, it's not fullscreen. That means that I need to crop the game rectangle in all my screencasts. To find out where exactly the rectangle is on the screen, I compiled
xrectsel and ran it. Here's what I got after carefully selecting the game area on the screen:
dan@dan ~ $ xrectsel
640x480+1090+63
Well, that's almost what I got. What I actually got was more like "639x476+1089+63", so I had to tweak it a bit later. Anyway, now we can tell our scripts how exactly to crop the frames.
2. Make it super-easy to record gameplay videosI made a simple script
rec.sh to record gameplay videos. Here it is:
#!/bin/sh
recordmydesktop --no-cursor --no-sound --full-shots -x 1090 -y 63 -width 640 -height 480
You may want to substitute values from step 1 for
-x,
-y,
-width and
-height, or remove these options for fullscreen recordings. You may also want to get rid of
--no-cursor if mouse is important for your video. Of course,
recordmydesktop needs to be installed. As I understand, it is a standard tool that should be present in any popular linux distribution.
To record a video, I run
rec.sh and Alt-Tab to the game. When I'm done playing, I return to the console and stop the recording by
Ctrl+C. The result is a videofile named something like
out.ogv. It's already cropped. What is left is to extract the interesting time segment and convert it to GIF.
3. Making an animated GIFI convert
.ogv to
.gif using
ffmpeg. For that I also have a short script
mkgif.sh. I basically copied it from
this page:
#!/bin/bash
set -e
set -x
input=$1
starttime=$2
duration=$3
output=$4
filters="fps=30"
palette="/tmp/palette.png"
ffmpeg -v warning -ss $starttime -t $duration \
-i $input -vf "$filters,palettegen" -y $palette
ffmpeg -v warning -ss $starttime -t $duration \
-i $input -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $output
You may want to alter the
filters variable if you want to, say, scale the image to a lower resolution. Look
here for an example.
To make the final
.gif from an
.ogv file, I run something like this:
dan@dan ~ $ mkgif.sh out.ogv 3 5 out.gif
This creates
out.gif suitable to post in this thread
It shows the piece of the video that starts from time 00:03.00 in the .ogv file and lasts for 5 seconds (till 00:08.00). Instead of plain numbers like "3" and "5" you can write things like "1:15:28.30".
Of course, you need to have
ffmpeg installed for this to work.
4. Bonus: fast cropped screenshotsYou can also use this approach to easily make cropped screenshots (which you want if your game dosen't run fullscreen). Using the output of
xrectsel, I've made this simple script:
#!/bin/sh
file=/tmp/shot.png
scrot $file
convert $file -crop 640x480+1090+63 "/home/dan/shot-`date +%Y%m%d-%H%M-%s`.png"
rm $file
Of course, you'll have to replace
/home/dan with some real folder on your machine to which you have write access.
This relies on two standard programs:
scrot to make a screenshot and ImageMagick's
convert to crop the final image. I'm running this from the command line, but one can also assign the script to a global hotkey. You press one key, and your cropped image falls into a predefined folder. Very handy if you ask me.
ImageMagick is very powerful, so you can improve the script and manipulate the resulting image in some other way. Add your logo in the corner or something. Imagine doing that by hand for every screenshot!