HW H265 Constant Quality Profile

Hi all,

I’ve been trying to develop a H265 constant quality HW accelerated profile. The profile settings are below. I don’t see anything with NVEC in the logs however.

I’m running a 10 core i7 with a GeForce 1080 card. It takes approximately 90 minutes to encode an hour show. Task manager does not show anything on the GPU, but the CPU is pegged. I’m running the latest GeForce drivers and have the CUDA extensions installed. Does anyone see anything in the profile?

[----------------------]
[MKV Constant Quality]
Description=WARNING: Handbrake Constant Quality encoding (18).
order=handbrake
handbrake-UsingHardwareEncoding=true
handbrake-general=–decomb --denoise=“weak” --loose-anamorphic --verbose=2 -T -O
handbrake-video=–start-at duration:3 -e x265 -q 18
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

.
Are you referring to MCEBuddy logs? The profile looks okay

Yes - sorry - should have posted the logs. Link to the logs:

Recent recording: https://1drv.ms/u/s!AipRNNbyPsCgn4ZyBTgrnV0AWnwQ0A
MCEBuddy.log: https://1drv.ms/u/s!AipRNNbyPsCgn4ZznmEK_4tX_cN6Nw

Thanks! Will.

The logs show that MCEBuddy can’t access your file: (just look for “ERROR>” to see why something failed in a log)

ERROR> 2017-10-05T06:46:29 MCEBuddy.Engine.ConversionJob → PreMeta Source file has been renamed or deleted by custom command → \Disk8\Plex\TV\NOVA\Season 44\NOVA (1974) - S44E13 - Secrets of the Shining Knight.ts

Picked the wrong log - every time I update Windows, I need to re-enter my network credentials for the NAS in MCEBuddy.

Here’s a log for a successfully encoded file - doesn’t appear to be HW accelerated: https://1drv.ms/u/s!AipRNNbyPsCgn4cFjy30bTFOeTIAzQ

Is there something else I need to do? I’m running the latest drivers (387.78) and CUDA install (9.0).

One thing that jumps out to me in the logs is:

2017-10-06T01:58:52 MCEBuddy.Transcode.ConvertWithHandbrake --> Auto Enable Hardware Encoding : False

Is there a setting someplace I’m missing?

Thanks! Will.

That message is basically a direct reflection of your setting handbrake-UsingHardwareEncoding=true which tells MCEBuddy that the profile is enabled for optimized for hardware encoding so it should not change any hardware settings or auto enable hardware.

I should have caught this earlier, sorry. You’re using a NVIDIA GPU and NvEnc so you need to use a FFMPEG profile and not a handbrake profile.

Handbrake only supports Intel OpenCL where as FFMPEG supports NVIDIA NvEnc. Just translate your profile into ffmpeg and it should work.

Thanks. I find FFMpeg’s documentation a little dense. I think this is correct - can you verify?

[----------------------]
[MKV Constant Quality]
Description=WARNING: Handbrake Constant Quality encoding (18) with HVEC.
order=ffmpeg, handbrake
ffmpeg-general=-threads 0 -hwaccel auto
ffmpeg-video=-ss 3 -vf yadif=0:-1:1,hqdn3d -vcodec libx265 -q 18 
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 18 
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

Thanks! Will.

1 Like

Just note that in this case you’re using x265 but haven’t specified the hardware optimized for ffmpeg so MCEBuddy should automatically replace the codec at runtime.

Do I need to do anything to correct? Will it still do HW accelerated H265?

ahh - I need to add the ffmpeg-UsingHardwareEncoding=True, right?

If you add this then MCEBuddy will assume your profile is hardware ready and optimized and it will not make any changes to convert software encoding to hardware encoding. Yes MCEBuddy does support h.265 hardware encoding optimizations.

Right now your profile telling ffmpeg to use libx265 which is a software encoder.

So:

ffmpeg-video=-ss 3 -vf yadif=0:-1:1,hqdn3d -vcodec nvec_hevc -q 18

Thanks! Will.

1 Like

If you’re using ffmpeg-UsingHardwareEncoding=True yes that would be right.

First, thanks for the help. After a lot of trial and error, I got a profile that works for constant quality H265. Protip: the constant quality scale is different between H264 and H265.

[MKV HVEC Constant Quality]
Description=WARNING: Handbrake Constant Quality encoding (25) with Nvidia HVEC.
order=ffmpeg, handbrake
AllowH264CopyRemuxing=true
FixedResolution=true
SkipCropping=true
AutoDeinterlace=true
ffmpeg-UsingHardwareEncoding=True
ffmpeg-general=-threads 0 -hwaccel auto
ffmpeg-video=-ss 9 -c:v hevc_nvenc -crf 25 -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 18 
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

Secondly, will I break things if I replace FFMpeg with a Nvidia specific build?

Thanks! Will.

1 Like

Should not, you can try it. Curious, what build do you want to replace it with?

I replaced it with the latest FFMpeg Win64 Static build. It’s 3.3 - Until I did that (and after I upgraded to the latest of MCEBuddy), the hevc_nvenc codec didn’t work.

Is it possible to add a custom location for FFMpeg, a la what’s done for profiles or comskip?

Thanks! Will.

We’re upgrading the version of ffmpeg for the next release and adding more optimizations for hardware encoding. Will ping you if you’re interested in beta testing the NVENc stuff.

Would love to beta test. I’m already a donator…

via Newton Mail

1 Like

You can try out the latest 2.4.8 BETA build with the new ffmpeg and let me know it goes for nvenc encoding (hevc and x264).

Also I don’t think nvenc supports the -crf parameter if I’m correct, but you can try it out and let me know. See your logs for what you get.

Try using -cq instead of -crf and let me know if that works. Our nvidia machine fried itself so until we get a replacement, looking for some testers :slight_smile: (or if anyone’s willing to donate a NVIDIA pascal machine to us).