Linux – Set a custom preset for HandbrakeCLI

handbrakelinuxvideo

I'm at a very long task at converting 800+ small files to mp4, and I'm using Handbrake at the moment. Its fast, but since there are many files, it takes a lot of time. I created a automator workflow for HandbrakeCLI so I can batch convert files in any folder. This works great, but I need it to work with a custom preset I have on the Handbrake GUI. Can I import the preset to CLI somehow? I'm not a Lunix or terminal wiz.

Best Answer

If you are working on the same machine and account as the GUI instance where you created the preset you can just select it with -z:

HandBrakeCLI -Z MyPreset -i inputfile.mpg -o outputfile.mp4

If you're trying to do it on another computer to where you set up the preset you will first need to export it from the GUI (in the presets menu) as a .plist file. Then you can import it (you need to do it every time, it doesn't save it) when you do the encode:

HandBrakeCLI --preset-import-file /path/to/preset.plist -Z "my preset" -i inputfile.mpg -o outputfile.mp4

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" ...

Related Question