-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Patch ffmpeg svtav1 to not force keyframes
Forcing keyframes makes the low delay mode (no b-frames) unavailable
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
.../scripts/Linux/ffmpeg-patches/0001-svtav1-Only-set-force_key_frames-when-gop_size-1.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
From 3ae6ccde35cbb6283e68173824446145fd37df1f Mon Sep 17 00:00:00 2001 | ||
From: Martin Piatka <[email protected]> | ||
Date: Wed, 27 Sep 2023 13:06:05 +0200 | ||
Subject: [PATCH] svtav1: Only set force_key_frames when gop_size <= 1 | ||
|
||
--- | ||
libavcodec/libsvtav1.c | 13 +++++++------ | ||
1 file changed, 7 insertions(+), 6 deletions(-) | ||
|
||
diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c | ||
index 5015169244..facafe05d1 100644 | ||
--- a/libavcodec/libsvtav1.c | ||
+++ b/libavcodec/libsvtav1.c | ||
@@ -249,12 +249,13 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param, | ||
// See: https://gitlab.com/AOMediaCodec/SVT-AV1/-/issues/2076 | ||
if (avctx->gop_size > 1) | ||
param->intra_period_length = avctx->gop_size - 1; | ||
- | ||
- // 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; | ||
+ else { | ||
+ // 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; | ||
+ } | ||
|
||
if (avctx->framerate.num > 0 && avctx->framerate.den > 0) { | ||
param->frame_rate_numerator = avctx->framerate.num; | ||
-- | ||
2.42.0 | ||
|