Handbrake fails to import preset if the name of the file (for example testprofile.json) is not equal to the string inside the file "PresetName": "test_profile"
Is it a bug or not???
Cause with this ^^ setup I got:
c:\2\test2>"C:\2\HandBrakeCLI.exe" -i "c:\2\test2\1. Fast Start 1 - Clearing Your Mental Clutter.mp4
" -o "c:\2\test2\1. Fast Start 1 - Clearing Your Mental Clutter.mkv" --preset-import-file c:\1\testp
rofile.json --verbose=1
[04:17:59] hb_init: starting libhb thread
[04:17:59] thread 435ba60 started ("libhb")
Preset import failed, file (c:\1\testprofile.json)
And then handbrake switches to default preset.
IIRC you have to import, then use, not try and encode at the same time, otherwise it won't be used. The name shouldn't matter.
Works fine for me. Can you supply the preset file you are having issues with? The symptoms you describe are pretty much impossible, so something else is going on.
ok, I understood what happened
When command --preset-import-profile c:\1\testprofile.json invoked, handbrake creates a profile with the name of the file. It doesn't use "PresetName": inside the file.
And why this method worked for me before cause I used profiles with option "Default": true,. So after import they automatically became default profiles and were used for encoding.
Guys, you definitely need some documentation on this topic, because all this profile stuff in the console application is kinda counterintuitive. I though --preset-import-profile basically meant "use this file for this encode".
BTW where are those profiles even stored for HandBrakeCLI ?
No, it doesn't do that. It uses PresetName. The file name is only used for the purpose of opening the file, then it is forgotten and ignored.
If PresetName == "My Custom Preset" and file is "somepreset.json", the correct command line to use that preset is:
HandBrakeCLI --preset-import-file somepreset.json -Z "My Custom Preset" ...
To clarify and expand. A preset file can contain more than one preset. Therefore, it is necessary to both import the preset file and specify the name of the preset you want to use.
I screwed up path to the profile, so HB took a different one. My bad.
Now everything works exactly as you described.
Most helpful comment
No, it doesn't do that. It uses PresetName. The file name is only used for the purpose of opening the file, then it is forgotten and ignored.
If PresetName == "My Custom Preset" and file is "somepreset.json", the correct command line to use that preset is:
HandBrakeCLI --preset-import-file somepreset.json -Z "My Custom Preset" ...