Handbrake-CLI - Invalid preset

HandBrake for Windows support
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
Son_Of_Diablo
Posts: 9
Joined: Tue Apr 23, 2019 10:34 am

Handbrake-CLI - Invalid preset

Post by Son_Of_Diablo »

Description of problem or question:
Handbrake-CLI throws an "Invalid preset" error when I'm trying to use the "H.265 MKV 1080p30" preset.
I have been able to do this for a few months now, but suddenly it stopped working.

Here is a snippit of the preset list (-z):

Code: Select all

Matroska/
        H.265 MKV 2160p60
            H.265 video (up to 2160p60) and AAC stereo audio, in an MKV
            container.
        H.265 MKV 1080p30
            H.265 video (up to 1080p30) and AAC stereo audio, in an MKV
            container.
        H.265 MKV 720p30
            H.265 video (up to 720p30) and AAC stereo audio, in an MKV
            container.
as you can see the preset I want to use is in the list.


Steps to reproduce the problem (If Applicable):
Run:

Code: Select all

&"path\to\HandBrakeCLI.exe" -i "path\to\file" -o "path\to\out\file" --preset="H.265 MKV 1080p30" --crop 0:0:0:0


HandBrake version (e.g., 1.0.0):
HandBrake 1.3.2 (2020050300) - MinGW x86_64



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



HandBrake Activity Log:

https://pastebin.com/YM1nhLLn
Woodstock
Veteran User
Posts: 4614
Joined: Tue Aug 27, 2013 6:39 am

Re: Handbrake-CLI - Invalid preset

Post by Woodstock »

You didn't tell the CLI to load your presets, just to chose one of them.
Son_Of_Diablo
Posts: 9
Joined: Tue Apr 23, 2019 10:34 am

Re: Handbrake-CLI - Invalid preset

Post by Son_Of_Diablo »

Woodstock wrote: Mon May 04, 2020 1:34 pm You didn't tell the CLI to load your presets, just to chose one of them.
What do you mean?

Could you give me an example?
Woodstock
Veteran User
Posts: 4614
Joined: Tue Aug 27, 2013 6:39 am

Re: Handbrake-CLI - Invalid preset

Post by Woodstock »

Code: Select all

   --preset-import-file <filespec>
                           Import presets from a json preset file.
                           'filespec' may be a list of files separated
                           by spaces, or it may use shell wildcards.
   --preset-import-gui     Import presets from GUI config preset file.
The second one will load the presets you have defined in your GUI configuration, so you can then chose one of them.
Son_Of_Diablo
Posts: 9
Joined: Tue Apr 23, 2019 10:34 am

Re: Handbrake-CLI - Invalid preset

Post by Son_Of_Diablo »

Woodstock wrote: Mon May 04, 2020 2:07 pm

Code: Select all

   --preset-import-file <filespec>
                           Import presets from a json preset file.
                           'filespec' may be a list of files separated
                           by spaces, or it may use shell wildcards.
   --preset-import-gui     Import presets from GUI config preset file.
The second one will load the presets you have defined in your GUI configuration, so you can then chose one of them.
But I'm trying to use the build-in preset, not a custom preset.
btw when I try with --preset-import-gui I get this:
https://pastebin.com/CxPKXsHv

I do have a preset called "Custom H.265 MKV 1080p30" and "test", but I don't want to use those just the built-in "H.265 MKV 1080p30"
rollin_eng
Veteran User
Posts: 4840
Joined: Wed May 04, 2011 11:06 pm

Re: Handbrake-CLI - Invalid preset

Post by rollin_eng »

Can you list the available presets, -z I think.
Son_Of_Diablo
Posts: 9
Joined: Tue Apr 23, 2019 10:34 am

Re: Handbrake-CLI - Invalid preset

Post by Son_Of_Diablo »

Code: Select all

> HandBrakeCLI.exe -z
[17:06:04] Compile-time hardening features are enabled
[17:06:05] Nvenc version 10.0

[17:06:05] hb_init: starting libhb thread
[17:06:05] thread 1 started ("libhb")
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
        Small H.264 video (up to 576p25) and AAC stereo audio, in an
        MP4 container.
    Very Fast 480p30
        Small H.264 video (up to 480p30) and AAC stereo audio, in an
        MP4 container.
    Fast 1080p30
        H.264 video (up to 1080p30) and AAC stereo audio, in an MP4
        container.
    Fast 720p30
        H.264 video (up to 720p30) and AAC stereo audio, in an MP4
        container.
    Fast 576p25
        H.264 video (up to 576p25) and AAC stereo audio, in an MP4
        container.
    Fast 480p30
        H.264 video (up to 480p30) and AAC stereo audio, in an MP4
        container.
    HQ 1080p30 Surround
        High quality H.264 video (up to 1080p30), AAC stereo audio,
        and Dolby Digital (AC-3) surround audio, in an MP4
        container.
    HQ 720p30 Surround
        High quality H.264 video (up to 720p30), AAC stereo audio,
        and Dolby Digital (AC-3) surround audio, in an MP4
        container.
    HQ 576p25 Surround
        High quality H.264 video (up to 576p25), AAC stereo audio,
        and Dolby Digital (AC-3) surround audio, in an MP4
        container.
    HQ 480p30 Surround
        High quality H.264 video (up to 480p30), AAC stereo audio,
        and Dolby Digital (AC-3) surround audio, in an MP4
        container.
    Super HQ 1080p30 Surround
        Super high quality H.264 video (up to 1080p30), AAC stereo
        audio, and Dolby Digital (AC-3) surround audio, in an MP4
        container.
    Super HQ 720p30 Surround
        Super high quality H.264 video (up to 720p30), AAC stereo
        audio, and Dolby Digital (AC-3) surround audio, in an MP4
        container.
    Super HQ 576p25 Surround
        Super high quality H.264 video (up to 576p25), AAC stereo
        audio, and Dolby Digital (AC-3) surround audio, in an MP4
        container.
    Super HQ 480p30 Surround
        Super high quality H.264 video (up to 480p30), AAC stereo
        audio, and Dolby Digital (AC-3) surround audio, in an MP4
        container.
Web/
    Discord Nitro Large 3-6 Minutes 1080p30
        Encode up to 3 minutes of video in large size for Discord
        Nitro Classic (50 MB or less) or up to 6 minutes of video in
        large size for Discord Nitro (100 MB or less). H.264 video
        (up to 1080p30) and AAC stereo audio, in an MP4 container.
    Discord Nitro Medium 5-10 Minutes 720p30
        Encode up to 5 minutes of video in medium size for Discord
        Nitro Classic (50 MB or less) or up to 10 minutes of video
        in medium size for Discord Nitro (100 MB or less). H.264
        video (up to 720p30) and AAC stereo audio, in an MP4
        container.
    Discord Nitro Small 10-20 Minutes 480p30
        Encode up to 10 minutes of video in small size for Discord
        Nitro Classic (50 MB or less) or up to 20 minutes of video
        in small size for Discord Nitro (100 MB or less). H.264
        video (up to 480p30) and AAC stereo audio, in an MP4
        container.
    Discord Small 2 Minutes 360p30
        Encode up to 2 minutes of video in small size for Discord (8
        MB or less). H.264 video (up to 360p30) and AAC mono audio,
        in an MP4 container.
    Discord Tiny 5 Minutes 240p30
        Encode up to 5 minutes of video in tiny size for Discord (8
        MB or less). H.264 video (up to 240p30) and AAC mono audio,
        in an MP4 container.
    Gmail Large 3 Minutes 720p30
        Encode up to 3 minutes of video in large size for Gmail (25
        MB or less). H.264 video (up to 720p30) and AAC stereo
        audio, in an MP4 container.
    Gmail Medium 5 Minutes 480p30
        Encode up to 5 minutes of video in medium size for Gmail (25
        MB or less). H.264 video (up to 480p30) and AAC stereo
        audio, in an MP4 container.
    Gmail Small 10 Minutes 288p30
        Encode up to 10 minutes of video in small size for Gmail (25
        MB or less). H.264 video (up to 288p30) and AAC mono audio,
        in an MP4 container.
    Vimeo YouTube HQ 2160p60 4K
        High quality H.264 video (up to 2160p60) and high bit rate
        AAC stereo audio in an MP4 container. Compatible with video
        hosting services supporting 4K video, such as Vimeo and
        YouTube.
    Vimeo YouTube HQ 1440p60 2.5K
        High quality H.264 video (up to 1440p60) and high bit rate
        AAC stereo audio in an MP4 container. Compatible with video
        hosting services supporting 2.5K video, such as Vimeo and
        YouTube.
    Vimeo YouTube HQ 1080p60
        High quality H.264 video (up to 1080p60) and high bit rate
        AAC stereo audio in an MP4 container. Compatible with video
        hosting services supporting 1080p60, such as Vimeo and
        YouTube.
    Vimeo YouTube HQ 720p60
        High quality H.264 video (up to 720p60) and high bit rate
        AAC stereo audio in an MP4 container. Compatible with video
        hosting services supporting 720p60, such as Vimeo and
        YouTube.
    Vimeo YouTube 720p30
        H.264 video (up to 720p30) and high bit rate AAC stereo
        audio in an MP4 container. Compatible with most video
        hosting services, such as Vimeo and YouTube.
