Last active
December 27, 2015 15:09
-
-
Save saranrapjs/7345091 to your computer and use it in GitHub Desktop.
Download & Slowdown a YouTube video using ffmpeg && youtube-dl
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
# add this to yer .bash_profile ==> | |
function youtube_slower { | |
if [ ! -z $2 ]; then | |
tempo="$2" | |
else | |
tempo="0.8" | |
fi | |
base_filename="$(youtube-dl "$1" --get-filename)" | |
extensionless="${base_filename%.*}" | |
output_filename="$extensionless"".slowed.mp3"; | |
youtube-dl $1 -q -o - | ffmpeg -y -v quiet -i - -filter:a "atempo=$tempo" "$output_filename"; | |
echo "opening \"$output_filename\""; | |
if [ -f "$output_filename" ]; then | |
open "$output_filename"; | |
fi | |
} | |
# usage: | |
# youtube-slow "http://www.youtube.com/watch?v=drbnCPq5YHk" | |
alias youtube-slow=youtube_slower | |
function youtube_munch { | |
while read p; do | |
echo "munching $p..."; | |
youtube-slow "$p" | |
done < <(grep '' $1) | |
} | |
alias youtube-munch=youtube_munch | |
# usage: | |
# youtube-munch path-to-text-file-full-of-youtube-urls.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
requires ffmpeg and youtube-dl, installable via HomeBrew on the Mac:
homebrew may require the Command Line Tools, which can be installed thusly: