HandBrakeCLI 1.3.2 "Invalid preset" on custom preset.

Support for HandBrake on Linux, Solaris, and other Unix-like platforms
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
rachel
Regular User
Posts: 69
Joined: Thu Mar 15, 2007 7:34 pm

HandBrakeCLI 1.3.2 "Invalid preset" on custom preset.

Post by rachel »

Description of problem or question:

I've been using a script for ages to automate transcoding of off-air recordings. To this end I have a custom preset, defined in the GUI. (It's based on the "Apple 2160p60 4K HEVC Surround" preset with minor changes - to use Yadif-Bob deinterlacing and auto-passthrough audio, and no cropping.)

After upgrading the machine I ran it on from Ubuntu 19.10 to Ubuntu 20.04 I saw that there's just been a new release of Handbrake so I upgraded to that too. This is a local self-build of Handbrake (in order to use --enable-fdk-aac). With an otherwise default build and install, I therefore have both ghb and HandBrakeCLI binaries installed.

Since then, when I run my script, it always fails with an "Invalid preset" error, then listing all the available presets. The list it prints out includes the custom one I made and am trying to use.

I tried deleting the preset made for the previous version of HandBrake and creating a new one in ghb, but it makes no difference, I still get the same error.

The preset itself works fine if I encode videos using ghb. It's just that HandBrakeCLI doesn't seem to want to pick it up. I tried literally copy-pasting the preset name from the list into the script/commandline to make sure there wasn't somehow an invisible difference. I've checked there aren't stray spaces at the end of the preset name in ghb. I switched from using single-quotes around the preset name to double-quotes, as the help text specifies double quotes. I couldn't see that it would make a difference given there's nothing especially odd in the preset name... and sure enough it didn't make a difference.

I have verified that both ghb and HandBrakeCLI are the same version: 1.3.2.

I tried adding --verbose, up to --verbose 3 to the command, but it's not printing any more information.


Steps to reproduce the problem (If Applicable):

Create a custom preset in ghb

Try to use it in HandBrakeCLI, ie:

Code: Select all

HandBrakeCLI --preset-import-gui --preset "Custom Preset Name" -i infile, -o outfile
See the error in the console output, as pasted below. Most of what's pasted is the complete list of standard presets, plus the custom one I'm trying to use at the bottom.


HandBrake version (e.g., 1.0.0):

1.3.2

(Built from source on target system, with

Code: Select all

./configure --enable-fdk-aac --launch-jobs 0 --launch

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

Ubuntu 20.04


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

Code: Select all

➜ HandBrakeCLI --verbose 3 --preset-import-gui --preset "Kodi 2160p60 4K HEVC Surround Off-Air" -i "/media/Vault/kodi/recorded/tvshows-unavailable/Meet the Romans with Mary Beard/Meet the Romans with Mary Beard - [01x03] - Behind Closed Doors.mkv" -o "Meet the Romans with Mary Beard - [01x03] - Behind Closed Doors.m4v"
Cannot load libnvidia-encode.so.1
[19:25:14] hb_init: starting libhb thread
[19:25:14] thread 7f2ca1711700 started ("libhb")
HandBrake 1.3.2 (2020050400) - Linux x86_64 - https://handbrake.fr
8 CPUs detected
Invalid preset Kodi 2160p60 4K HEVC Surround Off-Air
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
            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
    Devices/
        Kodi 2160p60 4K HEVC Surround Off-Air
            H.265 video (up to 2160p60), AAC stereo audio, and
            auto-passthrough surround audio, in an MP4 container.
            Suitable for DVB-S2 off-air recordings.

HandBrake has exited.

rollin_eng
Veteran User
Posts: 3447
Joined: Wed May 04, 2011 11:06 pm

Re: HandBrakeCLI 1.3.2 "Invalid preset" on custom preset.

Post by rollin_eng »

Possibly related:

viewtopic.php?f=11&t=40084

rachel
Regular User
Posts: 69
Joined: Thu Mar 15, 2007 7:34 pm

Re: HandBrakeCLI 1.3.2 "Invalid preset" on custom preset.

Post by rachel »

Aha, yep, that workaround works for me too, in my case with the prefix "Devices/". TBH I don't find that usage onerous so I'll likely keep it even after the fix is in (lets you disambiguate same-name presets in different sets). But obvs it does break existing scripts.

8Ringer
Posts: 14
Joined: Sun Jun 21, 2020 7:16 pm

Re: HandBrakeCLI 1.3.2 "Invalid preset" on custom preset.

Post by 8Ringer »

Glad they fixed this in 1.3.3. I ran into this previously even though I never use built in presets, I was worried I’d have to troubleshoot my pkg install in FreeNAS. Wasn’t excited about that. Glad it was a bug.

Post Reply