Skip to content

Instantly share code, notes, and snippets.

@n0ts
Created May 28, 2010 11:22
Show Gist options
  • Save n0ts/417050 to your computer and use it in GitHub Desktop.
Save n0ts/417050 to your computer and use it in GitHub Desktop.
#!/bin/sh
RUBY=/usr/bin/ruby
HANDBRAKE=/Applications/HandBrakeCLI
FFMPEG=/opt/local/bin/ffmpeg
INPUT=/Volumes/FRIENDS
OUTPUT=/Users/n0ts/Desktop
SERIES=$1
START_EPISODE=$2
if [ -z $1 ]; then
echo "SERIES parameter is empty"
echo "Usage: `basename $0` <SERIES> <START_EPISODE>"
exit 0
fi
if [ -z $2 ]; then
echo "START_EPISODE parameter is empty"
echo "Usage: `basename $0` <SERIES> <START_EPISODE>"
exit 0
fi
INPUT=${INPUT}_YEAR_${SERIES}
episode=${START_EPISODE}
for i in 1 2 3 4;
do
$HANDBRAKE --preset "iPhone & iPod Touch" --chapters $i --subtitle 2 --subtitle-burn 2 --input $INPUT --output $OUTPUT/FRIENDS_${SERIES}-${episode}e.mp4
$HANDBRAKE --preset "iPhone & iPod Touch" --chapters $i --input $INPUT --output $OUTPUT/FRIENDS_${SERIES}-${episode}.mp4
$FFMPEG -i $OUTPUT/FRIENDS_${SERIES}-${episode}e.mp4 -ab 256 $OUTPUT/FRIENDS_${SERIES}-${episode}.mp3
$RUBY $HOME/bin/friends_update_mp3_tag.rb $OUTPUT/FRIENDS_${SERIES}-${episode}.mp3
episode=`expr $episode + 1`
done
echo
echo "done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment