-
-
Save ryanfb/ee31af4bf611ff707d9b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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