Skip to content

Instantly share code, notes, and snippets.

@n0ts
Created March 13, 2010 02:02
Show Gist options
  • Save n0ts/331035 to your computer and use it in GitHub Desktop.
Save n0ts/331035 to your computer and use it in GitHub Desktop.
#!/bin/sh
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
episode=$START_EPISODE
for i in 1 2 3 4;
do
$HANDBRAKE --preset "iPhone & iPod Touch" --chapters $i --subtitle 1 --subtitle-burn 1 --input $INPUT --output $OUTPUT/FRIENDS_${SERIES}-${episode}e.mp4
$HANDBRAKE --preset "iPhone & iPod Touch" --chapters $i --input $INPUT --output $OUTPUT/FRIENDS_${SERIES}-${episode}.mp4
echo $FFMPEG -i $OUTPUT/FRIENDS_${SERIES}-${episode}e.mp4 -ab 256 $OUTPUT/FRIENDS_${SERIES}-${episode}.mp3
echo /opt/local/bin/ruby $HOME/bin/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