Log in

View Full Version : x265: --rc-lookahead values?


Forteen88
6th July 2020, 13:20
I wonder, should I set the value of
--rc-lookahead
to the amount of frames per second the encode-video got?
Like 24 (or 2*24 3*24 and so on), if the source got 24FPS.
Or does that not matter?
Thanks.

charliebaby
6th July 2020, 13:45
max --rc-lookahead 60

excellentswordfight
6th July 2020, 16:21
Or does that not matter?
Thanks.
For very open I-frame placement cases were you have a large max keyint of say 10s of video, I have a hard time to believe that there will be any difference for most people if say 24 or 25 is used for 24p video. It will be pretty much the same case as if you wanna keep the default keyint at 25/250 or change it to "match" the fps, there will be some edge cases were it will do difference but most of the time it's probably an vanity setting.

However, I rarely use x265 for personal encoding, and is almost always using it with fixed GOP-sizes/chunks, and for that I always set the rc-lookahead to contain the whole GOP, which is always in multiples of the fps.

And personally when I do use it... Yeah I have some issues, I cannot stand min and max keyint, and lookahead to not be multiples of the fps. And since it doesn't really effect speed that much (more RAM usage and letancy) I usually go up to 2-4s, cause it does in fact change the slice decision in encodes when the value increases from the "normal" levels of around 20 to arround 40-60, and I guess thats its increased in the higher presets cause its beneficial.

max --rc-lookahead 60
Not sure what you wanna say with that post, it doesnt answer OP question and 60 is not the max value for the setting in question. Some context would've been nice.

benwaggoner
7th July 2020, 01:25
max --rc-lookahead 60
Max is --keyint. I think anything more than keyint minus min-keyint isn't going to do much. Using high values increase memory utilization a lot but don't seem to impact speed so much.

charliebaby
7th July 2020, 10:09
For very open I-frame placement cases were you have a large max keyint of say 10s of video, I have a hard time to believe that there will be any difference for most people if say 24 or 25 is used for 24p video. It will be pretty much the same case as if you wanna keep the default keyint at 25/250 or change it to "match" the fps, there will be some edge cases were it will do difference but most of the time it's probably an vanity setting.

However, I rarely use x265 for personal encoding, and is almost always using it with fixed GOP-sizes/chunks, and for that I always set the rc-lookahead to contain the whole GOP, which is always in multiples of the fps.

And personally when I do use it... Yeah I have some issues, I cannot stand min and max keyint, and lookahead to not be multiples of the fps. And since it doesn't really effect speed that much (more RAM usage and letancy) I usually go up to 2-4s, cause it does in fact change the slice decision in encodes when the value increases from the "normal" levels of around 20 to arround 40-60, and I guess thats its increased in the higher presets cause its beneficial.


Not sure what you wanna say with that post, it doesnt answer OP question and 60 is not the max value for the setting in question. Some context would've been nice.

I say max 60 because it is the best and added more it is useless except to decrease the speed of encoding :)

Forteen88
7th July 2020, 11:41
I say max 60 because it is the best and added more it is useless except to decrease the speed of encoding :)Except it really doesn't decrease speed of the encoding much at all, just a tiny bit. I did a test-encode and --rc-lookahead 85 only added like 15 seconds compared to a --rc-lookahead 48 encode that took 12:23 minutes.