Created
April 19, 2019 16:18
-
-
Save sjwilliams/1f06cd93aa4c6236219c8a902fa6e2e1 to your computer and use it in GitHub Desktop.
Stack video frames onto a single image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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