Custom presets between the GUI and the CLI

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
mackworth2
Posts: 5
Joined: Sun Sep 25, 2016 7:03 am

Custom presets between the GUI and the CLI

Post by mackworth2 »

If I create a custom preset in the GUI, should it be automatically available in the CLI? If not, is there a defined path to transfer it? I see "--preset-import-gui", but that doesn't seem to work, nor does "--preset-import-file" on a file I exported from the GUI. (see below)

As a follow-on, if the CLI does import it, will it get included in the "--preset-list"?

Tell us about your environment. What version of HandBrake? What operating system are you running. etc.
Mac Sierra 10.12.1 HandBrake 20161031174008-77d09e9-master

Code: Select all

Log:
Hughs-MacBook-Pro:bin hugh$ ./handbrakecli --preset-import-gui
[10:06:41] hb_init: starting libhb thread
[10:06:41] thread 70000e8e9000 started ("libhb")
Missing input device. Run ./handbrakecli --help for syntax.

Hughs-MacBook-Pro:bin hugh$ ./handbrakecli --preset-import-file /Users/hugh/Desktop/testy2.json 
[10:07:29] hb_init: starting libhb thread
[10:07:29] thread 700005fb6000 started ("libhb")
Missing input device. Run ./handbrakecli --help for syntax.

Hughs-MacBook-Pro:bin hugh$ ./handbrakecli --version
[10:09:10] hb_init: starting libhb thread
[10:09:10] thread 7000016cd000 started ("libhb")
HandBrake 20161031174008-77d09e9-master
 
mduell
Veteran User
Posts: 8198
Joined: Sat Apr 21, 2007 8:54 pm

Re: Custom presets between the GUI and the CLI

Post by mduell »

No.
Deleted User 11865

Re: Custom presets between the GUI and the CLI

Post by Deleted User 11865 »

mduell wrote:No.
Except, with the current CLI you should be able to use GUI presets. Not sure exactly how it works, but someone can probably chime in :P
Deleted User 11865

Re: Custom presets between the GUI and the CLI

Post by Deleted User 11865 »

Check available presets:

Code: Select all

HandBrakeCLI --preset-import-gui --preset-list
Use a preset:

Code: Select all

HandBrakeCLI -i <input_file> -o <output_file> --preset-import-gui --preset <preset_name>
mackworth2
Posts: 5
Joined: Sun Sep 25, 2016 7:03 am

Re: Custom presets between the GUI and the CLI

Post by mackworth2 »

Both of those worked great! Thank you very much.

So now, I'm curious, given that all the work's clearly been done, why not just automatically include the custom presets in the CLI, rather than require the option? It's so nice to be able to edit the preset in the GUI, but then use it from the CLI.
nowhere99
Posts: 2
Joined: Sun Nov 27, 2016 7:52 pm

Re: Custom presets between the GUI and the CLI

Post by nowhere99 »

Hi All,

I'm using 0.10.5 from the stebbins releases ppa on Ubuntu 16.10 and the --preset-import-gui ain't workin...

Code: Select all

:~$ HandBrakeCLI --version
HandBrake 0.10.5

Code: Select all

:~$ HandBrakeCLI --preset-import-gui --preset-list
HandBrakeCLI: unrecognized option '--preset-import-gui'
unknown option (--preset-import-gui)
Did it not make it into the linux version? Is stebbins behind? Thanks!
User avatar
s55
HandBrake Team
Posts: 10357
Joined: Sun Dec 24, 2006 1:05 pm

Re: Custom presets between the GUI and the CLI

Post by s55 »

0.10.5 doesn't support it. Only the nightly builds do.
nowhere99
Posts: 2
Joined: Sun Nov 27, 2016 7:52 pm

Re: Custom presets between the GUI and the CLI

Post by nowhere99 »

Ah got it. I had tried the git-snapshots ppa but for some reason it didn't update to the snapshot version. I purged both ppa then re-added just snapshots and it's golden. Thanks!
NoobNoob
New User
Posts: 1
Joined: Tue Jan 03, 2017 4:08 pm

Re: Custom presets between the GUI and the CLI

Post by NoobNoob »

It seems several of us have struggled with the same problem, which I think can be summarized as follows:
how can we use the GUI (and possibly existing presets) to help us generate a config file we could then use with the CLI (vs having to understand all CLI options)?

I might be missing something but it seems to me that the easiest way to do this is:
  • in the GUI:
  • pick a preset you like as a starting point
  • tweak it to your liking
  • save it and then export it to JSON (ex: mydefaultpreset.json)
  • invoke the CLI as follows:

    Code: Select all

    /Applications/Video/HandBrakeCLI --input "movie.avi" --output "movie.mp4" --preset-import-file "mydefaultpreset.json" --preset "mydefaultpreset"
Hard to explain why it took me so long to figure this out - a few parameter names such as "preset-import-gui" (import where?) did throw me off.
Nonaligned
Posts: 1
Joined: Thu Mar 09, 2017 7:19 pm

Re: Custom presets between the GUI and the CLI

Post by Nonaligned »

Was there a change recently that requires a preset string to have a path or something? I'm testing bash scripts that use --preset "Name of Preset In GUI" and I only get an error
HandBrake 1.0.3 (2017022500) - Darwin x86_64 - https://handbrake.fr
4 CPUs detected
Invalid preset
Valid presets are:
General/
Very Fast 1080p30
Small H.264 video (up to 1080p30) and AAC stereo audio, in
an MP4 container.
Very Fast 720p30
Small H.264 video (up to 720p30) and AAC stereo audio, in an
MP4 container.
Very Fast 576p25[/size]
etc...
nhyone
Bright Spark User
Posts: 252
Joined: Fri Jul 24, 2015 4:13 am

Re: Custom presets between the GUI and the CLI

Post by nhyone »

I find that presets don't save all the options, or perhaps I'm doing it wrongly -- I'm using the CLI to "convert" command-line parameters to the preset.

The CLI allows importing GUI jobs using --queue-import-file. Is it possible for the CLI to export a job as well? This has all the info that is specific to that job. The only way to get it from the CLI now is to copy it from log file.
Post Reply