Skip to content

Instantly share code, notes, and snippets.

@jackmahoney

jackmahoney/convert.sh

Last active Aug 29, 2015
Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

@jackmahoney jackmahoney commented Jan 31, 2015

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.