[FFmpeg-devel] [PATCH v2 1/1] avcodec/vaapi_encode: add frame-skip func

Mark Thompson sw at jkqxz.net
Tue Feb 26 02:01:37 EET 2019

On 22/02/2019 03:09, Sun, Jing A wrote:
> -----Original Message-----
> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] On Behalf Of Mark Thompson
> Sent: Thursday, February 21, 2019 5:35 AM
> To: ffmpeg-devel at ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH v2 1/1] avcodec/vaapi_encode: add frame-skip func
> On 20/02/2019 10:33, Jing SUN wrote:
>> This implements app controlled frame skipping in vaapi encoding. To 
>> make a frame skipped, allocate its frame side data of the newly added 
>> AV_FRAME_DATA_SKIP_FRAME type and set its value to 1.
>> Signed-off-by: Jing SUN <jing.a.sun at intel.com>
>> ---
>>  libavcodec/vaapi_encode.c | 112 ++++++++++++++++++++++++++++++++++++++++++++--
>>  libavcodec/vaapi_encode.h |   5 +++
>>  libavutil/frame.c         |   1 +
>>  libavutil/frame.h         |   5 +++
>>  4 files changed, 119 insertions(+), 4 deletions(-)
> Have a look at <https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2019-February/239989.html>, which tries to implement this feature in a more general way without adding any ad-hoc API.
> - Mark
> -----Original Message-----
> Hi Mark,
> I think the 239989 patch is quite a good one to implement VFR by adapting VAAPI frame-skip feature, but it does not fulfill the feature requirement that we have been asked to achieve, which is to skip the frames that are selected by apps, and the purpose to skip any frames is not just to control frame-rate, but also to skip duplicated ones, or to skip abandoned ones due to some changes just made, etc. Could we please keep both and let users decide which way they want to use?

I think these use-cases are all supported by the same method used for other encoders in libavcodec, by not sending the skipped frames to the encoder.  The linked patch is only wanted to fix the rate control in these cases - that's otherwise broken because VAAPI lacks any support for timestamps.

Can you explain a specific use-case which wants the extra message?

- Mark

More information about the ffmpeg-devel mailing list