[x264-devel] Fixed GOP, keyint and keyint-min

Derek Buitenhuis derek.buitenhuis at gmail.com
Thu Aug 24 14:45:57 CEST 2017


On 8/24/2017 1:03 PM, Lars Kiesow wrote:
>> There is no point in having fixed GOP with scenecut enabled i.e.
>> if you want fixed GOP you SHOULD disable scenecut.
> 
> Can you elaborate a bit on this? Why does having I-frames in between
> IDR frames make no sense? What is the problem/disadvantage with that?

The confusion here is in your terminology. What you are asking for is
keyframes to be aligned on certain boundaries (e.g. every N seconds),
with additional keyframes on scene changes. This, by definition, is
*not* fixed GOP, since there may be shorter GOPs in betwen, which is
likely what BugMaster meant.

>> If you don't need really fixed GOP (usually less than 100 frames) but
>> only some sync points between different encodeds of same video (say
>> every 1000 frames) than you better use forced frame types (i.e.
>> qpfile way of x264 cli).
> 
> How would you do that? Would you just specify every Nth frame
> explicitly as to be an IDR frame, e.g.:
> 
> 100   I
> 200   I
> 300   I
> ...
> 10500 I
> --EOF--

Yes. In this case, you are better off using the x264 API or ffmpeg, if you
don't know the amount of input frames in advance, since they can set it more
dynamically (e.g. ffmpeg evals an expression, as you saw).

> Wouldn't that be the same as having a fixed GOP with scenecut enabled?
> After all in between additional I-frames could be inserted, …

No, see above.

> Or would you encode the file once and then take the frame types from
> the first encoding and enforce that for the following encodings as well
> (with the downside of not being able to encode in parallel)?

You should set keyint to infinite and also force keyframes (via API, qpfile,
or via ffmpeg cli) every N seconds. That's it.

- Derek


More information about the x264-devel mailing list