# Help with custom encoding

**URL:** <https://discussion.mcebuddy2x.com/t/help-with-custom-encoding/3425>\
**Category:** General Support / Questions\
**Created:** [February 10, 2020, 9:15pm UTC](https://discussion.mcebuddy2x.com/t/help-with-custom-encoding/3425 "2020-02-10T21:15:35Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kebast](https://discussion.mcebuddy2x.com/user_avatar/discussion.mcebuddy2x.com/kebast/32/1488_2.png) [@Kebast](https://discussion.mcebuddy2x.com/u/Kebast)\
**Post date:** [February 10, 2020, 9:15pm UTC](https://discussion.mcebuddy2x.com/t/help-with-custom-encoding/3425/1 "2020-02-10T21:15:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Kebast](https://discussion.mcebuddy2x.com/user_avatar/discussion.mcebuddy2x.com/kebast/32/1488_2.png) [@Kebast](https://discussion.mcebuddy2x.com/u/Kebast)\
**Post date:** [February 13, 2020, 2:15am UTC](https://discussion.mcebuddy2x.com/t/help-with-custom-encoding/3425/2 "2020-02-13T02:15:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Kebast](https://discussion.mcebuddy2x.com/user_avatar/discussion.mcebuddy2x.com/kebast/32/1488_2.png) [@Kebast](https://discussion.mcebuddy2x.com/u/Kebast)\
**Post date:** [February 15, 2020, 4:41pm UTC](https://discussion.mcebuddy2x.com/t/help-with-custom-encoding/3425/3 "2020-02-15T16:41:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Goose](https://discussion.mcebuddy2x.com/letter_avatar_proxy/v4/letter/g/5f9b8f/32.png) [@Goose](https://discussion.mcebuddy2x.com/u/Goose)\
**Post date:** [February 15, 2020, 5:21pm UTC](https://discussion.mcebuddy2x.com/t/help-with-custom-encoding/3425/4 "2020-02-15T17:21:04Z")

</div>

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](https://discussion.mcebuddy2x.com/t/mcebuddy-understanding-profiles-basics/27)

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](https://discussion.mcebuddy2x.com/t/mcebuddy-advanced-settings-commands-and-tweaking/30#customrenaming)

This documentation is also included in your MCEBuddy installation.

 ![image](https://discussion.mcebuddy2x.com/uploads/default/original/2X/7/703630a6f0837cc41069bdabd5a7f10644cda996.png)

---

<div class="post-metadata">

**Author:** ![Kebast](https://discussion.mcebuddy2x.com/user_avatar/discussion.mcebuddy2x.com/kebast/32/1488_2.png) [@Kebast](https://discussion.mcebuddy2x.com/u/Kebast)\
**Post date:** [February 15, 2020, 7:59pm UTC](https://discussion.mcebuddy2x.com/t/help-with-custom-encoding/3425/5 "2020-02-15T19:59:19Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Goose](https://discussion.mcebuddy2x.com/letter_avatar_proxy/v4/letter/g/5f9b8f/32.png) [@Goose](https://discussion.mcebuddy2x.com/u/Goose)\
**Post date:** [February 15, 2020, 9:15pm UTC](https://discussion.mcebuddy2x.com/t/help-with-custom-encoding/3425/6 "2020-02-15T21:15:29Z")

</div>

`handbrake-video`

---

<div class="post-metadata">

**Author:** ![Kebast](https://discussion.mcebuddy2x.com/user_avatar/discussion.mcebuddy2x.com/kebast/32/1488_2.png) [@Kebast](https://discussion.mcebuddy2x.com/u/Kebast)\
**Post date:** [February 15, 2020, 9:18pm UTC](https://discussion.mcebuddy2x.com/t/help-with-custom-encoding/3425/7 "2020-02-15T21:18:50Z")

</div>

Thanks, I’ll give it try

---

<div class="post-metadata">

**Author:** ![Kebast](https://discussion.mcebuddy2x.com/user_avatar/discussion.mcebuddy2x.com/kebast/32/1488_2.png) [@Kebast](https://discussion.mcebuddy2x.com/u/Kebast)\
**Post date:** [February 16, 2020, 3:57am UTC](https://discussion.mcebuddy2x.com/t/help-with-custom-encoding/3425/8 "2020-02-16T03:57:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Kebast](https://discussion.mcebuddy2x.com/user_avatar/discussion.mcebuddy2x.com/kebast/32/1488_2.png) [@Kebast](https://discussion.mcebuddy2x.com/u/Kebast)\
**Post date:** [March 4, 2020, 2:04pm UTC](https://discussion.mcebuddy2x.com/t/help-with-custom-encoding/3425/9 "2020-03-04T14:04:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ronstang](https://discussion.mcebuddy2x.com/letter_avatar_proxy/v4/letter/r/ba9def/32.png) [@Ronstang](https://discussion.mcebuddy2x.com/u/Ronstang)\
**Post date:** [February 22, 2021, 6:47am UTC](https://discussion.mcebuddy2x.com/t/help-with-custom-encoding/3425/10 "2021-02-22T06:47:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![SystemIdleProcess](https://discussion.mcebuddy2x.com/user_avatar/discussion.mcebuddy2x.com/systemidleprocess/32/2560_2.png) [@SystemIdleProcess](https://discussion.mcebuddy2x.com/u/SystemIdleProcess)\
**Post date:** [February 22, 2021, 1:09pm UTC](https://discussion.mcebuddy2x.com/t/help-with-custom-encoding/3425/11 "2021-02-22T13:09:11Z")

</div>

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.
