Last active
April 20, 2017 04:55
-
-
Save cjwinchester/c7d01cf65fcc6b11fe38797b2dde797a to your computer and use it in GitHub Desktop.
yeah! we doin' this!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while [[ $# -gt 1 ]] | |
do | |
key="$1" | |
case $key in | |
-u|--url) | |
URL="$2" | |
shift | |
;; | |
-s|--starttime) | |
STARTTIME="$2" | |
shift | |
;; | |
-t|--time) | |
TIME="$2" | |
shift | |
;; | |
--default) | |
DEFAULT=YES | |
;; | |
*) | |
;; | |
esac | |
shift | |
done | |
if [ ! -f dl.mp4 ]; then | |
youtube-dl "${URL}" -o dl.mp4 | |
fi | |
ffmpeg -i dl.mp4 -ss "${STARTTIME}" -t "${TIME}" -async 1 cut.mp4 | |
ffmpeg -i cut.mp4 -vf scale=500:-1 -r 10 -f image2pipe -vcodec ppm - | convert -delay 7 -loop 0 -dither none -deconstruct -layers optimize -matte -depth 8 -background none -quantize transparent - holla.gif | |
rm cut.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment