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

BugMaster BugMaster at narod.ru
Tue Aug 29 19:44:22 CEST 2017


On Mon, 28 Aug 2017 10:21:25 -0700, Tom Vaughan wrote:
> We looked into this, and we concluded that scene detection is useful even
> for fixed GOP length encoding.  When the encoder detects scene changes in
> the lookahead, it can better understand where inter-prediction will work,
> and where it won't work (so it can avoid wasting time searching for
> inter-prediction modes that won't work).  It can also insert a non-IDR I
> frame at the start of the new scene, if that turns out to be more efficient
> than using a P frame (because the first frame at the start of a new scene is
> unlikely to find lower rdcost inter-prediction references to a previous
> frame, and a P frame that contains mostly I blocks compresses less
> efficiently than an I frame).

> We changed this behavior in x265.  So for x265, if you want fixed GOP
> lengths, you can just set max-keyint = keyint.  Scenecut is independent, and
> it's on by default.

Hi. Dunno about x265 (HEVC) but for x264 (H.264) all my benchmarks
showed that `--keyint 60 --no-scenecut` have higher quality than
`--keyint 60 --min-keyint 60` (patched to allow this). The only
exception was with --subme <= 2 due fast_intra mode condtion:
http://git.videolan.org/gitweb.cgi?p=x264.git;a=blob;f=encoder/analyse.c;h=036d6c15397d7a4dd6f1f1876427d0f4dfc86a96;hb=HEAD#l571

Probably this i_subpel_refine condition can be removed without much
speed loss.

P.S. There is no point in discussed behavior because encoding frame as
I-frame instead of P-frame with all intra is not more efficient (i.e.
there is no penalties for this). Also as this frames are not IDR but
only I-frames (i.e. not keyframes) there is no point in them for sync
or editing. There purpose of --min-keyint was not to close GOP due
flashes near previous scenecut and not to force fixed GOP.



More information about the x264-devel mailing list