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>
release/7.1
Haihao Xiang 7 months ago
parent dbdd9ccded
commit c872ba5899
  1. 2
      libavcodec/qsvenc.c

@ -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;
}
}

Loading…
Cancel
Save