Profile HEVC MP4 produces much larger files than before

Hi all,

About a month ago, I started using Profile ‘HEVC MP4’ to convert WTV files as well as to reconvert previously converted H264 files. Initially, I was impressed by the resulting files that were much smaller than expected. That lasted for a while until I upgraded MCEBuddy to the version 2.5.5 and Graphic card from Gigabye GV-N630D3 to Geforce GTX 1650. At the moment, I can still archieve smaller files than when I was using H264 profiles, but the resulting files are not as small as I was getting when I first switched to Profile ‘HEVC MP4’.

For example: for a 29.25 minutes WTV video, I converted it to a 205mb H264 mp4 video,then I was able to reconvert it to a 53mb H265 video, but at the moment its size can only be reduced to about 125mb. All three mp4 video files have the same resolution. There does not seem to be a lot, if any at all, difference in video quality either.

Even more puzzling is that from H264 video (profile MP4 High Quality) to H265 video (profile HEVC MP4) there is negligible reduction in size from 693mb to 677mb while previously to around 450mb.

I understand that I am supposed to expect about 50% drop in size when converting H264 files to H265 files. But I was really happy with the huge reduction of sizes initially, and I hope I can achieve that again to save much more space on my hard drives.

Can someone help me understand what is going on and solve my problem? What on earth am I missing here?

Thanks heaps!!!

See my MCEBuddy.log

Happy to upload sample files if that helps.

Did you by chance use software only encoding before and now you are using GPU accelerated? The reason I ask is my first HEVC encode was done in software and it took many hours but the file was small…like 700 megs for a movie. I went out and bought a video card capable of doing HEVC the next day, an ASUS GeForce 1650 to be exact, and re-encoded the same file and while it was still significantly smaller than the same file encoded in H.264 it was almost 2.5 time bigger than the software encode.

I don’t have an answer for the difference and I was never able to find one from anyone. I am just sharing my experience because it seems similar to yours.

Let me warn you about the pitfalls of HEVC. If you have a lot of content with very dark scenes, like horror movies, you can run into quality issues, specifically a kind of haloing affect of concentric circles around any movement. It is mostly when there is movement but not always. You have to test some movies and watch and see if it bothers you, it does me. The only way to make it go away is increase quality. Unfortunately I can’t get any help on how to modify MCEBuddy profiles so I’m stuck with a growing number of unconverted TS files. When I get it worked out I will share it here.

You are right there. And I believe I roughly understand why now.

The perception I had was that hardware acceleration merely lets GPU lend its processing power to speed up the encoding process. Actually, it is not how it works. To utilize hardware acceleration by your Nvidia GPU, you are asking for the inherent Nvidia GPU encoder to get to work too. While the Nvidia’s encoder embedded in the GPU can work much much faster than Handbrake, its resulting quality is inferior. In other words, to achieve similar quality, the converted video files with hardware acceleration is larger.

Consequently, we have to choose between faster encoding by utilising GPU’s processing power and better quality encoding by Handbrake as an application running on CPU. How dissappointing that more powerful graphics cards cannot help us speed up the encoding if we prefer Handbrake.

Please see the article below for more informative explaination.

Here is what I have found to work if you want to use Handbrake. The quality parameter passed is the same between software handbrake/fmpeg and ffmpeg hardware however hardware for Handbrake is different. So what I ended up doing is making hardware encoding specific profiles. I have played around hardware encoding in NVidia and Intel. I can tell you Intel is the best. Good file size and great quality at least when using h.265. Below are my profiles, modify them to fit your need.

Here are my profiles:

[HEVC MKV Intel]
Description=HEVC in MKV hard set to use Intel.
order=handbrake
DisableEncoderReordering=true
ffmpeg-general=-threads 0
ffmpeg-video=-ss 0 -vf yadif=0:-1:1,hqdn3d -vcodec hevc_qsv -preset slow -crf 26 -vsync 2 -map 0:v -sn
ffmpeg-audio=-acodec ac3 -map 0:a
ffmpeg-audioac3=-acodec copy -map 0:a
ffmpeg-ext=.mkv
ffmpeg-audiodelay=skip
handbrake-general=--decomb --auto-anamorphic --verbose=2
handbrake-video=--start-at duration:0 -e qsv_h265 --encoder-preset quality -q 26
handbrake-audio=--aencoder copy --audio-copy-mask ac3,eac3,truehd,dts,dtshd,mp3,flac --audio-fallback ffac3 -R auto
handbrake-audioac3=--aencoder copy --audio-copy-mask aac,ac3,eac3,truehd,dts,dtshd,mp3,flac -R auto
handbrake-ext=.mkv
handbrake-audiodelay=skip

[HEVC MKV NVidia]
Description=HEVC in MKV hard set to use NVidia.
order=handbrake
DisableEncoderReordering=true
ffmpeg-general=-threads 0
ffmpeg-video=-ss 0 -vf yadif=0:-1:1,hqdn3d -vcodec hevc_nvenc -preset hq -crf 26 -vsync 2 -map 0:v -sn
ffmpeg-audio=-acodec ac3 -map 0:a
ffmpeg-audioac3=-acodec copy -map 0:a
ffmpeg-ext=.mkv
ffmpeg-audiodelay=skip
ffmpeg-UsingHardwareEncoding=true
ffmpeg-DisableSoftwareEncoderFallback=true
handbrake-general=--decomb --auto-anamorphic --verbose=2
handbrake-video=--start-at duration:0 -e nvenc_h265 --encoder-preset hq -q 26
handbrake-audio=--aencoder copy --audio-copy-mask ac3,eac3,truehd,dts,dtshd,mp3,flac --audio-fallback ffac3 -R auto
handbrake-audioac3=--aencoder copy --audio-copy-mask aac,ac3,eac3,truehd,dts,dtshd,mp3,flac -R auto
handbrake-ext=.mkv
handbrake-audiodelay=skip
handbrake-UsingHardwareEncoding=true
handbrake-DisableSoftwareEncoderFallback=true
AllowAllCopyRemuxing=true

Did you mean to recommend getting a new graphic card with Intel quick sync capable GPU on it?

I have never used Handbrake separately except for when choosing HEVC MP4 profile in MCEbuddy.

I still do not have a good grasp of the knowledge framework in video conversion. And my hardwares are pretty dated too. Maybe I should spend more time and money in learning more about video conversion and getting better hardwares considering my considerable need for converting TV recordings.

It is not my intention to say buy this not that. I am only relaying my findings. I’ve been doing video conversion/TV capture for a couple of decades now but am by no ways an expert. My current system happens to has an intel based on-board GPU (UHD 630) and it can hardware encode h.265 10bit. It also has a RTX 2070. I’ve run tests comparing size and quality of all the hardware h.265 encoding between the Intel and NVidia and have found at least with my settings and tests that Intel produces a smaller but equal or better quality file based on the same source file. Quality is in the eye of the beholder of course and my eyes aren’t what they used to be. I don’t have an AMD based card to test with so for all I know it produces even better results.
You are on the right path though. Learn as much as you can about, run your own tests and determine what works best for you. You will find that you are constantly tweaking it to get even better results and in pursuit of the best quality to size threshold for you. Below are some resources to help you get started.
https://www.videohelp.com/ Has been around forever and a great community.
https://discussion.mcebuddy2x.com/c/support/hardware-encoding/23 The hardware encoding forum right here is also a great resource.

Do research on Handbrake and ffmpeg. They will be the primary source of the conversion used in the MCEBuddy profiles. I personally use handbrake but that is because I’m more familiar with it. ffmpeg is a great tool to but my understanding of it is more limited.

Another thing that I’m not very familiar with is commercial removal. But the forums here are a great source of information and guidance.

Hope that helps. Don’t be afraid to ask questions. I try to help out on these forums as much as I can in my free time but there are plenty of people doing the same. One tip I suggest. Turn on debug logging and attach the conversion log when asking questions about a conversion. The logs help so much in understanding what MCEBuddy is doing and can help pinpoint information.

I prefer ffmpeg over Handbrake and my testing with it has proven to make files smaller than H.264 with the same or higher quality with settings that I cannot get to work with MCEBuddy…they work with FFmpeg Batch AV Converter which I can run 4 encodings at once with my system remaining usable. If I use MCEBuddy I cannot use my settings because no one will help me get them to work with MCEBuddy because I have experimented and I don’t understand how MCEBuddy passes the settings on to the GPU. The default HEVC profile in MCEBuddy is inadequate not only because it produces lower quality but it also uses software to handle the de-interlacing which not only slows down the encodes it also uses more system resources so I can only run 2 encodes at the same time to keep my system usable.

The settings I use in FFmpeg Batch AV Converter are as follow:

-c:v hevc_nvenc -c:a copy -preset hq -rc constqp -rc-lookahead 60 -spatial_aq 1 -temporal_aq 1 -nonref_p 1 -cq 26

The problem is FFmpeg Batch doesn’t do all the things MCEBuddy can and will do so I don’t like to use it because too many things in the process then become manual and I simply don’t have time or space to do it this way so I want these settings to work in MCEBuddy…except for the -c:a copy because that simply copies the audio tracks as FFmpeg Batch won’t re-encode those as MCEBuddy will.

The following profile is the one I use at the moment and it is the one you SystemIdleProcess provided me months ago except I have set ffmpeg first because I don’t like Handbrake as it consumes too many system resources:

[HEVC MKV AnyStream NVidia]
Description=HEVC in MKV hardset to use NVidia.
order=ffmpeg,handbrake
DisableEncoderReordering=true
ffmpeg-general=-threads 0
ffmpeg-video=-ss 0 -vf yadif=0:-1:1,hqdn3d -vcodec hevc_nvenc -preset hq -crf 26 -vsync 2 -map 0:v -sn
ffmpeg-audio=-acodec ac3 -map 0:a
ffmpeg-audioac3=-acodec copy -map 0:a
ffmpeg-ext=.mkv
ffmpeg-audiodelay=skip
ffmpeg-UsingHardwareEncoding=true
ffmpeg-DisableSoftwareEncoderFallback=true

The biggest problem with this profile are everything before "hevc_nvenc are software settings so they are run in software which is inefficient because you can have the GPU do these. The other problem is the -crf 26 value is once again a software setting so totally ignored by the GPU so I can only assume that with this profile the nVidia GPU is using the default settings.

I even tried just changing the -crf 26 to the correct -cq 26 value for hardware settings but there was no difference in the results encoding. I even changed the -cq value lower and lower with no change so I have no idea how MCEBuddy is passing parameters to the GPU because nothing makes a difference.

I tried my setting from FFmpeg Batch above in the MCEBuddy profile by simply taking out the audio parameters and using them as the only parameters in the ffmpeg-video line and while MCEBuddy encoded the file I tested the result was black video with sound…so I have no idea how to pass parameters onto the GPU.

I don’t know what to do at this point. I prefer MCEBuddy over all other software I’ve used for encoding but the default HEVC settings for hardware acceleration are unacceptable for any movie that has dark scenes and I have lots of horror movies. So I have not encoded anything for months now except movies I know will be fine with the current settings or ones for experimenting but I have to keep all my TS files until I can find a way to get my settings into MCEBuddy and I’m about out of space and tired of buying new hard drives so I may have to stop usingMCEBuddy because there is no documentation on how to actually change the settings in HW acceleration.

1 Like

If you open your conversion logs it’ll show the exact command line passed to ffmpeg. If you’re using a special build/version of ffmpeg you can always replace the version that ships with MCEBuddy in the installation directory.

If you’re creating a highly customized version of ffmpeg video and audio parameters and don’t want MCEBuddy to adjust any of them (MCEBuddy adjusts them based on your configuration you’ve set in the Converstion Task page like Quality sliders, Optimize video, Audio track selection etc), you can tell MCEBuddy to keep your profile parameters as is with these two ffmpeg directives (similarly for other encoders also):

You can pretty much do anything with MCEBuddy and I would highly recommend taking a look at this page for tweaking your settings: MCEBuddy - Advanced Settings, Commands and Tweaking

1 Like

Thank you goose I’ll have a look and play around and see what I can do. I just don’t know where to put my commands since editing the profiles seems to have almost no affect because I feel I’m doing it wrong…so I will likely be back. Thanks again, I really don’t want to switch away from MCEBuddy since it does all that I want but I’ve hit a fork where I need to customize it for it to meet my needs.

In the conversion log look for the text “Launching process”. This will appear numerous times in the log but look for the one that is doing the actual conversion task. Below it will have the arguments being passed. If this does not match your profile then they aren’t getting applied properly.

I’m still playing around with ffmpeg converting dark scenes into hevc. I think I have an okay profile now but the size isn’t shrinking enough for it to be worth it yet. But using hardware NVidia I was getting about 160 fps. I’ll post when I have a better profile and research the arguments more. ffmpeg is a beast of an application.

MCEBuddy does not work with my settings. I even upgraded it to the version of ffmpeg I used in FFmpeg Batch AV Converter and the results are the same. I get audio and subtitles but no video. The following is the line in the profile that passes the arguments to ffmpeg I am using…unsuccessfully in MCEBuddy but works fine in FFmpeg Batch, well everything past the hevc_nvenc is what I use in Batch excpet I add copy subs and copy audio

ffmpeg-video=-ss 0 -vf yadif=0:-1:1,hqdn3d -vcodec hevc_nvenc -preset hq -rc constqp -rc-lookahead 60 -spatial_aq 1 -temporal_aq 1 -nonref_p 1 -cq 26

Try this, open the Start Menu and start the MCEBuddy Command line engine and then try your profile (don’t forget to add what @Goose hinted to above to your profile so that it preserves your settings). Some drivers don’t support hardware encoding through the system process (service), they prefer a user process which is what the Command Line engine does, run the engine in the user space rather than service (system space).

RBoy…I can’t figure out how to do that and if I have to run a command line every time I want to encode something it’s time to leave MCEBuddy in the rear view mirror. If MCEBuddy can run my profile from the command line there is no reason it shouldn’t be able to from the GUI. I am using arguments in my profile that are all supported by ffmpeg directly from their list of those available for nvenc.

Nobody seems to want to answer my question. How does MCEBuddy pass on arguments to the GPU? The profile config file obviously doesn’t since not a single item in the default profiles are hardware specific commands…they are ALL SOFTWARE…and not compatible with GPU encoding. So when you choose Hardware Acceleration I can only assume that all you get are the DEFAULTS from either ffmpeg or handbrake…which is useless if you care about quality. I don’t want to use abritrary sliders and to pick quality…I want MY SETTINGS because they actually work.

SystemIdleProcess gave me the following profile (I am only showing the ffmpeg videa line)

ffmpeg-video=-ss 0 -vf yadif=0:-1:1,hqdn3d -vcodec hevc_nvenc -preset hq -crf 26 -vsync 2 -map 0:v -sn

The -crf 26 value is for software only, if I change only that line to the proper command -cq 26 then the profile actually makes a change except the quality still isn’t where I need it but if I run the following profile in FFmpeg Batch

-c:v hevc_nvenc -c:a copy -preset hq -vf yadif=0:-1:1 -rc constqp -rc-lookahead 60 -spatial_aq 1 -temporal_aq 1 -nonref_p 1 -cq 26

I get exactly the quality I need but I don’t get any of the other things I like from MCEBuddy but if I put this profile into the profile.conifg file

ffmpeg-video=-c:v hevc_nvenc -preset hq -vf yadif=0:-1:1 -rc constqp -rc-lookahead 60 -spatial_aq 1 -temporal_aq 1 -nonref_p 1 -cq 26

Which is the proper way to pass on arguments to ffmpeg for nVidia the result is I get audio only and no video AT ALL.

So @Goose no matter how many times you give me a canned answer to read something the info I need isn’t there or I don’t understand it. You keep telling me MCEBuddy can do everything I want but you won’t simply tell me how to get the settings I have included several times to work in MCEBuddy. That is all I want. I want to keep using MCEBuddy for many reasons. I have loved using it and that is why I bought it but I have not been able to use it for over 3 months now because I can’t get a simple two minute reply from anyone here with the knowledge I lack. I have over 12 TB and growing of stacked up TS files I cannot process.

PLEASE…I need five minutes of your time for an answer that actually works.

@Ronstang I’ve got a big queue processing at the moment but when I get a chance I’m going to try to help getting this working for you. Can you provide the last conversion log that didn’t work for you? Also, can you provide which GPU you have and what driver version you are using? I will try my best to help get you sorted out.

The good news is that I’m able to duplicate the issue. The bad news is I don’t know why it’s happening yet.

Try the following:

ffmpeg-video=-c:v hevc_nvenc -preset hq -vf yadif=0:-1:1 -rc constqp -rc-lookahead 60 -spatial_aq 1 -temporal_aq 1 -nonref_p 1 -cq 26 -map 0:v -sn

It was the map parameter missing that it didn’t like, not having for video when the audio was being mapped caused only the audio in the output.

Here is what I tested with:

[HEVC MKV ffmpeg NVidia]
Description=HEVC in MKV using ffmpeg hardware NVidia.
order=ffmpeg
DisableEncoderReordering=true
ffmpeg-general=-threads 0 -v verbose
ffmpeg-video=-c:v hevc_nvenc -preset hq -vf yadif=0:-1:1 -rc constqp -rc-lookahead 60 -spatial_aq 1 -temporal_aq 1 -nonref_p 1 -cq 26 -map 0:v -sn
ffmpeg-audio=-c:a ac3 -map 0:a
ffmpeg-audioac3=-c:a copy -map 0:a
ffmpeg-ext=.mkv
ffmpeg-audiodelay=skip
ffmpeg-UsingHardwareEncoding=true
ffmpeg-DisableSoftwareEncoderFallback=true

I made a mistake SystemIdleProcess…the de-interlacing filter should be the first thing after the argument setting hardware so it should read

ffmpeg-video=-c:v hevc_nvenc -vf yadif=0:-1:1 -preset hq -rc constqp -rc-lookahead 60 -spatial_aq 1 -temporal_aq 1 -nonref_p 1 -cq 26

yadif should be first because it is a decoder and everything else is an encoder argument

I am using an Asus GTX 1650 Super with driver 456.71

Try this profile then:

[HEVC MKV ffmpeg NVidia]
Description=HEVC in MKV using ffmpeg hardware NVidia.
order=ffmpeg
DisableEncoderReordering=true
ffmpeg-general=-threads 0 -v verbose
ffmpeg-video=-c:v hevc_nvenc -vf yadif=0:-1:1 -preset hq -rc constqp -rc-lookahead 60 -spatial_aq 1 -temporal_aq 1 -nonref_p 1 -cq 26 -map 0:v -sn
ffmpeg-audio=-c:a ac3 -map 0:a
ffmpeg-audioac3=-c:a copy -map 0:a
ffmpeg-ext=.mkv
ffmpeg-audiodelay=skip
ffmpeg-UsingHardwareEncoding=true
ffmpeg-DisableSoftwareEncoderFallback=true
1 Like

Where do I put the command

ffmpeg-VideoOptimized=True

At the end is fine. I didn’t put it in there because I wanted cropping to happen. I tested both ways and preferred to leave it out.