Skip to content

Instantly share code, notes, and snippets.

@lukeorland
Created November 16, 2011 22:46
Show Gist options
  • Save lukeorland/1371744 to your computer and use it in GitHub Desktop.
Save lukeorland/1371744 to your computer and use it in GitHub Desktop.
bash script for using HandBrakeCLI to rip a DVD on a Mac and compress it to H.264 m4v. requires a specific version of the HandBrakeCLI dmg in a specific location.
#!/usr/bin/env bash
set -x
HANDBRAKECLI_DMG="/Volumes/CLSP-500GB/handbrakeCLI/HandBrake-0.9.5-MacOSX.5_CLI_x86_64.dmg"
HANDBRAKECLI="/Volumes/HandBrake-0.9.5-MacOSX.5_CLI_x86_64/HandBrakeCLI"
open $HANDBRAKECLI_DMG
sleep 4s
DVD="$1"
DEST="$2"
$HANDBRAKECLI -i "$DVD" -o "$DEST" -e x264 -q 20.0 -a 1,1 -E faac,copy:ac3 -B 160,160 -6 dpl2,auto -R Auto,Auto -D 0.0,0.0 -f mp4 --detelecine --decomb --loose-anamorphic -m -x b-adapt=2:rc-lookahead=50 2> rip_error.log
drutil eject
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment