Skip to content
Snippets Groups Projects
Commit 70748381 authored by James's avatar James
Browse files

Fix preset detection

A preset file can contain more than one preset. As such, it's required
to specify the actual "PresetName" for the preset that needs to be used,
in addition to the actual *.json preset file.
parent 0598702b
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,12 @@
Use this rudimentary script to batch encode a folder of video files with HandbrakeCLI, using a custom preset.
#### Prerequisites
```
sudo dnf install jq HandBrake HandBrake-gui
```
#### How to use
1. Create a custom Handbrake preset.
......
......@@ -2,7 +2,8 @@
# Load an exported *.json Handbrake preset file
PRESET='--preset-import-file'
PRESETFILE='x265_10bit_crf23_slow_pt_audio_or_op192'
PRESETFILE='x265_10bit_crf23_slow_pt_audio_or_op192.json'
PRESETNAME=$(cat $PRESETFILE | jq '.PresetList[].PresetName' | cut -d'"' -f 2)
# Set the source directory as the current directory
SRC="."
......@@ -23,5 +24,5 @@ EXT='mkv'
IFS=$'\n'
for INPUTFILE in `find . -type f -execdir basename {} ';'`; do
OUTPUTFILE=${INPUTFILE%.*}
HandBrakeCLI "$PRESET" "$PRESETFILE" -i "$SRC"/"$INPUTFILE" -o "$DEST"/"$OUTPUTFILE""$OUTPUTSUFFIX"."$EXT"
HandBrakeCLI "$PRESET" "$PRESETFILE" -Z "$PRESETNAME" -i "$SRC"/"$INPUTFILE" -o "$DEST"/"$OUTPUTFILE""$OUTPUTSUFFIX"."$EXT"
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment