Skip to content

Instantly share code, notes, and snippets.

@alexjj
Last active December 21, 2015 20:31
Show Gist options
  • Save alexjj/db0d9ea2350cb0b01fc1 to your computer and use it in GitHub Desktop.
Save alexjj/db0d9ea2350cb0b01fc1 to your computer and use it in GitHub Desktop.
HandbrakeCLI a folder
#!/bin/bash
#
# Change this to specify a different handbrake preset. You can list them by running: "HandBrakeCLI --preset-list"
#
PRESET="AppleTV 3"
if [ -z "$1" ] ; then
TRANSCODEDIR="."
else
TRANSCODEDIR="$1"
fi
find "$TRANSCODEDIR"/* -type f -name "*.mkv" -exec bash -c 'HandBrakeCLI -i "$1" -o "${1%\.*}".m4v -O --preset="$PRESET"' __ {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment