Creating a queue file from scratch

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
Post Reply
smccloud
Posts: 3
Joined: Sat May 16, 2020 3:26 pm

Creating a queue file from scratch

Post by smccloud »

Description of problem or question:
I am in the process of shrinking a lot of files and also converting non-HEVC MKV containers to HEVC. I am decent at programming so right now I'm creating individual command line commands for each file I want to process. I am wondering if anyone knows if it is possible to create a queue file from scratch so I can use the GUI instead of the CLI version.
HandBrake version (e.g., 1.0.0):
1.3.0
Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.13 High Sierra, Windows 10 Creators Update):
Windows 10 Pro 1909 x64

If it isn't possible, I'll just keep using the CLI version.
Woodstock
Veteran User
Posts: 3790
Joined: Tue Aug 27, 2013 6:39 am

Re: Creating a queue file from scratch

Post by Woodstock »

Not impossible. Very irritating though, by hand.

Editing/creating scripts for the CLI is simpler than writing the JSON for a queue. Less playing around with balancing curly braces and properly placing colons and semicolons.

If you have a library that will output JSON from a list of parameters, that would help a lot.
smccloud
Posts: 3
Joined: Sat May 16, 2020 3:26 pm

Re: Creating a queue file from scratch

Post by smccloud »

I program in C#, so I can create a custom type to store everything in using a list and then use a NuGet package to serialize it to Json. I just need to know what is required in the Json file to include it. Right now I output the raw commands with a "&&" between them to chain them together in the Windows CLI.
User avatar
s55
HandBrake Team
Posts: 9829
Joined: Sun Dec 24, 2006 1:05 pm

Re: Creating a queue file from scratch

Post by s55 »

The Queue JSON is not a documented format as it's not expected to be user editable. It's also subject to change in any way without notice as a result so it's not advised to create json files yourself. There is limited error handling around it, so an invalid JSON will be hard to debug.

You can always reverse engineer the Windows UI code which is C# but you're pretty much on your own with this i'm afraid.
smccloud
Posts: 3
Joined: Sat May 16, 2020 3:26 pm

Re: Creating a queue file from scratch

Post by smccloud »

s55 wrote: Sat May 16, 2020 6:45 pm The Queue JSON is not a documented format as it's not expected to be user editable. It's also subject to change in any way without notice as a result so it's not advised to create json files yourself. There is limited error handling around it, so an invalid JSON will be hard to debug.

You can always reverse engineer the Windows UI code which is C# but you're pretty much on your own with this i'm afraid.
Given my simple use case I'd even be happy with the ability to provide a list of input files, corresponding output files & the preset I want to use. If that would be all I'd have to provide for the JSON file I'd be fine with that.
rollin_eng
Veteran User
Posts: 3558
Joined: Wed May 04, 2011 11:06 pm

Re: Creating a queue file from scratch

Post by rollin_eng »

The CLI can do that, that’s basically why it exists.
mduell
Veteran User
Posts: 7220
Joined: Sat Apr 21, 2007 8:54 pm

Re: Creating a queue file from scratch

Post by mduell »

Yea, just do a little shell scripting to wrap the CLI.
Post Reply