Skip to content

Instantly share code, notes, and snippets.

@lxe
Created April 9, 2020 19:32
Show Gist options
  • Save lxe/34c579de31ce166bb40c489d4057f54a to your computer and use it in GitHub Desktop.
Save lxe/34c579de31ce166bb40c489d4057f54a to your computer and use it in GitHub Desktop.
goestilevideo.sh
#!/bin/bash
# Usage: ./goestiles ~/goes17 2020-04-02
# Makes a video like this: https://twitter.com/lxe/status/1248117991067095040
# Requirements: imagemagick and ffmpeg
ROOT=$1
DATE=$2
# Clean up
rm -rf timed
# Get timestamps
ls -lart $ROOT/fd/ch08/$DATE | grep -oE '\d+T\d+Z' | while read timestamp; do
# Copy all the full disk images at the same time into a directory
mkdir -p ./timed/${timestamp}/small
cp -rf $(find $ROOT/fd -type f -name '*'${timestamp}'*' | xargs) ./timed/${timestamp}
# Resize images and create tiles
mogrify -resize 480x480 -quality 100 -path ./timed/${timestamp}/small ./timed/${timestamp}/*.jpg
montage ./timed/${timestamp}/small/* -geometry +0+0 `pwd`/${timestamp}_COMBINED.jpg
done
# Combine all the tiled images into a video
ffmpeg -framerate 8 -pattern_type glob -i './*_COMBINED.jpg' -c:v libx264 -r 30 -pix_fmt yuv420p ${DATE}_video.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment