Help with custom encoding

Longtime Mythtv user here, just recently trying to make the move to Plex / MCEBuddy. I’ve been using a script in Linux to encode recordings after removing commercials, and haven’t been able to find the same functionality in MCEBuddy. The only reasonably close option from the encoding drop down is x264 normal. I want to encode using x265 with specific parameters. How can I do this in the MCEBuddy software?

nice HandBrakeCLI -i “$1.tmp” -o “/myth/HDD-1/videos/$4/$2 - S$season"Ep”$episode - $3.mkv" --preset=“H.265 MKV 720p30” -q 19 -a 1 -E copy --audio-copy-mask ac3 --audio-fallback ac3 -B 320 -6 5point1 --x265-preset medium deblock=-1:-1 >/dev/null 2>&1

Is this forum dead? I’d like to try to use the software, but I’m not going to pay for it if I can’t get a few questions answered.

This seems to work pretty well, but where can I find documentation to match the settings I first posted?

[MKV h265 TV q20]
Description=WARNING: Handbrake Constant Quality encoding (25) with Nvidia HVEC.
order=handbrake,ffmpeg
AllowH264CopyRemuxing=true
FixedResolution=true
AutoDeinterlace=true
ffmpeg-UsingHardwareEncoding=True
ffmpeg-general=-threads 0 -hwaccel auto
ffmpeg-video=-ss 9 -c:v hevc_nvenc -cq 20 -rc vbr -map 0:v
ffmpeg-audio=-acodec ac3 -ab 192k -map 0:a
ffmpeg-audioac3=-acodec ac3 -ab 384k -map 0:a
ffmpeg-ext=.mkv
ffmpeg-audiodelay=skip
handbrake-UsingHardwareEncoding=true
handbrake-general=–decomb --denoise=“weak” --loose-anamorphic --verbose=2 -T -O
handbrake-video=–start-at duration:3 -e x265 -q 20
handbrake-audio=-E ffac3 -R auto -B 192 -D 0 -a 1,2,3,4,5
handbrake-audioac3=-E ffac3 -R auto -B 384 -D 0 -a 1,2,3,4,5
handbrake-ext=.mkv
handbrake-audiodelay=skip
PreConversionCommercialRemover=true

MCEBuddy comes with a wide range of stock profiles including H.265 (HEVC) profiles. If you’re looking to customize/build your own profile I would recommend starting this topic: MCEBuddy - Understanding Profiles Basics

As for custom renaming, enable the Enable custom renaming option in your Conversion Task page and write your own file naming pattern. See this topic to see how to build your own custom renaming pattern using the metadata from your files: MCEBuddy - Advanced Settings, Commands and Tweaking

This documentation is also included in your MCEBuddy installation.

I read through all that, but still can’t really figure out where to put the --preset=“H.265 MKV 720p30” option. Does that go in handbrake-general or handbrake-video?

handbrake-video

Thanks, I’ll give it try

Seems I have something that’s pretty close to what I want. Do I need any of the ffmpeg in there, or can all that just be removed?
[MKV Preset H.265 MKV 1080p30]
Description=WARNING: Handbrake Constant Quality encoding H.265 MKV 1080p30.
order=handbrake,ffmpeg
AllowH264CopyRemuxing=true
FixedResolution=true
AutoDeinterlace=true
ffmpeg-UsingHardwareEncoding=True
ffmpeg-general=-threads 0 -hwaccel auto
ffmpeg-video=-ss 9 -c:v hevc_nvenc -cq 20 -rc vbr -map 0:v
ffmpeg-audio=-acodec ac3 -ab 192k -map 0:a
ffmpeg-audioac3=-acodec ac3 -ab 384k -map 0:a
ffmpeg-ext=.mkv
ffmpeg-audiodelay=skip
handbrake-UsingHardwareEncoding=true
handbrake-general= --verbose=2
handbrake-video= --preset=“H.265 MKV 1080p30” -q 20 --encoder-preset medium
handbrake-audio=-E copy:ac3 -R auto -a 1
handbrake-audioac3=-E copy:ac3 -R auto -a 1
handbrake-ext=.mkv
handbrake-audiodelay=skip
PreConversionCommercialRemover=true

Any help with profiles? Using the above, I’m getting files about 5 times larger than if I use handbrake outside of MCE.
How can I pass this through correctly?
handbrake-video= --preset=“H.265 MKV 1080p30” -q 20 --encoder-preset medium

Wish I could help you as it is extremely hard getting help with this kind of stuff here. If not for another user SystemIdleProcess I would never have figured out how to get my custom profile working…but I don’t use Handbrake because I prefer the results with ffmpeg.

I’m curious why you are using a -q level of 20 because that will definitely result in a huge file. I use ffmpeg with a -cq value of 26 and end up with files somewhat smaller than H.264 normal quality but of equal or higher quaility. The standard HEVC profile in MCEBuddy is really low quality and my highly tweaked HEVC profile produces really good quality when watched on my TVs at a nice file size.

If you are interested in trying ffmpeg with my profile for comparison let me know and I’ll post it here for you.

I optimized it specifically for compressing recorded TV to use in Emby.

I’ve not had any luck using handbrake presets in MCEBuddy, so you have to dissect them to get the proper commands called. I do use handbrake in MCEBuddy though so can try and help you out. Here is the profile I suggest trying to start with.

This is based on your initial post:

[Handbrake H.265 MKV 720p30]
Description=Using Handbrake H.265 MKV 720p30 preset.
order=handbrake
handbrake-general=-v=2
handbrake-video=--comb-detect=Default --decomb=Default --auto-anamorphic -e h265 --encoder-preset slow -q 21 --pfr --deblock=-1:-1 -Y 720 -r 30
handbrake-audio=-E copy --audio-copy-mask ac3 --audio-fallback ac3 -B 320 -R auto
handbrake-audioac3=-E copy --audio-copy-mask ac3 --audio-fallback ac3 -B 320 -R auto
handbrake-ext=.mkv
handbrake-audiodelay=skip
handbrake-AudioOptimized=true
handbrake-VideoOptimized=true

This should get you as close as I can determine to that preset. The last two values for the Audio and Video Optimized prevents any further detection and optimized of these settings supplied.

Just in case you want to play around with it some. Here is my most recent profile I’ve been using after spending some time tweaking it. I usually use Intel hardware encoding so this is the software encoding version of that.

[HEVC MKV Handbrake Software Encode]
Description=HEVC in MKV
order=handbrake
handbrake-general=-v=2
handbrake-video=--comb-detect=Default --decomb=Default --auto-anamorphic -e x265 --encoder-preset slow -q 26 --cfr
handbrake-audio=-E copy --audio-copy-mask ac3,eac3,truehd,dts,dtshd,mp3,flac --audio-fallback ffac3 -R auto
handbrake-audioac3=-E copy -R auto
handbrake-ext=.mkv
handbrake-audiodelay=skip

Hopefully this helps out. I’m by no means an expert but I like to try and figure things out. I’m still learning about Handbrake and ffmpeg and I’m sure will be tweaking my profile a dozen more times. The constant quest of balance in quality and file size.

1 Like