my handbrakecli "run on torrent finished" example

Linux specific questions, problems.
Post Reply
flynnstone
Newbie
Newbie
Posts: 1
Joined: Wed Nov 27, 2024 8:32 pm

my handbrakecli "run on torrent finished" example

Post by flynnstone »

sharing what I came up with to automatically run handbrakecli to encode downloads to my preferred 480p storage size:

1. download handbrakecli (https://handbrake.fr/downloads2.php)
2. qb, value in "run on torrent finished" field: /usr/bin/bash /home/username/Documents/HBCLI_aftercomplete.sh "%N" "%F" "%R" "%D"
3. content of HBCLI_aftercomplete.sh:

#!/bin/bash
set -m
strTorrentName=$1
strContentPath=$2
strRootPath=$3
strSavePath=$4
strOutputDir="/home/username/Documents"

# Loop through files in the target directory
for objFile in `find $strContentPath -type f -name "*.avi" -o -name "*.mp4" -o -name "*.mkv" -print0 | xargs -0 basename -a`;
do
/usr/bin/HandBrakeCLI -Z "Very Fast 480p30" -i "$strContentPath/$objFile" -o "$strOutputDir/$objFile"
done
done
User avatar
Peter
Administrator
Administrator
Posts: 3044
Joined: Wed Jul 07, 2010 6:14 pm

Re: my handbrakecli "run on torrent finished" example

Post by Peter »

Nice one!

I am not sure what you are encoding but I'd recommend looking into GPU encoding.
GPU HEVC (h265) or GPU AV1 encoding is really fast and its excellent quality.

I can usually encode with ~400-600 FPS with a very low end Nvidia card into HEVC and the resulting size is like 10-20% of the original.
Post Reply