[FFmpeg-devel] [PATCH v4 1/2] lavc/vaapi_encode: add support for maxframesize

Andriy Gelman andriy.gelman at gmail.com
Sat Mar 26 17:20:39 EET 2022


On Wed, 23. Mar 08:51, Wang, Fei W wrote:
> > -----Original Message-----
> > From: Wang, Fei W <fei.w.wang at intel.com>
> > Sent: Tuesday, March 22, 2022 10:11 PM
> > To: ffmpeg-devel at ffmpeg.org
> > Cc: Linjie Fu <linjie.fu at intel.com>; Wang, Fei W <fei.w.wang at intel.com>
> > Subject: [PATCH v4 1/2] lavc/vaapi_encode: add support for maxframesize
> > 
> > From: Linjie Fu <linjie.fu at intel.com>
> > 
> > Add support for max frame size:
> >     - max_frame_size (bytes) to indicate the max allowed size for frame.
> > 
> > If the frame size exceeds the limitation, encoder will to control the frame size by
> > adjusting QP value.
> >     - MFS_NUM_PASSES to indicate number of passes for QP adjust.
> >     - MFS_DELTA_QP to indicate adjust qp value per pass.
> > 
> > To simplify the usage, default QP adjust is set to delta_qp[4] = {1, 1, 1, 1}.
> > Use new_qp for encoder if frame size exceeds the limitation:
> >     new_qp = base_qp + delta_qp[0] + delta_qp[1] + ...
> > 
> > ffmpeg -hwaccel vaapi -vaapi_device /dev/dri/renderD128 -f rawvideo \
> >         -v verbose -s:v 352x288 -i ./input.yuv -vf format=nv12,hwupload \
> >         -c:v h264_vaapi -profile:v main -g 30 -bf 3 -max_frame_size 40000 \
> >         -vframes 100 -y ./max_frame_size.h264
> > 
> > Max frame size was enabled since VA-API version (1, 3, 0), but query is available
> > since (1, 5, 0). It will be passed as a parameter in picParam and should be set for
> > each frame.
> > 
> > Signed-off-by: Linjie Fu <linjie.fu at intel.com>
> > Signed-off-by: Fei Wang <fei.w.wang at intel.com>
> > ---
> > 1. re-send the 2 legacy patch:
> > https://patchwork.ffmpeg.org/project/ffmpeg/patch/20190715105936.4860-1-
> > linjie.fu at intel.com/
> > https://patchwork.ffmpeg.org/project/ffmpeg/patch/20190715110000.5069-1-
> > linjie.fu at intel.com/
> > 
> >  libavcodec/vaapi_encode.c | 67
> > +++++++++++++++++++++++++++++++++++++++
> >  libavcodec/vaapi_encode.h | 19 +++++++++--
> >  2 files changed, 84 insertions(+), 2 deletions(-)

Hi,

> 
> Hi Andriy,
> 
> Is there any way to know the details of failure for this patch? Like OS, configuration,
> gcc version, etc. It looks good on my local Ubuntu with gcc 9.3, but show fails in patchwork checks:
> https://patchwork.ffmpeg.org/project/ffmpeg/patch/20220322141119.595627-1-fei.w.wang@intel.com/
> 

I don't think it was a real issue. I was upgrading the x86 runner at the time.

-- 
Andriy


More information about the ffmpeg-devel mailing list