[x264-devel] gop

BugMaster BugMaster at narod.ru
Thu Dec 4 20:47:39 CET 2014


On Thu, 4 Dec 2014 15:35:58 +0800 (GMT+08:00), mm1201 at mail.ustc.edu.cn wrote:
> What is the api to set gop? 

Not fully understand what exactly in GOP you want to configure but
here are options that can be relevant:
1) param.i_keyint_max (--keyint cli option) to set *maximum* interval
between key-frames (IDR-frames for closed GOP);
2) param.i_scenecut_threshold (--scenecut / --no-scenecut cli options)
to configure sensitivity of scenecut detection algorithm which can
insert key-frame earlier than param.i_keyint_max so fixed key-frame
interval you may want to set it to zero;
3) param.i_bframe (--bframes cli option) to set *maximum* number of
*consecutive* B-frames;
4) param.i_bframe_adaptive (--b-adapt cli option) to choose algorithm
which decide when and how many B-frames to insert so fixed B-frame
pattern you may want to set it to X264_B_ADAPT_NONE (than it would
always use param.i_bframe consecutive B-frames if it not violate
key-frames placement);
5) param.i_bframe_pyramid (--b-pyramid cli option) if you need
references B-frames (x264 choose middle B-frame in consecutive
sequence to be referenced);
6) param.b_open_gop (--open-gop cli option) if you need open GOP;

7) pic_in.i_type (cli set them according to --qpfile option) to force
type of specific frame (can't violate param.i_keyint_max or
param.i_bframe limits).

For example, fixed IbBbPbBbPbBbPIbBbPbBbPbBbPI... presentation order
pattern will be:
param.i_keyint_max = 13;
param.i_scenecut_threshold = 0;
param.i_bframe = 3;
param.i_bframe_adaptive = X264_B_ADAPT_NONE;
param.i_bframe_pyramid = X264_B_PYRAMID_NORMAL;
param.b_open_gop = 0;



More information about the x264-devel mailing list