Page 1 of 1

Creating a queue file from scratch

Posted: Sat May 16, 2020 3:30 pm
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.

Re: Creating a queue file from scratch

Posted: Sat May 16, 2020 4:25 pm
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.

Re: Creating a queue file from scratch

Posted: Sat May 16, 2020 5:58 pm
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.

Re: Creating a queue file from scratch

Posted: Sat May 16, 2020 6:45 pm
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.

Re: Creating a queue file from scratch

Posted: Sat May 16, 2020 8:01 pm
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.

Re: Creating a queue file from scratch

Posted: Sat May 16, 2020 8:16 pm
by rollin_eng
The CLI can do that, that’s basically why it exists.

Re: Creating a queue file from scratch

Posted: Mon May 18, 2020 5:48 pm
by mduell
Yea, just do a little shell scripting to wrap the CLI.