Devices/
    Android 1080p30
        H.264 video (up to 1080p30) and AAC stereo audio, in an MP4
        container. Compatible with Android devices.
    Android 720p30
        H.264 video (up to 720p30) and AAC stereo audio, in an MP4
        container. Compatible with Android devices.
    Android 576p25
        H.264 video (up to 576p25) and AAC stereo audio, in an MP4
        container. Compatible with Android devices.
    Android 480p30
        H.264 video (up to 480p30) and AAC stereo audio, in an MP4
        container. Compatible with Android devices.
    Apple 2160p60 4K HEVC Surround
        H.265 video (up to 2160p60), AAC stereo audio, and Dolby
        Digital (AC-3) surround audio, in an MP4 container.
        Compatible with Apple iPhone 7, 7 Plus, 8, 8 Plus, X, XR,
        XS, XS Max; Apple TV 4K.
    Apple 1080p60 Surround
        H.264 video (up to 1080p60), AAC stereo audio, and Dolby
        Digital (AC-3) surround audio, in an MP4 container.
        Compatible with Apple iPad 5th and 6th Generation; iPad mini
        2, 3, and 4; iPad Air 1st Generation and Air 2; iPad Pro
        1st, 2nd, and 3rd Generation; Apple TV 4th Generation and
        later.
    Apple 1080p30 Surround
        H.264 video (up to 1080p30), AAC stereo audio, and Dolby
        Digital (AC-3) surround audio, in an MP4 container.
        Compatible with Apple iPhone 5, 5s, SE, 6, 6 Plus, 6s, 6s
        Plus, and later; iPod touch 6th Generation; iPad 3rd, 4th
        Generation and later; iPad mini 1st Generation and later;
        Apple TV 3rd, 4th Generation and later.
    Apple 720p30 Surround
        H.264 video (up to 720p30), AAC stereo audio, and Dolby
        Digital (AC-3) surround audio, in an MP4 container.
        Compatible with Apple iPhone 4, 4S, and later; iPod touch
        4th, 5th Generation and later; iPad 1st Generation, iPad 2,
        and later; Apple TV 2nd Generation and later.
    Apple 540p30 Surround
        H.264 video (up to 540p30), AAC stereo audio, and Dolby
        Digital (AC-3) surround audio, in an MP4 container.
        Compatible with Apple iPhone 1st Generation, 3G, 3GS, and
        later; iPod touch 1st, 2nd, 3rd Generation and later; iPod
        Classic; Apple TV 1st Generation and later.
    Apple 240p30
        H.264 video (up to 240p30) and AAC stereo audio, in an MP4
        container. Compatible with Apple iPod 5th Generation and
        later.
    Chromecast 2160p60 4K HEVC Surround
        H.265 video (up to 2160p60), AAC stereo audio, and Dolby
        Digital (AC-3) surround audio, in an MP4 container.
        Compatible with Google Chromecast Ultra.
    Chromecast 1080p60 Surround
        H.264 video (up to 1080p60), AAC stereo audio, and Dolby
        Digital (AC-3) surround audio, in an MP4 container.
        Compatible with Google Chromecast 3rd Generation.
    Chromecast 1080p30 Surround
        H.264 video (up to 1080p30), AAC stereo audio, and Dolby
        Digital (AC-3) surround audio, in an MP4 container.
        Compatible with Google Chromecast 1st, 2nd Generation and
        later.
    Amazon Fire 2160p60 4K HEVC Surround
        H.265 video (up to 2160p60), AAC stereo audio, and Dolby
        Digital (AC-3) audio, in an MP4 container. Compatible with
        Amazon Fire TV 2nd Generation and later; Fire TV Cube, Fire
        TV Stick 4K.
    Amazon Fire 1080p30 Surround
        H.264 video (up to 1080p30), AAC stereo audio, and Dolby
        Digital (AC-3) audio, in an MP4 container. Compatible with
        Amazon Fire TV 1st Generation and later; Fire TV Stick 1st
        Generation and later; Fire HD 10 7th Generation (2017); Fire
        HDX 4th Generation (2014).
    Amazon Fire 720p30
        H.264 video (up to 720p30) and AAC stereo audio, in an MP4
        container. Compatible with Amazon Fire HD 4th Generation
        (2014) and later; Kindle Fire HDX 3rd Generation (2013);
        Kindle Fire HD 2nd Generation (2012) and later.
    Playstation 2160p60 4K Surround
        H.264 video (up to 2160p60), AAC stereo audio, and Dolby
        Digital (AC-3) surround audio, in an MP4 container.
        Compatible with Playstation 4 Pro.
    Playstation 1080p30 Surround
        H.264 video (up to 1080p30), AAC stereo audio, and Dolby
        Digital (AC-3) surround audio, in an MP4 container.
        Compatible with Playstation 3 and 4.
    Playstation 720p30
        H.264 video (up to 720p30) and AAC stereo audio, in an MP4
        container. Compatible with Playstation Vita TV.
    Playstation 540p30
        H.264 video (up to 540p30) and AAC stereo audio, in an MP4
        container. Compatible with Playstation Vita.
    Roku 2160p60 4K HEVC Surround
        H.265 video (up to 2160p60), AAC stereo audio, and surround
        audio, in an MKV container. Compatible with Roku 4,
        Streaming Stick+, Premiere+, and Ultra.
    Roku 1080p30 Surround
        H.264 video (up to 1080p30), AAC stereo audio, and Dolby
        Digital (AC-3) surround audio, in an MP4 container.
        Compatible with Roku 1080p models.
    Roku 720p30 Surround
        H.264 video (up to 720p30), AAC stereo audio, and Dolby
        Digital (AC-3) surround audio, in an MP4 container.
        Compatible with Roku 720p models.
    Roku 576p25
        H.264 video (up to 576p25) and AAC stereo audio, in an MP4
        container. Compatible with Roku standard definition models.
    Roku 480p30
        H.264 video (up to 480p30) and AAC stereo audio, in an MP4
        container. Compatible with Roku standard definition models.
    Xbox 1080p30 Surround
        H.264 video (up to 1080p30), AAC stereo audio, and Dolby
        Digital (AC-3) surround audio, in an MP4 container.
        Compatible with Xbox One.
    Xbox Legacy 1080p30 Surround
        H.264 video (up to 1080p30), AAC stereo audio, and Dolby
        Digital (AC-3) surround audio, in an MP4 container.
        Compatible with Xbox 360.
