Using HandbrakeCLI and Scripts

Discussion of the HandBrake command line interface (CLI)
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
DeltaDc12
Posts: 6
Joined: Mon Jun 06, 2011 10:25 pm

Using HandbrakeCLI and Scripts

Post by DeltaDc12 » Mon Feb 25, 2019 2:04 am

HandBrake-1.2.2-x86_64-Win_GUI
HandBrakeCLI-1.2.2-win-x86_64
Windows 10 Pro

I'm trying to use a GUI exported custom preset "720p HD Subs.json" with HBCLI and a Script to process my HDHomeRun recorded Tv shows recorded by Plex.

Here's my script I'm trying to test.

"C:\Program Files\Handbrake\HandBrakeCLI.exe" -v -i "%%G" -o "%%~dG%%~pG%%~nG.mkv" --preset-import-file "D:\Plex\720p HD Subs.json" -Z "720p HD Subs"

Full script Below:
https://pastebin.com/pe0m2GJM

-------------------------------
Here's my 720p HD Subs.jason

https://pastebin.com/1eY0vziz
-----------------------------------------------
Here is the error I get when running the CLI for a test with custom preset I created.

"C:\Program Files\Handbrake\HandBrakeCLI.exe" -v -i "D:\Temp\Premier League Soccer (2011) - 2019-02-23 11 30 00 - Leicester City FC vs. Crystal Palace FC.ts" -o "D:\Temp\Premier League Soccer (2011) - 2019-02-23 11 30 00 - Leicester City FC vs. Crystal Palace FC.mkv" --preset-import-file "D:\Plex\720p HD Subs.json" -Z "720p HD Subs"

[19:43:08] hb_parse_filter_settings: Error parsing (0:0)
ERROR: Preset (null): Incorrect value type for key AudioDitherMethod. Converting.
ERROR: Invalid rotate filter settings (0:0)
Failed to initialize job

HandBrake has exited.

Full run in link below:
https://pastebin.com/Xfpwv2La
-------------------------------------------------------

I've been trying to work on this for a few days and haven't had any luck figuring out what's causing the error. HanbrakeCLI and script seem to be pulling in the correct .ts file and executing the "720p HD Subs" and fails. Any help or suggestions would be great. If you need anything else, Please let me know.






https://pastebin.com/tQPTWkPQ

User avatar
JohnAStebbins
HandBrake Team
Posts: 5315
Joined: Sat Feb 09, 2008 7:21 pm

Re: Using HandbrakeCLI and Scripts

Post by JohnAStebbins » Mon Feb 25, 2019 4:29 pm

Did you use the current 1.2.2 GUI to generate the preset? If so, it looks like there are a couple of bugs in it's preset export. It is failing to export AudioDitherMethod. This is ok since it's just falling back to the default, but if you want to silence the warning, add

Code: Select all

                "AudioDitherMethod": "auto",
to your audio settings in the preset file.

The other bug causes the failure to initialize. The format of the rotate filter settings is incorrect. Should be

Code: Select all

        "PictureRotate": "angle=0:hflip=0",
If you have a github account or would like to create one, this would be a good one to add to our issues list
https://github.com/HandBrake/HandBrake/issues

DeltaDc12
Posts: 6
Joined: Mon Jun 06, 2011 10:25 pm

Re: Using HandbrakeCLI and Scripts

Post by DeltaDc12 » Tue Feb 26, 2019 1:04 am

Thanks, I'll give that a try. Before I posted, I had deleted my preset and uninstalled Hb. Reinstalled and made a new export. Still didn't have any luck. I will let you know shortly.

Dc

Update: It WORKED.. Thank you very much!! The only errors were:

Encoding: task 1 of 1, 0.04 %[19:17:57] sync: first pts subtitle 0x0 is 24423
Encoding: task 1 of 1, 26.96 % (53.50 fps, avg 53.64 fps, ETA 00h02m32s)[ac3 @ 0000000006087040] expacc 125 is out-of-range
[ac3 @ 0000000006087040] error decoding the audio block
[ac3 @ 000000000410eb40] expacc 125 is out-of-range
[ac3 @ 000000000410eb40] error decoding the audio block

It's about half the size and looks great!! 5.1

I would have never found that.
Again, Thanks.

Post Reply