Batch converting within sub-folders, Output to 1 seperate folder
Posted: Thu Aug 11, 2016 10:30 pm
After a while of using the queue in the gui I found this script for cli which searches and converts videos within sub folders and outputs to the source folders. Usage: handbrakefolder.sh /path/to/source/folder/
What I want it to do is to output to a common folder, I've tried a few things but I'm too unfamiliar with scripting to get it to work. Anyone?
Code: Select all
#!/bin/bash
#
# Change this to specify a different handbrake preset. You can list them by running: "HandBrakeCLI --preset-list"
#
PRESET="iPhone & iPod Touch"
if [ -z "$1" ] ; then
TRANSCODEDIR="."
else
TRANSCODEDIR="$1"
fi
find "$TRANSCODEDIR"/* -type f -exec bash -c 'HandBrakeCLI -i "$1" -o "${1%\.*}".mp4 --preset="$PRESET"' __ {} \;