[FFmpeg-devel] How to force key frame for h264_qsv encoder?

Chao Liu yijinliu at gmail.com
Wed Aug 3 01:46:15 EEST 2016


Need to add some code like following here
<https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/qsvenc.c#L941>
if (frame->pict_type == AV_PICTURE_TYPE_I) {
            enc_ctrl->FrameType = MFX_FRAMETYPE_I | MFX_FRAMETYPE_IDR |
MFX_FRAMETYPE_REF;
 }


On Mon, Aug 1, 2016 at 1:20 PM, Chao Liu <yijinliu at gmail.com> wrote:

> Hi,
> Looks like h264_qsv doesn't respect AVFrame.pict_type now.
> It always encodes to non-key frames except for the first frame.
> Is this a bug of ffmpeg or QSV doesn't support key frames?
>
> Command I use:
> ffmpeg -debug_ts -i orig.mp4 -force_key_frames 'expr:gte(t,n_forced)'
> -look_ahead 0 -c:v h264_qsv -b:v 800k -maxrate 1600k -preset faster test.mp4
>


More information about the ffmpeg-devel mailing list