Skip to content

Instantly share code, notes, and snippets.

@ryanfb ryanfb/handbrake-tv.sh Secret
Last active Feb 28, 2019

Embed
What would you like to do?
#!/bin/bash
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)
do
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
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.