Matroska/
    H.265 MKV 2160p60
        H.265 video (up to 2160p60) and AAC stereo audio, in an MKV
        container.
    H.265 MKV 1080p30
        H.265 video (up to 1080p30) and AAC stereo audio, in an MKV
        container.
    H.265 MKV 720p30
        H.265 video (up to 720p30) and AAC stereo audio, in an MKV
        container.
    H.265 MKV 576p25
        H.265 video (up to 576p25) and AAC stereo audio, in an MKV
        container.
    H.265 MKV 480p30
        H.265 video (up to 480p30) and AAC stereo audio, in an MKV
        container.
    H.264 MKV 2160p60
        H.264 video (up to 2160p60) and AAC stereo audio, in an MKV
        container.
    H.264 MKV 1080p30
        H.264 video (up to 1080p30) and AAC stereo audio, in an MKV
        container.
    H.264 MKV 720p30
        H.264 video (up to 720p30) and AAC stereo audio, in an MKV
        container.
    H.264 MKV 576p25
        H.264 video (up to 576p25) and AAC stereo audio, in an MKV
        container.
    H.264 MKV 480p30
        H.264 video (up to 480p30) and AAC stereo audio, in an MKV
        container.
    VP9 MKV 2160p60
        VP9 video (up to 2160p60) and Opus stereo audio, in an MKV
        container.
    VP9 MKV 1080p30
        VP9 video (up to 1080p30) and Opus stereo audio, in an MKV
        container.
    VP9 MKV 720p30
        VP9 video (up to 720p30) and Opus stereo audio, in an MKV
        container.
    VP9 MKV 576p25
        VP9 video (up to 576p25) and Opus stereo audio, in an MKV
        container.
    VP9 MKV 480p30
        VP9 video (up to 480p30) and Opus stereo audio, in an MKV
        container.
    VP8 MKV 1080p30
        VP8 video (up to 1080p30) and Vorbis stereo audio, in an MKV
        container.
    VP8 MKV 720p30
        VP8 video (up to 720p30) and Vorbis stereo audio, in an MKV
        container.
    VP8 MKV 576p25
        VP8 video (up to 576p25) and Vorbis stereo audio, in an MKV
        container.
    VP8 MKV 480p30
        VP8 video (up to 480p30) and Vorbis stereo audio, in an MKV
        container.
Production/
    Production Max
        Maximum bit rate, constant frame rate H.264 video and high
        bit rate AAC stereo audio in an MP4 container. For
        professional use as an intermediate format for video
        editing. Creates gigantic files.
    Production Standard
        High bit rate, constant frame rate H.264 video and high bit
        rate AAC stereo audio in an MP4 container. For professional
        use as an intermediate format for video editing. Creates
        very large files.
    Production Proxy 1080p
        Intra-only, constant frame rate H.264 video (up to 1080p)
        and high bit rate AAC stereo audio in an MP4 container. For
        professional use as a low resolution proxy format for video
        editing.
    Production Proxy 540p
        Intra-only, constant frame rate H.264 video (up to 540p) and
        high bit rate AAC stereo audio in an MP4 container. For
        professional use as a low resolution proxy format for video
        editing.
CLI Defaults/
    CLI Default
Deleted User 11865

Re: Handbrake-CLI - Invalid preset

Post by Deleted User 11865 »

rollin_eng wrote: Mon May 04, 2020 2:44 pm Can you list the available presets, -z I think.
Didn't he do that in his very first post? :roll:
rollin_eng
Veteran User
Posts: 4840
Joined: Wed May 04, 2011 11:06 pm

Re: Handbrake-CLI - Invalid preset

Post by rollin_eng »

something something senile...
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: Handbrake-CLI - Invalid preset

Post by BradleyS »

Does --preset="Matroska/H.265 MKV 1080p30" work?
Son_Of_Diablo
Posts: 9
Joined: Tue Apr 23, 2019 10:34 am

Re: Handbrake-CLI - Invalid preset

Post by Son_Of_Diablo »

BradleyS wrote: Tue May 05, 2020 2:01 am Does --preset="Matroska/H.265 MKV 1080p30" work?
That did indeed work!

Thank you so very much! :)
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: Handbrake-CLI - Invalid preset

Post by BradleyS »

Interesting, it should work without the full path (category prefix). Will investigate. Glad you got it working with the workaround. :)
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Handbrake-CLI - Invalid preset

Post by JohnAStebbins »

BradleyS wrote: Tue May 05, 2020 1:00 pm Interesting, it should work without the full path (category prefix). Will investigate. Glad you got it working with the workaround. :)
Oh, *insert favourite expletive*. I may have inadvertently busted this. I made a "fix" to how presets are searched for and didn't test this case. *expletive**expletive**expletive*. :evil: :oops:

So leave it to me. I'll test right away.
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: Handbrake-CLI - Invalid preset

Post by BradleyS »

JohnAStebbins wrote: Tue May 05, 2020 1:44 pm I may have inadvertently busted this.
:oops: :oops: :oops:

I thought about the changes you're probably referencing, but didn't want to point blame...
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Handbrake-CLI - Invalid preset

Post by JohnAStebbins »

Should be fixed in the next nightly build
https://github.com/HandBrake/HandBrake/ ... 88b6bb3f4b

We may want to spin a 1.3.3 release soon since this is an interface bug that will affect pretty much everyone useing the CLI.

Turns out I didn't really bust it. It was already broken internally. It's just that the first bug that I fixed was concealing this additional bug. The recursive search was accidentally happening through an erroneous code path before I fixed the first bug. :mrgreen:
Post Reply