Convert avi with Handbrake for use with iPhone/iPod

Come up with a useful post-processing script? Share it here!
Post Reply
ProfDrLuigi
Newbie
Newbie
Posts: 5
Joined: December 20th, 2008, 5:24 am

Convert avi with Handbrake for use with iPhone/iPod

Post by ProfDrLuigi »

Code: Select all

#!/bin/bash

################## Change to Unpack-Path ##################
base=`basename "$1"`
cd "$1"
###########################################################

######## Pathes to the needed Binaries (change this)#######
handbrakecli="/opt/local/bin/HandBrakeCLI"
destination="/Volumes/Progs/iPod/Converts/"
###########################################################

################ Ignore upper and lowercase ###############
shopt -s nocaseglob
###########################################################

################## Scan every Sub-Folder ##################
find . -type d | while read VERZEICHNIS
    do
    cd "$VERZEICHNIS"
###########################################################

for a in *.{avi,mkv}; do
"$handbrakecli" -i "$a" -o "$destination""$a".mp4 --preset="iPhone & iPod Touch"
mv "$destination""$a".mp4 "$destination""${a/avi.mp4/.avi/}"
done

open -g -a /Applications/iTunes.app/ "$destination""$a".mp4 

cd -
done
This Script converts an AVI to iPhone/iPod and imports automatic to itunes.
Last edited by ProfDrLuigi on September 25th, 2010, 4:41 am, edited 1 time in total.
th3joker
Jr. Member
Jr. Member
Posts: 64
Joined: January 25th, 2008, 8:15 am

Re: Convert avi with Handbrake for use with iPhone/iPod

Post by th3joker »

posted in wrong thread sorry :-)
Last edited by th3joker on November 7th, 2010, 4:56 pm, edited 1 time in total.
Post Reply