From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 0269747BCD for ; Tue, 3 Oct 2023 22:53:27 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 419EE68CB26; Wed, 4 Oct 2023 01:53:26 +0300 (EEST) Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 40B3F68C077 for ; Wed, 4 Oct 2023 01:53:19 +0300 (EEST) Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-59f2c7a4f24so22714077b3.0 for ; Tue, 03 Oct 2023 15:53:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696373597; x=1696978397; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HUEMQ3zuaKDGO/RdtKGYqCxMt7mof47xYNAwxySm8UA=; b=p73xXxehYRbAL3ON1Elo74B3xPOWnYCsMBm5bV/ch7QjMmaweVNCBoxAyfZZ2KvkQw evA35rwS+pQyGD30bV4NoVGmRdXxA6ztTmp2PtpTtVYCNdtBQvMsLWX1vS1yZNUtLKTi N972NaRjqdbGBXSk8R2nUoNx8qSOldi88KC8c9M0lj58XawTCeOXanRKEALxLf22oT4X uQLZ950+ELjRXIibHcT666LC8hjGHz92G8YUSPZuRWIRFPq8f/M7bTw2X/zccZ1u0Lzj Ow56XAed2NE6XOOooCTaizNbW3UTkXshUQe2h62JhKuaoXFCoHQ3M+tLue5lL62hPdGj PLKw== X-Gm-Message-State: AOJu0YyZzPz8fcT5JTSw40zmBNTwe4K/c7BT1rRKxoUH5LvBlshBSQLZ kty/B//JQukEWQ672SJe6LkXFx+Z6O8rGuJ4kL9wVXoH2ZLcUvIlkVc9j/tKKarZEzuojg1R+GD annO68Vk7hEBB9W9U2W2AH2fOnQm9417Xq290rJIe0dUIKJn9vGHRmO2ShsC+SAwBQlx1 X-Google-Smtp-Source: AGHT+IGKCw/nYmdzmaD7jMGhI6gAVGNiOUAZnvwMzyRTmE778aAYKJQ8QVYIUelyz8juO6F9SYdwoGM8MPxfhg== X-Received: from vigneshv3.mtv.corp.google.com ([2620:0:1000:2511:e58:8b17:6065:ec86]) (user=vigneshv job=sendgmr) by 2002:a81:a849:0:b0:577:619e:d3c9 with SMTP id f70-20020a81a849000000b00577619ed3c9mr20278ywh.10.1696373597373; Tue, 03 Oct 2023 15:53:17 -0700 (PDT) Date: Tue, 3 Oct 2023 15:53:06 -0700 In-Reply-To: Mime-Version: 1.0 References: X-Mailer: git-send-email 2.42.0.582.g8ccd20d70d-goog Message-ID: <20231003225313.407161-1-vigneshv@google.com> To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH] avcodec/svt-av1: Set force_key_frames only when gop_size == 1 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Vignesh Venkatasubramanian via ffmpeg-devel Reply-To: FFmpeg development discussions and patches Cc: Vignesh Venkatasubramanian Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: SVT-AV1 does not support requesting keyframes at arbitrary points by setting pic_type to EB_AV1_KEY_PICTURE. So set force_key_frames to 1 only when gop_size == 1. Please see the comments in https://gitlab.com/AOMediaCodec/SVT-AV1/-/issues/2076 for a bit more details. Signed-off-by: Vignesh Venkatasubramanian --- libavcodec/libsvtav1.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c index 5015169244..8d2c7f3be4 100644 --- a/libavcodec/libsvtav1.c +++ b/libavcodec/libsvtav1.c @@ -253,8 +253,13 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param, // In order for SVT-AV1 to force keyframes by setting pic_type to // EB_AV1_KEY_PICTURE on any frame, force_key_frames has to be set. Note // that this does not force all frames to be keyframes (it only forces a - // keyframe with pic_type is set to EB_AV1_KEY_PICTURE). - param->force_key_frames = 1; + // keyframe with pic_type is set to EB_AV1_KEY_PICTURE). As of now, SVT-AV1 + // does not support arbitrary keyframe requests by setting pic_type to + // EB_AV1_KEY_PICTURE, so it is done only when gop_size == 1. + // FIXME: When SVT-AV1 supports arbitrary keyframe requests, this code needs + // to be updated to set force_key_frames accordingly. + if (avctx->gop_size == 1) + param->force_key_frames = 1; if (avctx->framerate.num > 0 && avctx->framerate.den > 0) { param->frame_rate_numerator = avctx->framerate.num; -- 2.42.0.582.g8ccd20d70d-goog _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".