HEVC quality vs speed slider, much trial and error!

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
Trypt
Posts: 12
Joined: Mon Dec 19, 2016 3:05 am

HEVC quality vs speed slider, much trial and error!

Post by Trypt »

So, like most, I'm obsessed with HEVC, specifically x265 for now since that is what HB does, and after using PAVtube for a while and then finding this and instantly felt belittled and like an amateur, I dove right into HB.

Naturally, I used the avg bitrate 2pass at first, thinking average must mean that a still scene of a few seconds will take much less kbps than a same length action scene, which is probably right, but then I read that indeed I was still an amateur and I shouldn't be using the advanced tab on with FAST and certainly SHOULD be using the quality slider instead of the avg. bitrate 2-pass method. I still don't know why it says "Use Advanced Tab Instead" and then grays out the speed options, so where is that advanced tab anyway?

So anyway, I started using the speed slider and the quality slider, and I always set the speed to slow, and experimented, until I read a guide and again felt like a fool.. It said that there is no difference between slow and medium, just use medium and focus on the quality slider more. So this is what my post is about, which one of the two is the bing bing, because in my experience the speed slider does wonders, albeit at a rate that your cat would appreciate, lol.

So the guide, it's online, you probably saw it, I started using the slider and had some fun, and at first I did not notice the bottom left and left that on FAST and Advanced (hey, it says advanced, so it must be great), that didn't last long. So advanced is off now, I used SLOW for a long time, with PICTURE tab on strict, FILTERS all off, and between 20 to 23 for x264 to hevc encoding. All was fine until I found a guide and read it.

So it appears the guide says medium and slow makes no difference, and that 22 is pretty much as low as you should go, no way I thought.. Tried and, and it looked good so I used it, but now I am not so sure, so here is the question:

Which is the stronger indicator of quality and size at the end, the speed of encoding or the slider? For example, I encoded 400MB 30min (pretty high quality) avc1 on MEDIUM speed with 22 or 21 on the slider and it looked good. But then I went back to slow since I don't care about time (very slow is MUCH TOO SLOW HOWEVER) and put it to 22 and found out that the quality is not only better, the file is smaller, so definitely there's a difference between medium and slow.

So, I'm here because I know you guys have played around for so long now that there should be a HB standard by now, for example, for 720 TV show (40+min) Dimension rips (0.8-1.2GB), there has to be a set way to get the file down to around 300MB with no visible loss in quality in a reasonable time, and how about a 1080p 2.5GB 264 rip (AVS or KILLERS whatever) (shows are usually 42-50 mins) , same settings?

I find I don't mess with Frames if the source is 25fps or below, if it is 60fps, you have to convert it or it won't play smoothly. I also find that making a video larger than source doesn't make sense, and really making it smaller doesn't make sense either unless you want it specifically for a phone or small video device.

So, if time is not that important, is there some rule of thumb as to how much slider to move as opposed to speed of encoding for the same quality? Like I said, very slow is way too slow, I tried it today and while it made a 1.2GB file into a 130MB file of quality that is the same to all except those that come up close to check on every pixel, it took all night and my queue of 8 was only on the third file, so I stopped that. The slider was on 22.

So, could medium 19 for example do the same thing, but also take a lot of time? Just by looking at it, the time slider seems to be very important as I cannot see a medium setting with 20 slider making a 130mb file with the same quality as the 1.2gb source.

Right now my go-to setting for movies and shows encoded x264 by groups that know what they're doing are: Strict ratio (same size video), no filters, and on the VIDEO I have HEVC selected, Variable or Peak FPS with same as source, then SLOW for time, and 22 for quality, and it seems to work for me. But would perhaps MEDIUM and 21 be faster and the same quality? IDK!

Thank you.
Trypt
Posts: 12
Joined: Mon Dec 19, 2016 3:05 am

Re: HEVC quality vs speed slider, much trial and error!

Post by Trypt »

Ok, nobody read my essay above, I know it's too much, so hear it is in a much clearer and shorter way:

When encoding a group release show or movie x264, which is the more relevant to quality and size, the speed slider on the bottom left or the quality slider on the top left? I tried to encode the same video 4 ways, I used Medium 20 and Medium 22, and then Slow 21 and Slow 23. Both the mediums were larger than then two slows, but the slows seem to be better quality, even the slow 23 seemed better than the medium 20, with a 30MB smaller file (180MB vs 210MB, from a 700MB source 720p).

I timed them and of course medium was much faster, but slow is not so slow as to be annoying. I tried very slow and that takes a very long time, maybe I can use that for a special huge BD rip that can last a whole night and I want the best possible quality but still fit on a dvd (so 4GB), I have no experience with this but I'm guessing that a 50GB movie on very slow to be 4GB would have to be set to what, about 24 quality on the slider?

And lastly, why does it say "use advanced tab instead" when clearly everyone says that in fact clicking that makes the whole thing basic as it greys out the speed slider? Naturally when I first started I used that and the avg. bitrate option thinking that is the more advanced way to go, until I read into it.

Playing around with sliders I found now that the perfect setting for me is slow and 22, it created a 80MB-100MB per episode file from 400MB source for old Spawn animated series that I have, and it looks identical to the source, whereas medium 21 or 20 created a bit larger files but to my eyes looked a bit worse than source. This leads me to believe that the speed slider is very important indeed! I don't know if I can ever use MEDIUM again!

Any opinion would be appreciated.
Deleted User 13735

Re: HEVC quality vs speed slider, much trial and error!

Post by Deleted User 13735 »

It's a mystery.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: HEVC quality vs speed slider, much trial and error!

Post by mduell »

More error than anything.
rollin_eng
Veteran User
Posts: 4840
Joined: Wed May 04, 2011 11:06 pm

Re: HEVC quality vs speed slider, much trial and error!

Post by rollin_eng »

Could you please post your logs, instructions can be found here:

viewtopic.php?f=6&t=31236
ddwrt
Posts: 9
Joined: Tue Dec 20, 2016 4:20 pm

Re: HEVC quality vs speed slider, much trial and error!

Post by ddwrt »

From the instruction I have read on this site - https://mattgadient.com/2013/06/12/a-be ... ake-0-9-9/ (recommend you to read it as well, by the way), what I understood was that speed slider doesn't really affect anything quality wise much (unless you choose the fast or especially ultra fast preset), rather than it can greatly affect the file size(!) So if you need the smallest file size possible, then choose the slowest preset. Also, as far as I understood, the RF (quality slider) overrides anything, so if you choose lower (more quality) value, then it overrides any extra setting you have chosen below which affects the quality (besides speed and any other profile/ preset) So the best bet for you is the lowest value.

Even though after reading this article - https://mattgadient.com/2014/01/06/hand ... craziness/ - this isn't as simple as I thought, so fast speed may give you lower size than slow or even slower one. So in the end it all depends on your video source (and probably hardware, as well as the version of handbrake)

Also if the time of conversion is not a problem for you, there are two new codecs added recently to handbrake.They are only available for nightlies as of now, and you may download them right here - viewtopic.php?f=11&t=34165 And they do exactly what I mentioned above: they manage to get the smaller file size with the higher quality. Also they are very useful for anime, as it seems, because when I encode anime DVDs using them (so far tried only H265 10bit), I almost don't have any interlacing, even though the functions/filters of deinterlacing (and similar) are turned off in the settings, while when I was using the simple H264, it was a pain to watch the result because of interlacing being everywhere in the video, and it required several filters (decomb, detelecine, etc) to be turned on to get rid of it (not completely morewise). It also somehow lacks most of the problems I had with H264, when trying to tune it, while here I didn't even change anything (except RF slider and speed preset), but as I said earlier, it takes A LOT of time to convert, compared to simple H264 or H265 codec. As of H265 codec, it is a new one, the succession of H264, so it may give you increase in quality versus H264. It is in the active development, so it will become even better in the future! It also has even more advanced version of codec, which supports 12 bit video (H265 12-bit). This one I didn't touch, so don't know how exactly it affects the image and file size, but it should also affect the quality of video in a better way. So you may try it as well.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: HEVC quality vs speed slider, much trial and error!

Post by JohnAStebbins »

*Generally* speaking, slower presets produce higher quality. But nothing is guaranteed when it comes to video encoding. Slower presets are slower because they enable more analysis of the video. The deeper analysis is used to make *hopefully* better decisions that will improve compression efficiency. But every algorithm can be fooled, so we can't say that slower is universally better. All we can say is that the vast majority of the time, slower is better.

Regarding RF and comparisons between different presets using the same RF, this is pretty much a fatally flawed comparison methodology. Slower with RF 22 *will* result in different quality output and different file size than Medium with RF 22 and the slower preset will not necessarily be higher quality or smaller file size. In fact it will often be higher quality and larger file size, which makes any comparison difficult since you can't say whether the preset resulted in higher quality or whether the larger file size accounts for the higher quality.

Think of RF as a relative quality metric. If you leave all other encoder settings the same, lower RF will result in higher quality. But if you change even a single other encoder setting, the meaning of RF changes and can no longer be used for meaningful comparisons with encodes that were performed with the old settings.

There are a couple comparison methodologies that are helpful in comparing the differences between presets. Using 2 pass average bitrate encoding instead of RF will allow you to visually inspect the differences between presets for a constant file size. You can also look at quality metrics that the encoder logs at the end of an encode if you enable the "ssim" or "psnr" tune options. You can find this information in the activity log. It can tell you something about the output quality even when it is difficult to distinguish with your eyes.

Example x264 SSIM log output:

Code: Select all

x264 [info]: SSIM Mean Y:0.9788696 (16.751db)
Example x265 SSIM log output:

Code: Select all

encoded 4263 frames in 43.47s (98.07 fps), 252.18 kb/s, Avg QP:26.54, SSIM Mean Y: 0.9709578 (15.370 dB)
ddwrt
Posts: 9
Joined: Tue Dec 20, 2016 4:20 pm

Re: HEVC quality vs speed slider, much trial and error!

Post by ddwrt »

JohnAStebbins wrote:Think of RF as a relative quality metric. If you leave all other encoder settings the same, lower RF will result in higher quality.But if you change even a single other encoder setting, the meaning of RF changes and can no longer be used for meaningful comparisons with encodes that were performed with the old settings.
Does it mean that changing other settings cancels the set RF value? Or does it apply only for several specific settings (like Encoder profile)?
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: HEVC quality vs speed slider, much trial and error!

Post by JohnAStebbins »

I used specific words for a reason. I said "the meaning of RF changes". I did not say "cancels the set RF value". The value is still set, what the value means has changed.
rreddell@gmail.com
Posts: 4
Joined: Wed Dec 09, 2015 5:50 am

Re: HEVC quality vs speed slider, much trial and error!

Post by rreddell@gmail.com »

My trial and error results. I have well over 1000 movies, plus the countless number of full seasons tv shows. My server is running right under 20TB.

I first started to transcode my collection using the x264 (Med, Film, High 4.0) using 10,300 Avg Bitrate, 2-pass w/ Turbo first pass ON in the MKV container. My thought process. Storage is cheap, and ripping and transcoding take up valuable time. In a year or two, I want to be able to watch the majority of my collection on an 80" 4K scaled up.

The past year, I have been using x265. I have a 4770K system, so it took me some playing around to find the best settings for me. I am getting around 15fps, and a typical 2-hour movie will take around 8 hours to transcode. I am at the point now, that if I buy and new movie, I will rip it and transcode it when I go to bed.

