Created
February 6, 2025 00:28
-
-
Save bmitchinson/8c3fcdc5909b1e968a9f71996d939c3f to your computer and use it in GitHub Desktop.
Handbreak CLI command to export all titles
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 | |
set -e | |
if [ "$#" -ne 2 ]; then | |
echo "Usage: $0 example_file.iso destination_folder" | |
exit 1 | |
fi | |
src="$1" | |
dest="$2" | |
mkdir -p "$dest" | |
for t in $(~/bin/HandBrakeCLI -i $src -t 0 2>&1 | grep -o 'title [0-9]\+' | awk '{print $2}' | sort -u); do | |
echo "exporting title ${t} to $dest/title_${t}.mp4" | |
~/bin/HandBrakeCLI -i $src -t $t -o "$dest/title_${t}.mp4" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment