Help with Optimal H.265 1080p settings

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
mduell
Veteran User
Posts: 8206
Joined: Sat Apr 21, 2007 8:54 pm

Re: Help with Optimal H.265 1080p settings

Post by mduell »

Did the encodes come out at the same bitrate with the same tune and the different ratecontrol methods? If not you're not comparing apples to apples.
Dysthymia
Posts: 24
Joined: Fri Nov 04, 2016 12:21 pm

Re: Help with Optimal H.265 1080p settings

Post by Dysthymia »

nhyone wrote: Thu Aug 03, 2017 5:15 am
Dysthymia wrote: Wed Aug 02, 2017 1:34 pm Actually, nhyone, despite the fact that my improper syntax failed to enable the extra options I was trying to use, I'm quite happy with the results.
It's okay to use whatever settings you like. It is always amazing when you start, it is only later that you realize the flaws. That's why I suggest to keep the source until you have a better understanding.

As mduell has pointed out, using a fixed average bitrate is not the right foot forward.

In your linked article, that user seems to be using PSNR/SSIM to judge the video quality? His log shows this:

Code: Select all

x265 [warning]: --psnr used with psy on: results will be invalid!
x265 [warning]: --tune psnr should be used if attempting to benchmark psnr!
:lol:

One way to start is to look at the x265 presets, what they set and compare each changed settings. You might get an idea what matters and what not, and if the quality is worth the time.
Is there a "best" objective way to determine quality?
Dysthymia
Posts: 24
Joined: Fri Nov 04, 2016 12:21 pm

Re: Help with Optimal H.265 1080p settings

Post by Dysthymia »

mduell wrote: Tue Aug 15, 2017 7:12 pm Did the encodes come out at the same bitrate with the same tune and the different ratecontrol methods? If not you're not comparing apples to apples.
I have yet to complete a re-encode from source with constant quality, I keep on starting over. One time was because the Windows 10 computer restarted without my permission (updates, whaddayagonnado?), and the last time was because I realized I needed to set Encoder Tune to Grain. I should have an answer in maybe three days.
Woodstock
Veteran User
Posts: 4621
Joined: Tue Aug 27, 2013 6:39 am

Re: Help with Optimal H.265 1080p settings

Post by Woodstock »

Do you really have to encode the whole video? Pick 10-30 seconds of "troublesome" video, and encode that section with different settings, and compare. Something with lots of motion and "because we can" detail.
mduell
Veteran User
Posts: 8206
Joined: Sat Apr 21, 2007 8:54 pm

Re: Help with Optimal H.265 1080p settings

Post by mduell »

Dysthymia wrote: Tue Aug 15, 2017 7:26 pmI have yet to complete a re-encode from source with constant quality, I keep on starting over. One time was because the Windows 10 computer restarted without my permission (updates, whaddayagonnado?), and the last time was because I realized I needed to set Encoder Tune to Grain. I should have an answer in maybe three days.
Use a shorter segment of video instead of wasting days.

Do the CRF/tune=grain encode, see what bitrate comes out.
Then do a bitrate/tune=grain encode, with the same bitrate target as came out above.

The results should be the same when you watch them.
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: Help with Optimal H.265 1080p settings

Post by BradleyS »

Also beware of the strong-intra-smoothing encoder option, which is enabled by default. This literally does what it sounds like, smoothing reference frames so they aren't too detailed compared to other frames, keeping bit rate more constant. It's a bad idea for high quality encodes, which is why we set strong-intra-smoothing=0 in the official presets that use x265.
nhyone
Bright Spark User
Posts: 252
Joined: Fri Jul 24, 2015 4:13 am

Re: Help with Optimal H.265 1080p settings

Post by nhyone »

Dysthymia wrote: Tue Aug 15, 2017 6:44 pm One thing I've learned is that (using 12-bit H.265) with a grainy source, when I go 2-pass/bitrate, I need to leave Encoder Tune set to None to retain that noisy detail. I tuned Grain and it looked worse. But when going constant quality (trying 30 and 32) if I leave the Encoder Tune at None it is blocky and horrible looking, so I need to set Encoder Tune to Grain to retain noisy detail. Why is that?
The average bitrate you use is insufficient to preserve grain.

CRF 30 and 32 are way too low, of course the video looks bad. If you choose tune grain, it will try to preserve the grain, bumping the bitrate up to do so.
WhatZit
Experienced
Posts: 77
Joined: Sat Feb 13, 2016 2:45 am

Re: Help with Optimal H.265 1080p settings

Post by WhatZit »

Dysthymia wrote: Tue Aug 15, 2017 6:44 pmBut when going constant quality (trying 30 and 32) if I leave the Encoder Tune at None it is blocky and horrible looking, so I need to set Encoder Tune to Grain to retain noisy detail. Why is that?
Read through this. It's about someone attempting to encode extremely low-bitrate (0.03bpp) 1080P HEVC whilst retaining some sort of quality, exactly what you're trying to do.

https://forum.doom9.org/showthread.php? ... ost1800266

I also answer your question about tune grain here. Pity my screenshot comparisons no longer exist :(

https://forum.doom9.org/showthread.php? ... ost1800348
nhyone
Bright Spark User
Posts: 252
Joined: Fri Jul 24, 2015 4:13 am

Re: Help with Optimal H.265 1080p settings

Post by nhyone »

BradleyS wrote: Tue Aug 15, 2017 8:47 pm It's a bad idea for high quality encodes, which is why we set strong-intra-smoothing=0 in the official presets that use x265.
Are you setting other parameters too?

The x265 parameters are tuned for clean lossless 4K source. They are different from the source we consumers normally use -- H.264 1080p. IMO, we need a different set of defaults. Posters in the doom9 thread have come up with various versions and I think some of those make a lot of sense.
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: Help with Optimal H.265 1080p settings

Post by BradleyS »

Slow encoder preset with strong-intra-smoothing=0. We also use rect=0 for speed but that may go away as CPUs get faster.

If you read the x265 source code, you'll see that strong-intra-smoothing performs a bilinear interpolation of the source frame(s). Essentially, it purposefully removes some fine detail for better encoding compression. Fine for general use, perhaps, but in my relatively extensive testing, it leads to blurry encodes and is not suitable for high quality / archival use.
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: Help with Optimal H.265 1080p settings

Post by BradleyS »

I should add, these settings are plain to see in the interface; simply select any official preset using the x265 encoder. HandBrake 1.0.0 and later.
Post Reply