From 5cd30d6a865e45756ecc97ed1546e6da0f064735 Mon Sep 17 00:00:00 2001 From: gxalpha Date: Mon, 28 Aug 2023 16:34:46 +0200 Subject: [PATCH] mac-videotoolbox: Set default keyframe interval to 2 seconds 0 seconds means "auto" according to the documentation, but this appears to be broken in many configurations (more than just CRF mode on Apple Silicon). With some encoders it means that the encoder sets a keyframes every 31st frame, other times it just doesn't set any keyframes at all after the first one, only rarely does the "auto" interval actually appear to work. Lets just set the default to 2 seconds and be happy. In theory this is the maximum keyframe interval and encoders are allowed to set more if they so wish, but they never appear to do so. --- plugins/mac-videotoolbox/encoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mac-videotoolbox/encoder.c b/plugins/mac-videotoolbox/encoder.c index f8b3ae0da..572435d58 100644 --- a/plugins/mac-videotoolbox/encoder.c +++ b/plugins/mac-videotoolbox/encoder.c @@ -1540,7 +1540,7 @@ static void vt_defaults(obs_data_t *settings, void *data) obs_data_set_default_bool(settings, "limit_bitrate", false); obs_data_set_default_int(settings, "max_bitrate", 2500); obs_data_set_default_double(settings, "max_bitrate_window", 1.5f); - obs_data_set_default_int(settings, "keyint_sec", 0); + obs_data_set_default_int(settings, "keyint_sec", 2); obs_data_set_default_string( settings, "profile", type_data->codec_type == kCMVideoCodecType_H264 ? "high"