View Full Version : Layman's Terms of x265 Settings?
HD MOVIE SOURCE
5th August 2022, 22:56
Hi,
I'll keep this pretty basic, I'm looking for more information on certain x265 settings, and what they do specifically. I find the x265 docs to be hit or miss on whether I understand them or not. I find that the information requires a pre-requisite of encoding knowledge. I just want to know in simple terms what they do.
Here's go's.
ref=
What does it mean? Can it impact quality?
and what does limit-refs= do?
Do these two settings work together?
annexb / aud / hrd
I think these are forced for UHD-BD. If they are forced and I don't need to know, that's fine.
QUESTION ABOUT LOOKAHEADS
gop-lookahead, rc-lookahead, lookahead-slices
Are lookaheads only good if scene detection is enabled? If scene detection is disabled are lookaheads absolutely useless or can there be a quality gain even when it doesn't take scenecut into account? The reason I ask is that I've heard scenecut isn't that great with x265, so could I avoid using it by scenecut=0?
So, again, if scenecut is turned off, is gop-lookahead, rc-lookahead, lookahead-slices immaterial?
no-intra-refresh, no-constrained-intra
What do they do, and what is the impact on quality?
SKIPS QUESTION
Anytime there is a command for skip of any kind, is that a literal comment? Meaning, it literally means it will skip something? So, no-early-skip means exactly what it says?
I think that's about it for now, any feedback is welcome.
Thank You,
Carl.
benwaggoner
9th August 2022, 18:56
ref=
What does it mean? Can it impact quality?
and what does limit-refs= do?
Do these two settings work together?
--ref is the number of reference frames. Higher is better quality, but somewhat slower. Maximum for any given Level is constrained by total frame area, so lower resolutions can use more.
--limit-refs is a performance optimization that helps the more reference frames are used, at a minor cost to quality.
annexb / aud / hrd
I think these are forced for UHD-BD. If they are forced and I don't need to know, that's fine.
Yes, use the defaults unless there is a specific platform reason to use something else.
QUESTION ABOUT LOOKAHEADS
gop-lookahead, rc-lookahead, lookahead-slices
Are lookaheads only good if scene detection is enabled? If scene detection is disabled are lookaheads absolutely useless or can there be a quality gain even when it doesn't take scenecut into account? The reason I ask is that I've heard scenecut isn't that great with x265, so could I avoid using it by scenecut=0?
So, again, if scenecut is turned off, is gop-lookahead, rc-lookahead, lookahead-slices immaterial?
--rc-lookahead is always useful, as it is looking into the future to predict optimal bits per frame allocation. Thus it allowed for bitrate to be lowered at the end of an easy to encode shot in advance of a hard to encode shot. Higher is always better quality, although with a moderate impact on encoding time and a major impact on RAM requirements while encoding.
no-intra-refresh, no-constrained-intra
What do they do, and what is the impact on quality?
Leave them alone unless you're doing a specific use case that needs them. --intra-refresh replaces having a full IDR each GOP with periodically ensuring that any given CU gets a full intra-only encode periodically. This is helpful for lossy real-time streaming for video conferencing, but harmful for pretty much anything else.
I'm not sure of any real use case for --constrained-intra.
SKIPS QUESTION
Anytime there is a command for skip of any kind, is that a literal comment? Meaning, it literally means it will skip something? So, no-early-skip means exactly what it says?
These are options for early skip optimizations. These are quality/speed tradeoffs, where x265 will less exhaustively test the myriad options for how to encode something, and more quickly pick a "good enough" option. You can see how they are used in the faster presets but not slower. Ignore them if you don't care about speed. But there can be some good tradeoffs. With cel animation content, for example --tu-intra 4 --tu-inter 4 --limit-tu 4 will generally offer a good quality boost relative to performance hit. But it wouldn't help much at all for grainy natural image content. Adding --limit-tu provides that early exit, so that grainy content has less a performance impact from the higher --tu-int?? values while still preserving most of the benefit for animation content.
Similarly, using --limit-modes can reduce the speed loss of using --amp and --rect enough that they provide most of the benefit and an acceptable speed versus not using them at all.
rwill
9th August 2022, 19:31
--intra-refresh replaces having a full IDR each GOP with periodically ensuring that any given CU gets a full intra-only encode periodically. This is helpful for lossy real-time streaming for video conferencing, but harmful for pretty much anything else.
I'm not sure of any real use case for --constrained-intra.
Just for clarity....
Intra prediction is using neighboring pixels to form a prediction. If one replaces keyframes with some moving intra only pattern to recover at a random access the preceding reference pixel part is broken. Constraining intra prediction to intra only neighboring pixels within the frame makes it possible to recover a complete picture over a 'couple' of pictures because the broken inter part is slowly overwritten by the intra pattern.
It would be even better if x265 would prevent new parts of the picture to not use parts of the picture that were sent before the current intra refresh column pattern as inter prediction. I do not think x265 does that yet sadly.
HD MOVIE SOURCE
12th August 2022, 22:07
--ref is the number of reference frames. Higher is better quality, but somewhat slower. Maximum for any given Level is constrained by total frame area, so lower resolutions can use more.
--limit-refs is a performance optimization that helps the more reference frames are used, at a minor cost to quality.
Yes, use the defaults unless there is a specific platform reason to use something else.
--rc-lookahead is always useful, as it is looking into the future to predict optimal bits per frame allocation. Thus it allowed for bitrate to be lowered at the end of an easy to encode shot in advance of a hard to encode shot. Higher is always better quality, although with a moderate impact on encoding time and a major impact on RAM requirements while encoding.
Leave them alone unless you're doing a specific use case that needs them. --intra-refresh replaces having a full IDR each GOP with periodically ensuring that any given CU gets a full intra-only encode periodically. This is helpful for lossy real-time streaming for video conferencing, but harmful for pretty much anything else.
I'm not sure of any real use case for --constrained-intra.
These are options for early skip optimizations. These are quality/speed tradeoffs, where x265 will less exhaustively test the myriad options for how to encode something, and more quickly pick a "good enough" option. You can see how they are used in the faster presets but not slower. Ignore them if you don't care about speed. But there can be some good tradeoffs. With cel animation content, for example --tu-intra 4 --tu-inter 4 --limit-tu 4 will generally offer a good quality boost relative to performance hit. But it wouldn't help much at all for grainy natural image content. Adding --limit-tu provides that early exit, so that grainy content has less a performance impact from the higher --tu-int?? values while still preserving most of the benefit for animation content.
Similarly, using --limit-modes can reduce the speed loss of using --amp and --rect enough that they provide most of the benefit and an acceptable speed versus not using them at all.
Thank you Ben, that really helps.
HD MOVIE SOURCE
25th August 2022, 18:19
--ref is the number of reference frames. Higher is better quality, but somewhat slower. Maximum for any given Level is constrained by total frame area, so lower resolutions can use more.
--limit-refs is a performance optimization that helps the more reference frames are used, at a minor cost to quality.
Does --limit-refs=0 mean that there's no optimizations? If I set limit-refs=1 does that mean it only uses 1 reference frame?
Selur
25th August 2022, 19:17
No, limit-refs does not limit the amount of reference frames it potentially restricts the calculation of references.
Note that references are not the same as reference-frames.
limit-refs=0 <> references will be fully calculated, the higher the limit-refs value the more the calculation will be limited and the faster it goes.
=> limit-refs will cause slower encoding but potentially result in more ideal references.
HD MOVIE SOURCE
27th August 2022, 04:53
No, limit-refs does not limit the amount of reference frames it potentially restricts the calculation of references.
Note that references are not the same as reference-frames.
limit-refs=0 <> references will be fully calculated, the higher the limit-refs value the more the calculation will be limited and the faster it goes.
=> limit-refs will cause slower encoding but potentially result in more ideal references.
Okay, makes sense now, thank you.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.