Log in

View Full Version : Equation as parameter values in x264


iAvoe
23rd February 2021, 02:55
Hi, I came across the option rceq='blurCplx^(1-qComp)' (involves 2 option values), and thought about the possibility of using equations as parameter value since x264 is not going to get major updates, I believe some coding can be added in source code to adapt this idea.

There are 3 options that usually requires manual calculation:
--rc-lookahead <multiple of fps (round)>
--keyint <multiple of fps (round)>
--min-keyint <dividing keyint (round)>

For example:
--rc-lookahead 3×fps
--keyint 9×fps
--min-keyint max(0.5×keyint, 1)

I have no idea about coding, so this question is more like a silly feature request for random people, but that would be a good improvement tho :sly:

benwaggoner
23rd February 2021, 19:21
This is an excellent suggestion! A simple implementation would require CFR so fps is known in advance.

From a parsing perspective, appending "sec" to the end of the int or float should be straightforward. So --keyint 5sec for a 5 sec keyint.

What do to about fractional framerates could be a little harder, ala 29.97 (really 30,000/1001). Using whole number seconds would periodically result in a GOP one frame shorter than the rest.

Perhaps "dropsec" for drop-frame seconds, so with both 30 and 29.97, you'd get a keyframe every 150 frames?