Created
January 2, 2018 18:09
-
-
Save tonyb486/251250bf1ab8c19d08528fe75041ff31 to your computer and use it in GitHub Desktop.
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 | |
FILEA=$(mktemp).jpg | |
FILEB=$(mktemp).jpg | |
FRAMES=$(mktemp -d) | |
convert $1 $FILEA | |
for i in `seq -f "%03g" 1 100` | |
do | |
number=$RANDOM | |
let "number %= 500" | |
let "number += 200" | |
convert -quality 20 -scale $number $FILEA $FILEB | |
convert -quality 20 -scale 1000 $FILEB $FILEA | |
cp $FILEA $FRAMES/$1-frame$i.jpg | |
printf "." | |
done | |
ffmpeg -r 8 -f image2 -i $FRAMES/$1-frame%03d.jpg -vf scale=500:500 -vcodec libx264 -crf 25 -b:v 50k -maxrate 60k $1-jpegmovie.mp4 | |
cp $FILEA $1-jpegged.jpg | |
rm $FILEA $FILEB | |
rm -rf $FRAMES |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment