Skip to content

Instantly share code, notes, and snippets.

@skyzyx
Forked from colinbendell/convert_giphy_gifs.sh
Created August 24, 2018 00:22
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 skyzyx/16bccd5de20fcccd3ac564e0b72ed7a7 to your computer and use it in GitHub Desktop.
Save skyzyx/16bccd5de20fcccd3ac564e0b72ed7a7 to your computer and use it in GitHub Desktop.
Simple mass conversion of GIF to MP4 (h264/h265), WebM (vp8/vp9) and WebP
#!/bin/sh
curl 'https://giphy.com/page/2?next=2017-12-01%2004%3A15%3A01&amp%3Bis=1&is=1&json=true' -o gipyurls.json
jq .[].gifs[].images.original.url gipyurls.json |cut -d / -f 5 | parallel -j 20 --gnu curl https://media2.giphy.com/media/{}/giphy.gif -o {}.gif
parallel -j 20 --gnu "ffmpeg -f gif -i {} {}.h264.mp4" ::: *.gif
parallel -j 20 --gnu "ffmpeg -f gif -i {} -c:v libx265 {}.h265.mp4" ::: *.gif
parallel -j 20 --gnu "ffmpeg -f gif -i {} -c:v libvpx {}.vp8.webm" ::: *.gif
parallel -j 20 --gnu "ffmpeg -f gif -i {} -c:v libvpx-vp9 {}.vp9.webm" ::: *.gif
parallel -j 20 --gnu "ffmpeg -f gif ii {} -vcodec libwebp {}.webp" ::: *.gif
ls -la|sed -Ee 's/[ ]+/,/g'|cut -d , -f 9,5|sed -e 's/\.gif/,gif/;s/gif\.//' > files.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment