From 64abde49dffd7ef80f77210f2b943388e4682be6 Mon Sep 17 00:00:00 2001
From: Alex Pokotilo <supp...@wmspanel.com>
Date: Wed, 14 Oct 2020 02:19:25 +0000
Subject: [PATCH] lavc/qsvenc: fix poor video quality with "-force_key_frames"

if run ffmpeg with "-force_key_frames" flag without this fix,
all new frames will have "MFX_FRAMETYPE_I | MFX_FRAMETYPE_REF"
after some time and video quality will become very poor.
Need to reset FrameType in free_encoder_ctrl_payloads.
---
 libavcodec/qsvenc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 1ed8f5d973..9e3c201416 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -1240,6 +1240,7 @@ static void free_encoder_ctrl_payloads(mfxEncodeCtrl* enc_ctrl)
             av_free(enc_ctrl->Payload[i]);
         }
         enc_ctrl->NumPayload = 0;
+        enc_ctrl->FrameType  = 0;
     }
 }
 
-- 
2.25.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to