DVR Postprocessing script for Handbrake on Windows --- help? Examples?

I’ve found MCEBuddy to be a great partner to Plex for post processing. Depending on if you have either QuickSync or an NVidia card, hardware acceleration makes a huge difference in encode time - I convert everything to H265 (HEVC).

The Script I use is:

@echo off
C:\Progra~1\MCEBuddy2x\MCEBuddy.UserCLI.exe --command=engine --action=start 
timeout /t 2 /nobreak > NUL
C:\Progra~1\MCEBuddy2x\MCEBuddy.UserCLI.exe --command=addfile --action=%1
timeout /t 10 /nobreak > NUL
:loop
for /f "delims=" %%o in ('C:\Progra~1\MCEBuddy2x\MCEBuddy.UserCLI.exe --command=jobstatus --action=%1 --quiet') do set status=%%o
if %status% == "not present" (
	Exit
) else (
	timeout /t 2 /nobreak > NUL
	goto loop
)

I’ve also developed my own H265 profile that I use for the encoding task:

[MKV HVEC Profile Constant Quality]
Description=WARNING: Handbrake Constant Quality encoding (23) with Nvidia HVEC.
order=ffmpeg, handbrake
AllowH264CopyRemuxing=true
FixedResolution=true
AutoDeinterlace=true
ffmpeg-UsingHardwareEncoding=True
ffmpeg-general=-threads 0 -hwaccel auto
ffmpeg-video=-ss 9 -c:v hevc_nvenc -cq 23 -rc vbr -map 0:v
ffmpeg-audio=-acodec ac3 -ab 192k -map 0:a
ffmpeg-audioac3=-acodec ac3 -ab 384k -map 0:a
ffmpeg-ext=.mkv
ffmpeg-audiodelay=skip
handbrake-UsingHardwareEncoding=true
handbrake-general=--decomb --denoise="weak" --loose-anamorphic --verbose=2 -T -O
handbrake-video=--start-at duration:3 -e x265 -q 18 
handbrake-audio=-E ffac3 -R auto -B 192 -D 0 -a 1,2,3,4,5
handbrake-audioac3=-E ffac3 -R auto -B 384 -D 0 -a 1,2,3,4,5
handbrake-ext=.mkv
handbrake-audiodelay=skip
PreConversionCommercialRemover=true

Be sure to check that the FFMpeg version is 3.0 or greater - that has the NVidia encoding included. You can replace the ffmpeg.exe with the latest version from ffmpeg.org (looks like the latest is up to v4.1).

In my experience, there’s no advantage to holding onto the original .TS file - the commercials have already been taken out (if you’re doing that), and the file is just huge. MCEBuddy has an option to automatically delete the original, following a successful conversion.

Hope it helps.