Skip to content

Instantly share code, notes, and snippets.

Last active Feb 28, 2019
What would you like to do?
rawout=$(HandBrakeCLI -i /dev/cd0 -t 0 2>&1 >/dev/null)
#read handbrake's stderr into variable
count=$(echo $rawout | grep -Eao "\\+ title [0-9]+:" | wc -l)
#parse the variable using grep to get the count
for i in $(seq $count)
HandBrakeCLI --input /dev/cd0 --title $i --output $1-$i.mkv -e x265 -q 23 --encoder-preset slow -E av_aac --custom-anamorphic --keep-display-aspect -O -Neng -sscan --decomb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment