1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

lavc/qsvenc: respect user's setting for keyframes

For example:
./ffmpeg -hwaccel qsv -i input.mp4 -force_key_frames:v source -c:v
hevc_qsv -f null -

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
This commit is contained in:
Haihao Xiang 2024-05-23 10:24:36 +08:00
parent dbdd9ccded
commit c872ba5899

View File

@ -2482,7 +2482,7 @@ static int encode_frame(AVCodecContext *avctx, QSVEncContext *q,
if (frame->pict_type == AV_PICTURE_TYPE_I) {
enc_ctrl->FrameType = MFX_FRAMETYPE_I | MFX_FRAMETYPE_REF;
if (q->forced_idr)
if ((frame->flags & AV_FRAME_FLAG_KEY) || q->forced_idr)
enc_ctrl->FrameType |= MFX_FRAMETYPE_IDR;
}
}