Skip to content

Instantly share code, notes, and snippets.

@Teemu
Created June 18, 2016 16:09
Show Gist options
  • Save Teemu/0510ba2fb49bc83a5cab571cebd15f51 to your computer and use it in GitHub Desktop.
Save Teemu/0510ba2fb49bc83a5cab571cebd15f51 to your computer and use it in GitHub Desktop.
for FILE in *.mp4
do
echo $FILE
rm output.jpg
rm output.gif
ffmpeg -ss 30 -i $FILE -vf "select=gt(scene\,0.4)" -frames:v 1 -vsync vfr -vf fps=fps=1/60 out%02d.jpg
convert output.jpg -resize 900x900 ${FILE}.jpg
#rm palette.png
#ffmpeg -ss 20 -y -t 20 -i $FILE -vf fps=1,scale=640:-1:flags=lanczos,palettegen palette.png
#ffmpeg -ss 20 -t 20 -i $FILE -i palette.png -filter_complex "fps=1,scale=640:-1:flags=lanczos[x];[x][1:v]paletteuse" output.gif
#convert -delay 10x100 output.gif output2.gif
#rm output.gif
#mv output2.gif ${FILE}.gif
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment