Skip to content

Instantly share code, notes, and snippets.

@jackmahoney
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jackmahoney/02c9890e610b313a52bb to your computer and use it in GitHub Desktop.
Save jackmahoney/02c9890e610b313a52bb to your computer and use it in GitHub Desktop.
EyeEm in motion
#!/bin/bash
#script takes a video and converts it to frames
#it then slices the frames and uploads them to an eyeem album
#when you scroll the album fast enough it turns back into a video
output_dir=./output/
#convert video to frames, dump in output dir
ffmpeg -i $1 "$output_dir"image-%d.jpg
#slice and filter frames
for f in "$output_dir"*
do
#convert image to grayscale
convert "$f" -colorspace Gray "$f"
#cut image into thirds because eyeem grid
#uses three columns
convert -crop 33%x100% "$f" "$f"
#remove the left over 1%
rm "$output_dir"*-3.jpg
#remove original
rm "$f"
done
#upload images using (secret) upload script
#can't share this as it uses a private API
ruby upload.rb "$output_dir" jackinmotion
@jackmahoney
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment