How do you use presets from the command line?

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
wealthychef
New User
Posts: 3
Joined: Thu Jun 01, 2023 7:18 am

How do you use presets from the command line?

Post by wealthychef »

Description of problem or question:
Hello, I have a preset I always use with the HandBrake GUI. I like "General/

Here is what happens when I try to use it. I am sure this is just me not knowing what I'm doing...
there is no log created in "Library/Containers/fr.handbrake.HandBrake/Data/Library/Application Support/HandBrake/EncodeLogs/" for this, so it doesn't even start encoding.
My question is, how do I use presets correctly? Are there any examples out there for HandBrakeCLI presets usage? Thanks for any help!


```
HandBrakeCLI --encoder-preset "General/Fast 720p30" -i "Mayans.mkv" -o "Mayans.m4v"
blah blah...
[14:13:09] Starting Task: Encoding Pass
[14:13:09] Skipping vfr filter
blah blah...
[14:13:09] sync: expecting 98150 video frames
x264 [error]: invalid preset 'General/Fast 720p30'
ERROR: Failure to initialise thread 'H.264/AVC encoder (libx264)'
[14:13:09] aac-decoder done: 0 frames, 0 decoder errors
[14:13:09] h264-decoder done: 0 frames, 0 decoder errors
[14:13:09] sync: got 0 frames, 98150 expected
[14:13:10] Finished work at: Thu Jun 1 14:13:10 2023

[14:13:10] libhb: work result = 3

Encode failed (error 3).

HandBrake has exited.
```


HandBrake version (e.g., 1.0.0):

HandBrake 1.6.1



Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.13 High Sierra, Windows 10 Creators Update):




HandBrake Activity Log ***required*** (see How-to get an activity log)

Code: Select all

Please replace this text with the contents of your log file between the two code tags - OR -  provide a pastebin URL in place of these 3 lines.
If you are unable to do so, please state why so we can help you.
Deleted User 11865

Re: How do you use presets from the command line?

Post by Deleted User 11865 »

GUI presets are organized in folders for practical purposes, but all have distinct names; you should just use the preset name (e.g. "Fast 720p30").
wealthychef
New User
Posts: 3
Joined: Thu Jun 01, 2023 7:18 am

Re: How do you use presets from the command line?

Post by wealthychef »

Rodeo wrote: Thu Jun 01, 2023 8:29 am GUI presets are organized in folders for practical purposes, but all have distinct names; you should just use the preset name (e.g. "Fast 720p30").
Thanks for the reply. I get the same error with
```
HandBrakeCLI --encoder-preset "Fast 720p30" -i "Mayans.mkv" -o "Mayans.m4v"
blah blah ...
[11:37:20] sync: expecting 98150 video frames
x264 [error]: invalid preset 'Fast 720p30'
ERROR: Failure to initialise thread 'H.264/AVC encoder (libx264)'

```
Deleted User 11865

Re: How do you use presets from the command line?

Post by Deleted User 11865 »

Oh, I missed that. You're trying to use a HandBrake preset, so it's --preset that you want to use. --encoder-preset is for the video encoder specifically (e.g. for x264, ultrafast to placebo). The HandBrake preset already sets the encoder preset automatically though.
wealthychef
New User
Posts: 3
Joined: Thu Jun 01, 2023 7:18 am

Re: How do you use presets from the command line?

Post by wealthychef »

That did it! Thanks.
Post Reply