[FFmpeg-devel] [PATCH v3] libavcodec/qsvenc: Enable fixed QP configure in qsv CQP runtime

Anton Khirnov anton at khirnov.net
Mon Jul 4 09:45:13 EEST 2022


Quoting Chen, Wenbin (2022-07-04 08:33:49)
> > Why is this using frame metadata rather than the AVVideoEncParams side
> > data?
> 
> The usage of AVVideoEncParams relates to the "qp" variable in mfxEncodeCtrl which is passed
> to MFXVideoENCODE_encoderFrameAsync(). This variable in qsv is for per-frame QP
> configuration.
> There are other parameter changing supports I want to add besides QP, for
> example, gop_size, max_frame_size, intra_refresh. These parameter configurations are not
> all included in mfxEncodeCtrl, so I choose to use MFXVideoENCODE_Reset() to do this. This
> code changes the encoding parameters which means these changes are applied to all
> the following frames, but AVVideoEncParams is per-frame configuration, so I think
> AVVideoEncParams is not suitable for this.

AVFrame metadata is also per-frame, so your logic does not make sense to
me.

You could also just update the AVCodecContext/private context values
directly or using AVOptions.

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list