From 6ed2e139748b2288ece2da11b22bb67d5849df71 Mon Sep 17 00:00:00 2001 From: gxalpha Date: Mon, 28 Aug 2023 16:37:43 +0200 Subject: [PATCH] mac-videotoolbox: Remove CRF 0 second keyint override The previous commit sets the default configuration to 2 seconds, meaning that the 0 second default interval no longer happens per default. If someone explicitly sets the interval to 0 seconds ("auto"), we should allow them to do that. --- plugins/mac-videotoolbox/encoder.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/plugins/mac-videotoolbox/encoder.c b/plugins/mac-videotoolbox/encoder.c index 572435d58..b42e1f3c5 100644 --- a/plugins/mac-videotoolbox/encoder.c +++ b/plugins/mac-videotoolbox/encoder.c @@ -588,18 +588,6 @@ static bool create_encoder(struct vt_encoder *enc) if (enc->codec_type == kCMVideoCodecType_H264 || enc->codec_type == kCMVideoCodecType_HEVC) { - /* Apple's documentation states that a keyframe interval of 0 will result in - * the encoder automatically picking times to insert them; However, Apple's - * encoder, when in CRF mode, will never actually insert any keyframes past - * the very first one, rendering the files near-unusable in editors or - * video players. So to avoid that happening, enforce a reasonable default - * of 10 seconds in CRF mode. */ - if (enc->keyint == 0 && strcmp(enc->rate_control, "CRF") == 0) { - VT_BLOG(LOG_INFO, - "Enforcing non-zero keyframe interval in CRF mode"); - enc->keyint = 10; - } - // This can fail when using GPU hardware encoding code = session_set_prop_int( s,