Skip to content

Instantly share code, notes, and snippets.

@smartest
Created February 10, 2016 14:17
Show Gist options
  • Save smartest/f0f17fb6f4667659bc5a to your computer and use it in GitHub Desktop.
Save smartest/f0f17fb6f4667659bc5a to your computer and use it in GitHub Desktop.
DVD Ripping only large title sizes with HandBrakeCLI
#!/bin/bash
lsdvd . |sed -n 's/^Title\:\ \([[:digit:]]*\),\ Length\:\ \([[:digit:]]*\)\:\([[:digit:]]*\)\:.*/\1 \2 \3/p'|awk '$2*60+$3 >= 30 && $2*60+$3 < 50 {print "Title:" $1 " - " $2 " hr " $3 " mins"}'
title=($(lsdvd $1 |sed -n 's/^Title\:\ \([[:digit:]]*\),\ Length\:\ \([[:digit:]]*\)\:\([[:digit:]]*\)\:.*/\1 \2 \3/p'|awk '$2*60+$3 >= 30 && $2*60+$3 < 50 {print $1}'))
for i in "${title[@]}"
do
echo "Title: $i"
done
read -p "Titles listed above may be the appropriate episodes. Press [Enter] to start encoding."
for i in "${title[@]}"
do
HandBrakeCLI -i VIDEO_TS/ -o "$i.m4v" -s 1,5 -e x264 -q 22.0 -r 30 --pfr -a 1 -E ffaac -B 160 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 3.1 -t $i
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment