int arg_ctrls[ARG_CTRL_CNT_MAX][2];
int arg_ctrl_cnt;
int write_webm;
+ int have_kf_max_dist;
};
else if (arg_match(&arg, &kf_min_dist, argi))
config->cfg.kf_min_dist = arg_parse_uint(&arg);
else if (arg_match(&arg, &kf_max_dist, argi))
+ {
config->cfg.kf_max_dist = arg_parse_uint(&arg);
+ config->have_kf_max_dist = 1;
+ }
else if (arg_match(&arg, &kf_disabled, argi))
config->cfg.kf_mode = VPX_KF_DISABLED;
else
}
+static void set_default_kf_interval(struct stream_state *stream,
+ struct global_config *global)
+{
+ /* Use a max keyframe interval of 5 seconds, if none was
+ * specified on the command line.
+ */
+ if (!stream->config.have_kf_max_dist)
+ {
+ double framerate = (double)global->framerate.num/global->framerate.den;
+ if (framerate > 0.0)
+ stream->config.cfg.kf_max_dist = 5.0*framerate;
+ }
+}
+
+
static void show_stream_config(struct stream_state *stream,
struct global_config *global,
struct input_state *input)
if (!global.have_framerate)
global.framerate = input.framerate;
+ FOREACH_STREAM(set_default_kf_interval(stream, &global));
+
/* Show configuration */
if (global.verbose && pass == 0)
FOREACH_STREAM(show_stream_config(stream, &global, &input));