I have tried using the slider for quality, but it seems like the bitrate is all over the place. I am convinced that the 2-pass is the most important part.

Movies-
Action - War or movies that are classics/watch often - MKV container - x265 (med, None, Main) w/ Avg bite of 7300 2-pass w/ Turbo OFF. Audio AC3 640kb Dolby. This places the total at around 8000, and it looks amazing on my 65" plasma.

Love - Dramas - or movies for the wife - x265 (med, None, Main) w/ Avg bite of 2300 2-pass w/ Turbo OFF. Audio AC3 640kb Dolby.

TV - Docs - Kids shows-
x265 (med, None, Main) w/ Avg bite of 2300 2-pass w/ Turbo OFF. Audio AC3 640kb Dolby.

I have been slowly re-ripping my x264 movies to transcode into x265 to help save some space. If I had a little extra cash, I would swap out my server with new 8TB drives and rip in x264 med 2-pass at 10,300 like I started with. Those are around 1 hour for a 2-hour movie. VERY efficient.
Deleted User 13735

Re: HEVC quality vs speed slider, much trial and error!

Post by Deleted User 13735 »


I have tried using the slider for quality, but it seems like the bitrate is all over the place. I am convinced that the 2-pass is the most important part.
Ridiculous. That's exactly the reason you should use the quality slider. It OPTIMIZES THE BITRATE TO THE SOURCE DEMAND, not some magic number plucked out of thin air.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: HEVC quality vs speed slider, much trial and error!

Post by JohnAStebbins »

There is only one condition where ABR encoding should be used IMO. When you have a hard limit on file size (recording to a physical medium with limited space) or bandwidth and you know that the resulting quality will be less than desirable ahead of time. Then using ABR allows you to get the most quality from the limited space that you have.

But if you want to use the least amount of space while retaining a certain desired amount of quality, RF is the best way. RF will use exactly the bitrate necessary to meet your desired quality and no more. So the same RF value will encode cell animation to very small sizes while at the same time allow noisy grainy old films to get as big as necessary to preserve their quality.

If you want something that blends the best of both, look up vbv settings. vbv allows you to use RF but place a bitrate cap on it. This allows the encoder to use lower bitrate when it can, but prevents it from exceeding some upper limit.
Deleted User 13735

Re: HEVC quality vs speed slider, much trial and error!

Post by Deleted User 13735 »

To parrot the above, streaming media from one's own servers is a fitting use for ABR and conservative peak bitrates. I still like RF for portable media.
Trypt
Posts: 12
Joined: Mon Dec 19, 2016 3:05 am

Re: HEVC quality vs speed slider, much trial and error!

Post by Trypt »

Yeah, I definitely learned that 2pass is for amateurs, I've been playing for a long time with settings now since I posted, so here are my findings. Indeed, the speed slider is not consistent, I encoded the same source with everything the same (strict, audio pass through, video same as source fps), 6 times, 3 at slow at 20,21,22 and 3 at medium 20,21,22 and was expecting that a medium 20 will resemble a slow 21 or 22, but to my surprise, the slow encode of the 21 was actually a bigger file output than the medium 21, which really confused me. Suggesting of course that slow makes higher quality but also sometimes higher size, which makes sense, of course the opposite makes sense as well, slower meaning more time meaning smaller file, same quality, but I think it tries to make a higher quality encode so it's actually bigger.

This was with a 10GB BluRay rip in x264 to x265, the resulting files were 1.8gb to 2.1gb ..

Now, secondly, what is the MAIN or MAIN10 in the presets for in tune and preset fields under the speed slider, should I always leave it empty? And finally, subs, is there anyway to import SRT and handbreak leave them in SRT format, not convert them?

Thats all folks, hope it helped.
WhatZit
Experienced
Posts: 77
Joined: Sat Feb 13, 2016 2:45 am

Re: HEVC quality vs speed slider, much trial and error!

Post by WhatZit »

Trypt wrote:to my surprise, the slow encode of the 21 was actually a bigger file output than the medium 21, which really confused me. Suggesting of course that slow makes higher quality but also sometimes higher size, which makes sense, of course the opposite makes sense as well, slower meaning more time meaning smaller file, same quality, but I think it tries to make a higher quality encode so it's actually bigger.
Bingo. I don't think there's a serious user of x265 out there that hasn't spent hundreds of hours trialing settings, and earned themselves some valuable experience that wasn't in the manual.

Speaking of which... let me quote the manual on the "speed" presets:

Code: Select all

x265 has ten predefined --preset options that optimize the trade-off between encoding speed (encoded frames per second) and compression efficiency (quality per bit in the bitstream). The default preset is medium. It does a reasonably good job of finding the best possible quality without spending excessive CPU cycles looking for the absolute most efficient way to achieve that quality. When you use faster presets, the encoder takes shortcuts to improve performance at the expense of quality and compression efficiency. When you use slower presets, x265 tests more encoding options, using more computations to achieve the best quality at your selected bit rate (or in the case of –crf rate control, the lowest bit rate at the selected quality).
It's that last part that has duped the world into believing that the same CRF at slower presets should ALWAYS produce smaller filesizes. They don't. In fact, with my settings, they NEVER do.

The best way I've come to terms with the (often counter-intuitive) synergy between "Quality vs Speed" is to think of them BOTH as quality settings, with Constant Quality being the "Coarse" quality setting, and Encoder Preset being the "Fine" quality setting. I've forgotten the concept of "speed", and encode to a target quality, however long that takes or however big the file is (both within reason).

Check out this clumsily-constructed table documenting some 30 second .mkv samples I just whipped up before writing this:
  • 15,167,381 15,slow,good
    11,947,685 15,veryfast,above average
    8,076,664 21,faster,grain,good
    5,533,511 21,slow,average
    4,534,974 21,veryfast,below average
    2,479,024 28,slow,poor
    2,295,021 28,veryfast,poor
First is filesize, then CRF, then preset, then a SUBJECTIVE assessment of quality based on the presence (or not) of x265's notorious encoding artifacts, namely fine detail smoothing & edge warping/ringing.

You'll see that CRF28 doesn't produce much difference between veryfast & slow, because the coarse quality of 28 is so low to begin with that there's nothing left for the preset's fine adjustment to do. Basically, lower CRF's will be crap no matter what preset you use. Frankly, I'm astonished that x265's default CRF is 28.0!

CRF21 gives the fine adjustment much more to work with, and you can see that the slow preset may very well have removed unnecessary bits as per the manual blurb, but it found even MORE bits to include in the form of detail retention, for a net gain in filesize. So, it could be that the manual is half-true!

Coarse CRF15 gives the Fine Slow preset a HELL OF A LOT more to work with, hence a larger disparity between filesizes.

At this point, I'd like to explain my own personal discovery with --tune grain. I found that the x265 v2.0+ optimisations (total reworks in truth) to grain's rate control and quantisation allowed me to drop BACK a couple of notches in both CRF & speed and still maintain the same perceived-by-ME quality.

To my eyes, the 8mb CRF21 Preset Faster Tune Grain sample looks as good as the 15mb CRF15 Preset Slow sample, and it definitely looks better than all the rest.

I do cheat a little bit with regards to fine detail preservation by adding this to Extra Opts: deblock=-6,-6:strong-intra-smoothing=0

So, once you remember that x265's claims regarding slower presets and smaller CRF filesizes are bunk, you'll live a happier life.

BTW, if you REALLY want to investigate something counter-intuitive, start playing around with x265's deblock beta-pair! What the...?!?!?
Last edited by WhatZit on Fri Jan 06, 2017 11:02 pm, edited 1 time in total.
Trypt
Posts: 12
Joined: Mon Dec 19, 2016 3:05 am

Re: HEVC quality vs speed slider, much trial and error!

Post by Trypt »

Umm ok, so far I haven't added anything in the "other" command line parameters blank space at the bottom, but perhaps I should? Is there a guide maybe? And again, what is MAIN and MAIN10 in tune/preset under the speed slider but above the blank white box that you type the parameters in (Again, I never do).

I am still using the pre 1.0 version I don't know if I should upgrade since people are complaining. But I do find that sometimes I get skipping on my rips, they are not so smooth as the original, but that is only sometimes, most of the time it looks great. Oh, one more thing, deblocking? Really? But it looks so terrible when you turn it on in potplayer, of course that could be an altogether different thing.
WhatZit
Experienced
Posts: 77
Joined: Sat Feb 13, 2016 2:45 am

Re: HEVC quality vs speed slider, much trial and error!

Post by WhatZit »

Trypt wrote:Umm ok, so far I haven't added anything in the "other" command line parameters blank space at the bottom, but perhaps I should?
Yep, this: deblock=-6,-6:strong-intra-smoothing=0

At the very least, it won't hurt.
Is there a guide maybe?
Extra Options are usually named the same as x265's CLI commands. except without the dashes and with an equals sign to set the value. For example, the CLI option "--min-cu-size 16" becomes "min-cu-size=16". Multiple options are separated by colons, like my example above. Where you have a "no-" prefix on a binary option (as in, it's on or off), that's usually replaced by a zero value. For example, "--no-open-gop" becomes "open-gop=0".
What is MAIN and MAIN10 in tune/preset under the speed slider but above the blank white box that you type the parameters in (Again, I never do).
They are called profiles, which are packages of "standard" requirements for the encoded bitstream to possess so that it remains compatible with players that claim to support that profile. Setting it to "MAIN" enforces the main profile (GASP), which is about as widely compatible as you can get. Honestly, though, leave it at Auto.

MAIN10 is the 10-bit main profile. If you're using 10-bit x265, this is what will be selected by Auto. MAIN will be selected under 8-bits.
I am still using the pre 1.0 version I don't know if I should upgrade since people are complaining.
Anyone who uses x265 and is still on HB 0.10.5 absolutely should upgrade, bugs or not. Yes, the new version of HB has some quirks, but the superiority of the newer x265 makes up for them. Compile the Nightly if you can.
But I do find that sometimes I get skipping on my rips, they are not so smooth as the original, but that is only sometimes, most of the time it looks great.
That sounds like some sort of VFR frame dropping issue, or some inappropriate constant framerate conversion. Post a support question the next time you get a juddery encode.
Oh, one more thing, deblocking? Really? But it looks so terrible when you turn it on in potplayer, of course that could be an altogether different thing.
:) The deblocking I was talking about is internal to the x265 encoder. It's a totally different creature from the blur-everything deblock setting of your average player. But that's another story...
Deleted User 13735

Re: HEVC quality vs speed slider, much trial and error!

Post by Deleted User 13735 »

Message deleted by user.
Last edited by Deleted User 13735 on Fri Jan 06, 2017 4:18 pm, edited 1 time in total.
Deleted User 13735

Re: HEVC quality vs speed slider, much trial and error!

Post by Deleted User 13735 »

Paradoxical file size and speed comparisons are a normal byproduct of CQ/RF encoding and have been demonstrated since we first began playing with this stuff years ago. Has little to do with the HEVC encoder

This is old news. If you are interested in relative file size and speed, don't use RF!!
The inherent logic of this dictates that IF THE ONLY DEFINED CONSTANT IS A QUALITY TARGET, THEN ALL OTHER FACTORS, INCLUDING FILE SIZE AND SPEED, ARE RELATIVE, NOT INDEPENDENT!!
Always think like Spock when dealing with this stuff.

My seventh graders know that defining the value of Z gives no information about the relative values of X and Y, only their aggregate. What I'm reading clearly here is that you are more interested in file size and encode speed than quality, and yet you insist on playing in the other guy's sandlot. Want bandwidth control? There's a setting for that. Works great. Want relatively faster or slower encodes, ALL ELSE BEING EQUAL? There's a setting for that. Want to control file size and quality and speed independently, as if 3 determinable constants? I can promise it's not going to happen on this planet until you write the code.
Trypt
Posts: 12
Joined: Mon Dec 19, 2016 3:05 am

Re: HEVC quality vs speed slider, much trial and error!

Post by Trypt »

I have no idea what you're talking about or to whom, musicvid, if you read the OP you'll see that it's nothing about what you wrote.

Anyhow, whatzit, thank you for the info, it's very helpful indeed, I will try those settings for sure, and upgrade to 1.0 or the latest nightly build. I only encode into h265, nothing else, I'm so spoiled now that I can't even watch x264 anymore unless it's at LEAST 2GB per hour, and even then I prefer a x265 rip at less than half that if it's a proper encode, it just looks so much better, but that could also be MadVR, who knows, maybe it handles x265 better, but I get no artifacts or ringing like people are talking about, that is a x264 issue for me, it's day and night. For example, I had a 10GB group rip of Hateful 8 x264, a BDRip of the highest order, yet to me, the HEVC 3GB looked better in every respect (also from the same BD source).

And yes, I always use VFR, is that ok? You think maybe that is causing it? I just thought since I'm already using so much CPU why not make it work harder and not encode frames for black 5 second intros etc, but if CFR is better let me know. Either I leave it as same as source if it is 30fps or under, or I set it to 23.9xx if it is like 60fps since any 60fps encode into HEVC will not play on anything but a quantum super computer, lol.
WhatZit
Experienced
Posts: 77
Joined: Sat Feb 13, 2016 2:45 am

Re: HEVC quality vs speed slider, much trial and error!

Post by WhatZit »

Trypt wrote:it just looks so much better, but that could also be MadVR, who knows, maybe it handles x265 better, but I get no artifacts or ringing like people are talking about
MadVR does something that no other DirectShow video renderer does, to my knowledge: it actually UPSCALES properly rather than simply RESIZES.

The last time I looked at it, it even had the option of NNEDI3 with up to 256 Neurons! That is bloody impressive, but then you need bloody impressive GPU hardware to utilise that sort of processing in real-time.

MadVR also has enabled, by default, strong artifact removal algorithms which affect blocking, ringing & debanding. It also has interpolated frame rate conversion.

So, yes, the MadVR renderer in PotPlayer is definitely helping out with the picture quality.

I only wish I had the GPU needed to make it work beyond rudimentary levels :(
WhatZit
Experienced
Posts: 77
Joined: Sat Feb 13, 2016 2:45 am

Re: HEVC quality vs speed slider, much trial and error!

Post by WhatZit »

Trypt wrote:And yes, I always use VFR, is that ok?
If your target application or hardware supports VFR, then feel free to use it. If you can't spot null frames during playback, or detect milliseconds of audio desync, then feel free to use it. If you don't want to edit the file, or upload it to many streaming sites, then feel free to use it.

Anyway, next time you have a juddery encode, see what the framerate of the source is (using MediaInfo, for example).

If it's 30 or below and NOT Variable/Peak, try using "Same as Source" + "Constant Framerate".

If the source is VFR, select a specific framerate that's closest to the median + "Constant Framerate". Laughably, this is one of the most common solutions you'll find on Google when searching for a way to overcome all the problems you get with VFR encodes: "Convert VFR To CFR Using HandBrake" :)

If you have something with a frame rate over 30, it MIGHT be because a deinterlace process has doubled the original frame rate. Divide any >30 framerate by EXACTLY TWO, and set that as the new framerate. So 60 becomes 30, 50 becomes 25, 59.94 becomes 29.97, etc. "Constant Framerate", of course.

