Instantly share code, notes, and snippets.

Embed
What would you like to do?
Download & Slowdown a YouTube video using ffmpeg && youtube-dl
# 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
@saranrapjs

This comment has been minimized.

Owner

saranrapjs commented Nov 6, 2013

requires ffmpeg and youtube-dl, installable via HomeBrew on the Mac:

brew install ffmpeg
brew install youtube-dl

homebrew may require the Command Line Tools, which can be installed thusly:

xcode-select --install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment