On Vr, 2024-01-26 at 12:28 +0800, Xiang, Haihao wrote: > From: Haihao Xiang <haihao.xi...@intel.com> > > The runtime doesn't set the frame type to MFX_FRAMETYPE_IDR on the > returned mfx bitstream for a keyframe, it set the frame type to > MFX_FRAMETYPE_I only. This patch added workaround for VP9 keyframe to > make the coded stream seekable. > > Signed-off-by: Haihao Xiang <haihao.xi...@intel.com> > --- > libavcodec/qsvenc.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c > index a0144b0760..c63b72e384 100644 > --- a/libavcodec/qsvenc.c > +++ b/libavcodec/qsvenc.c > @@ -2578,9 +2578,11 @@ int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext > *q, > if (qpkt.bs->FrameType & MFX_FRAMETYPE_IDR || qpkt.bs->FrameType & > MFX_FRAMETYPE_xIDR) { > qpkt.pkt.flags |= AV_PKT_FLAG_KEY; > pict_type = AV_PICTURE_TYPE_I; > - } else if (qpkt.bs->FrameType & MFX_FRAMETYPE_I || qpkt.bs->FrameType > & MFX_FRAMETYPE_xI) > + } else if (qpkt.bs->FrameType & MFX_FRAMETYPE_I || qpkt.bs->FrameType > & MFX_FRAMETYPE_xI) { > + if (avctx->codec_id == AV_CODEC_ID_VP9) > + qpkt.pkt.flags |= AV_PKT_FLAG_KEY; > pict_type = AV_PICTURE_TYPE_I; > - else if (qpkt.bs->FrameType & MFX_FRAMETYPE_P || qpkt.bs->FrameType & > MFX_FRAMETYPE_xP) > + } else if (qpkt.bs->FrameType & MFX_FRAMETYPE_P || qpkt.bs->FrameType > & MFX_FRAMETYPE_xP) > pict_type = AV_PICTURE_TYPE_P; > else if (qpkt.bs->FrameType & MFX_FRAMETYPE_B || qpkt.bs->FrameType & > MFX_FRAMETYPE_xB) > pict_type = AV_PICTURE_TYPE_B;
Will apply, - Haihao _______________________________________________ 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".