Created
October 24, 2022 14:13
-
-
Save geerlingguy/b21cc38430d06d39df82b0ab4f6c7d00 to your computer and use it in GitHub Desktop.
Handbrake CLI batch transcoding script
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 | |
# | |
# This script requires HandBrakeCLI. On macOS, at least, you need to download | |
# and install it separately from Handbrake. | |
# | |
# See: https://handbrake.fr/downloads2.php | |
if [ -z "$1" ] ; then | |
TRANSCODEDIR="." | |
else | |
TRANSCODEDIR="$1" | |
fi | |
# Change the preset if you like (see options: "HandBrakeCLI --preset-list") | |
# If you want to transcode ALL movie files, remove the -name option. | |
find "$TRANSCODEDIR"/* -type f -name "*.mkv" -exec bash -c 'HandBrakeCLI -i "$1" -o "${1%\.*}".mp4 --preset="General/HQ 1080p30 Surround"' __ {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment