Skip to content

Instantly share code, notes, and snippets.

@cogdog
Created November 28, 2017 07:13
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 cogdog/0012392cbcd9af4c62674742b269e20f to your computer and use it in GitHub Desktop.
Save cogdog/0012392cbcd9af4c62674742b269e20f to your computer and use it in GitHub Desktop.
A version of John Johnston's scripts to generate an mp4 from a flickr set (the latter is my mod)
#!/bin/bash
set -ex
# script to download pile of flickr images from a set and make a movie like the pummelvision service
# modified from https://gist.github.com/troutcolor/a6a82ceeb0dafc5f2c32edb09dfe11ac
# example https://www.youtube.com/watch?v=KOJC5Xco5NM
# needs ffmpeg
# needs sips so a mac John says
# Fill in the param any except the APIKEY can be empty
APIKEY='YOURKEY'
USERID='YOURID'
PHOTOSETID='PHOTOSETID'
searchurl="https://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key=${APIKEY}&user_id=${USERID}&photoset_id=${PHOTOSETID}&extras=url_l&format=rest"
FILELIST=$(curl "$searchurl" | sed -ne 's/.*\(http[^"]*\).*/\1/p')
a=`echo $FILELIST | wc -w`
for i in $FILELIST ; do
let a=a-1
new=$(printf "%04d.jpg" "$a")
curl -o $new $i
done;
sips --resampleHeight 768 *.jpg
sips --padToHeightWidth 786 1024 *.jpg
ffmpeg -f image2 -i %04d.jpg -c:v libx264 -pix_fmt yuv420p r5outyuv420p.mp4
ffmpeg -i r5outyuv420p.mp4 -filter:v "setpts=20.0*PTS" flickr.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment