I have a script for converting Handbrake videos, but I want to make presets. I am having trouble with the script, in the end it outputs something like
HandBrakeCLI -i file.avi -o file.mp4 flags
But I can't get the flags part to work, so to troubleshoot I want to see what the command line is receiving as a translation of my script.
Here is the link to my working script
How to Install Handbrake and Convert recursive file tree's
Here is what I would like it to look like
Only the changes are shown
FLAGS="-E ac3 -6 5point1 -R 48 -B 448 --audio-fallback ac3"
if [ -z "$1" ] ; then
TRANSCODEDIR="."
else
TRANSCODEDIR="$1"
fi
find "$TRANSCODEDIR"/* -type f -exec bash -c 'HandBrakeCLI -i "$1" -o "${1%\.*}".mp4 "$FLAGS"' __ {} \;
Basically the $Flags option isnt working, and as I mess around it either doesn't find the file, or does and doesn't see the flags, help with the script is fine, but for future debugging of other scripts i wouldnt mind knowing how to just output the commands it "would" have sent to the shell instead just to the screen or a text file probably is better.
Thanks!