Easy Import of Handbrake Profile!

So I’ve been a long time MCEBuddy user now and it’s great, however for years I tried to figure out, unsuccessfully, how to import and use my Handbrake GUI presets. I’m sorry if this is a duplicate post, but as I had trouble finding this out I figured I’d share just in case.

  1. Build your preset in Handbrake GUI and export out the JSON preset to your MCEBuddy Handbrake folder (C:\Program Files\MCEBuddy2x\handbrake)
  2. Edit your MCEBuddy config file to add the new preset code below (C:\Program Files\MCEBuddy2x\config\profiles.conf)
  3. Replace PRESETNAME.json in the config with your preset name, save, stop/start MCEBuddy and enjoy!

[Handbrake Preset]
Description=Utilizes a Handbrake GUI built preset
2pass=true
order=handbrake
handbrake-general=–preset-import-file PRESETNAME.json
handbrake-audio=-E faac -R auto -B 128-D 0
handbrake-audioac3=-E faac -R auto -B 384 -D 0
handbrake-ext=.mp4
handbrake-audiodelay=skip
PreConversionCommercialRemover=true

You will need to add

handbrake-VideoOptimized=true

to your profile to tell MCEBuddy to skip over validating the video parameters

Also the handbrake-general should be present and empty and you should put your preset in handbrake-video in the profile.

More details here: MCEBuddy - Advanced Settings, Commands and Tweaking

So this what I end up with?

2pass=true
order=handbrake
handbrake-general=
handbrake-video=–preset-import-file PRESETNAME.json
handbrake-audio=-E faac -R auto -B 128-D 0
handbrake-audioac3=-E faac -R auto -B 384 -D 0
handbrake-ext=.mp4
handbrake-audiodelay=skip
handbrake-VideoOptimized=true
PreConversionCommercialRemover=true

I am new to MCEBuddy. I would like to learn more on this topic of importing Handbrake profiles.

I use the Matroska H.264 presets on Handbrake. I prefer the subtitles from those Handbrake presets. Those presets embed subtitle tracks without the need for extracting closed captions and using an additional .SRT file.

This is my profile that has been working:

[MKV preset test]
Description=MKV preset test
order=handbrake
2pass=true
handbrake-general=
handbrake-video=–preset-import-file hbpreset.json
handbrake-audio=–preset-import-file hbpreset.json
handbrake-audioac3=–preset-import-file hbpreset.json
handbrake-ext=.mkv
handbrake-audiodelay=skip
handbrake-VideoOptimized=true

I was unsure about the audio lines, I would like some advice for building the profile correctly.

Thank you.

I would recommend start by looking at this post and then go onto the advanced commands post from there: MCEBuddy - Understanding Profiles Basics

You’ll need to also set the handbrake-AudioOptimized parameter since you don’t want mcebuddy to automatically adjust those settings either.

I just signed up to comment on how incredibly helpful this thread was. I love MCEBuddy and the automation it brings to my workflow, but it’s also incredibly liberating to be able to use a Handbrake preset that I’ve spent weeks refining in the Handbrake GUI.

I’ve also put some effort into streamlining this configuration. I found that the video and audio directives are unneeded (and unused with the handbrake-VideoOptimized and handbrake-AudioOptimized flags), since Handbrake bypasses them with the preset, and there is no need to define them multiple times. I found that 2pass=true does nothing in this scenario. And I found that, at least in current versions of Handbrake, I needed to define the actual preset name in the command line arguments or Handbrake would not use the preset from the file at all. The preset name specified by “–preset” in profiles.conf must match the value of the “PresetName” field in the .json file. If they don’t already match, edit the profiles.conf text, the .json file text, or both.

Conversion tasks in MCEBuddy that use this profile should also have this option enabled: Advanced Settings → Expert Settings → “Skip remuxing files”.

Lastly, I found that while I made my Handbrake preset as comprehensive as I could in terms of finding and adding subtitles to my output MKV file, Handbrake can’t automatically import subtitles from a .srt file using a preset; that’s always a manual step. So I added custom commands to my MCEBuddy profile to automate it anyway. It looks for a .srt file alongside the input file with the same name, and if it exists, then after the Handbrake step using mkvmerge, muxes it into the MKV (in the temp directory) as the primary English subtitle track, and omits copying the .srt file to the destination. This works great for me!

For troubleshooting purposes, I also found it helpful to increase the log level to “Debug” in Settings → General Settings → System Settings to see the composed commands as they were executing.

Here is my final profile config from profiles.conf:

[Handbrake preset - MudHut_v4,AndTV_VlcKodi,Pana_Bluray,720pHQ,h264,aac,allaudio,allsubs]
Description=Explicitly uses a custom Handbrake preset and bypasses MCEBuddy's audio and video settings.  Preset: MudHut_v4,AndTV_VlcKodi,Pana_Bluray,720pHQ,h264,aac,allaudio,allsubs
order=handbrake
handbrake-general=--preset-import-file MudHut_v4,AndTV_VlcKodi,Pana_Bluray,720pHQ,h264,aac,allaudio,allsubs.json --preset MudHut_v4,AndTV_VlcKodi,Pana_Bluray,720pHQ,h264,aac,allaudio,allsubs
handbrake-video=
handbrake-audio=
handbrake-audioac3=
handbrake-ext=.mkv
handbrake-audiodelay=skip
handbrake-VideoOptimized=true
handbrake-AudioOptimized=true
CustomCommandPath=C:\Windows\system32\cmd.exe
CustomCommandParameters=/s /c "if exist "%srtfile%" "C:\Program Files\MCEBuddy2x\mkvmerge\mkvmerge.exe" -o "%convertedfile%-remux.tmp" "%convertedfile%" --default-track "0:yes" --track-name "0:English" --language "0:eng" "%srtfile%"&&move /y "%convertedfile%-remux.tmp" "%convertedfile%"&echo.n|del "%srtfile%""
CustomCommandHangPeriod=600
CustomCommandCritical=false
CustomCommandUISession=false
CustomCommandShowWindow=false
CustomCommandExitCodeCheck=false
1 Like