Note that framerates above 60 may be from sources that were rendered/recorded/mastered at that framerate. For example, UHD could have rates of 120, 119.88 or 100. In this case, you could divide by EXACTLY 4 to produce 30, 29.97 and 25 respectively.

I hope some of that helps.
Ayoross
Novice
Posts: 51
Joined: Mon Jun 11, 2012 9:07 pm

Re: HEVC quality vs speed slider, much trial and error!

Post by Ayoross »

WhatZit wrote:To my eyes, the 8mb CRF21 Preset Faster Tune Grain sample looks as good as the 15mb CRF15 Preset Slow sample, and it definitely looks better than all the rest.
Hello, this is quite surprising.
I usually use HEVC with RF20 at the 'very slow' preset to encode 1080p movies, with a ~1-2 fps throughput.
I've done some tests on "Alien 1", and all RF above 20 result in visible compression artifacts, but I never used the grain tuning.

Regarding your test, wouldn't the result be even better using CRF21, Preset slower and "tune grain" ?
WhatZit
Experienced
Posts: 77
Joined: Sat Feb 13, 2016 2:45 am

Re: HEVC quality vs speed slider, much trial and error!

Post by WhatZit »

Ayoross wrote:wouldn't the result be even better ...
To answer your question, yes, tunegrain at a slower preset would have definitely produced a perceptible increase in quality (it would have been BETTER than the CRF15 one)... but it would come at the expense of huge increases in processing time and filesizes.

Now, only YOU can decide what's "even better" quality-wise, and you can only do that by experimenting for yourself. Only YOU have YOUR eyes and YOUR perception, and you also have to weigh up quality against time and size. These are all YOUR personal requirements.

And, of course, your source files are another variable. For my quick samples, my source was a light grain scene from 1080P "Sum of all Fears" which had old men in nice suits (great for examining detail retention) sneering at each other in a medium contrast spot-lit conference room (great for examining edge resolution).

All I can tell you is that MY x265 quality observations are that tunegrain & -6,-6 dramatically reduces those ringing artifacts (you know the ones) at faster presets because tunegrain dramatically alters the way adaptive quant, psycho-visual discards and lookahead motion vectors work. At slower presets, that edge preservation is combined with improved rate controls for high-frequency elements (i.e. film grain, fine detail) which allocate more consistent bitrates across frames (thus increasing the overall bitrate/filesize significantly).

And it also turns off SAO (known "fondly" as Smooth All Objects)!

Now, you don't have to listen to anything I've said. In fact, you shouldn't! The whole point of this topic is to show how you need to experiment for yourself to get results YOU like.

Me, I LOVE tunegrain -6,-6! When I upgrade from my Sandy Bridge to one of the new Kaby Lake processors, I'm expecting to maintain my current encoding performance of 12fps (average) with even better CRF's and slower presets than I currently use, which means I'll never have to worry about inconsistent quality again.
Ayoross
Novice
Posts: 51
Joined: Mon Jun 11, 2012 9:07 pm

Re: HEVC quality vs speed slider, much trial and error!

Post by Ayoross »

I've done a few tests, and it seems the grain tuning increases the file size quite a lot. However, it clearly enhance greatly all details.

I've reencoded "Alien" with RF21, slow preset, tune grain and your specific deblock parameters. Then again with RF24.
At RF21, the result very convincing, but the video track is triple the size of the first RF20 very slow encode I made without grain tuning (5.9 GB vs 2.1 GB).
At RF24, details are still good, but I can note blocking artefacts and an overall rather bad quality. The video track has still a 3.0 GB size.
I'll test soon a RF21, fast preset with grain tune, to see how it affects quality and file size.

By the way, the deblocking parameter you add seem to weaken the deblock filter, what is the purpose ?
Post Reply