RimWorld: Create timelapse from Progress Renderer on Linux

0 min read (58 words)

Progress Renderer (Steam | GitHub) is a brilliant mod that takes a screenshot once a day, and dumps it into a folder.

The following bash script can be used to generate an mp4 timelapse of the screenshots. Simply specify a region to cut out of the screenshots, and some other parameters, and run the script in the working directory.

Progress Renderer (Steam | GitHub) is a brilliant mod that takes a screenshot once a day, and dumps it into a folder.

The following bash script can be used to generate an mp4 timelapse of the screenshots. Simply specify a region to cut out of the screenshots, and some other parameters, and run the script in the working directory.

#!/bin/bash

###########################

# Video resolution (must be even)
SIZE=2272x1472

# Video FPS
FPS=10

# Region to export
CROP=4544x2944+4064+3360

# Output file
OUT=~/Videos/rimworldvid.mp4

# TMP Location
TMP=/tmp/rimworldvid

###########################

echo "================= CONFIG ====================="
echo "Region: $CROP"
echo "Output: $OUT"
echo "Resolu: $SIZE @ $FPS fps"
echo "Tmp:    $TMP/"
echo "============================================="
echo ""

mkdir -p $TMP

for filename in *.jpg; do
    if [ ! -f "$TMP/$filename" ]; then
        echo "Cropping $filename"
        convert $filename -crop $CROP -resize $SIZE "$TMP/$filename" || exit $?
    fi
done || exit $?

echo "Rendering mp4"

cd $TMP
ffmpeg -framerate $FPS -pattern_type glob -i '*.jpg' "$OUT"