Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Stack video frames onto a single image
#!/bin/bash
# https://stackoverflow.com/questions/46145576/stack-multiple-images-in-semitransparent-layers-with-imagemagick
FRAMESDIR=frames
INPUTVIDEO=input.mp4
curl https://cdn.joshwilliams.com/projects/2019/videostack/input.mp4 -o $INPUTVIDEO
mkdir -p $FRAMESDIR
ffmpeg -i $INPUTVIDEO -vf scale=1280:-1 -r 5 $FRAMESDIR/%04d.png
LIST=$(find ./$FRAMESDIR -name "*.png" -print0 | xargs -0 echo)
convert $LIST -evaluate-sequence mean output.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.