[FFmpeg-devel] [PATCH v2 01/11] vaapi_encode: Support more RC modes

Eoff, Ullysses A ullysses.a.eoff at intel.com
Wed Feb 6 04:09:13 EET 2019


> -----Original Message-----
> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] On Behalf Of Eoff, Ullysses A
> Sent: Tuesday, February 05, 2019 8:51 AM
> To: FFmpeg development discussions and patches <ffmpeg-devel at ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH v2 01/11] vaapi_encode: Support more RC modes
> 
> > -----Original Message-----
> > From: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] On Behalf Of Mark Thompson
> > Sent: Monday, February 04, 2019 1:26 AM
> > To: ffmpeg-devel at ffmpeg.org
> > Subject: Re: [FFmpeg-devel] [PATCH v2 01/11] vaapi_encode: Support more RC modes
> >
> > On 28/01/2019 04:23, Eoff, Ullysses A wrote:
> > >> -----Original Message-----
> > >> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] On Behalf Of Mark Thompson
> > >> Sent: Sunday, January 27, 2019 3:47 PM
> > >> To: ffmpeg-devel at ffmpeg.org
> > >> Subject: [FFmpeg-devel] [PATCH v2 01/11] vaapi_encode: Support more RC modes
> > >>
> > >> Allow setting the mode explicitly, and try to make a sensible choice
> > >> given the available parameters if not.
> > >> ---
> > >>  doc/encoders.texi         |  24 +++
> > >>  libavcodec/vaapi_encode.c | 370 +++++++++++++++++++++++++++-----------
> > >>  libavcodec/vaapi_encode.h |  65 +++++++
> > >>  3 files changed, 351 insertions(+), 108 deletions(-)
> > >>
> > >> ...
> > >>      if (rc_attr.value == VA_ATTRIB_NOT_SUPPORTED) {
> > >>          av_log(avctx, AV_LOG_VERBOSE, "Driver does not report any "
> > >> -               "supported rate control modes: assuming constant-quality.\n");
> > >> -        ctx->va_rc_mode = VA_RC_CQP;
> > >> -        return 0;
> > >> ...
> > >
> > > With this patch series, mjpeg_vaapi encoder breaks with iHD driver:
> > >
> > > LIBVA_DRIVER_NAME=iHD ffmpeg -hwaccel vaapi \
> > >   -vaapi_device /dev/dri/renderD128 -v debug \
> > >   -f rawvideo -pix_fmt yuv420p -s:v 1920x1080 \
> > >   -i input.yuv -vf 'format=nv12,hwupload' -c:v mjpeg_vaapi \
> > >   -global_quality 100 -vframes 10 -y output.mjpg
> > >
> > > <snip>
> > > [AVHWDeviceContext @ 0x193c580] Opened VA display via DRM device /dev/dri/renderD128.
> > > [AVHWDeviceContext @ 0x193c580] libva: VA-API version 1.4.0
> > > [AVHWDeviceContext @ 0x193c580] libva: va_getDriverName() returns 0
> > > [AVHWDeviceContext @ 0x193c580] libva: User requested driver 'iHD'
> > > [AVHWDeviceContext @ 0x193c580] libva: Trying to open /home/uaeoff/Work/workspace/media/install/lib/dri/iHD_drv_video.so
> > > [AVHWDeviceContext @ 0x193c580] libva: Found init function __vaDriverInit_1_4
> > > [AVHWDeviceContext @ 0x193c580] libva: va_openDriver() returns 0
> > > [AVHWDeviceContext @ 0x193c580] Initialised VAAPI connection: version 1.4
> > > <snip>
> > > [mjpeg_vaapi @ 0x19847c0] Input surface format is nv12.
> > > [mjpeg_vaapi @ 0x19847c0] Using VAAPI profile VAProfileJPEGBaseline (12).
> > > [mjpeg_vaapi @ 0x19847c0] Using VAAPI entrypoint VAEntrypointEncPicture (7).
> > > [mjpeg_vaapi @ 0x19847c0] Using VAAPI render target format YUV420 (0x1).
> > > [mjpeg_vaapi @ 0x19847c0] Driver does not report any supported rate control modes: assuming CQP only.
> > > [mjpeg_vaapi @ 0x19847c0] RC mode: CQP.
> > > [mjpeg_vaapi @ 0x19847c0] RC quality: 100.
> > > [mjpeg_vaapi @ 0x19847c0] RC framerate (CFR mode): 25/1 (25.00 fps).
> > > [mjpeg_vaapi @ 0x19847c0] Using intra frames only.
> > > [mjpeg_vaapi @ 0x19847c0] All wanted packed headers available (wanted 0x10, found 0x10).
> > > [mjpeg_vaapi @ 0x19847c0] Failed to create encode pipeline configuration: 10 (attribute not supported).
> > > Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as
> > bit_rate, rate, width or height
> > > [AVIOContext @ 0x1987000] Statistics: 0 seeks, 0 writeouts
> > > [AVIOContext @ 0x19802c0] Statistics: 3110400 bytes read, 0 seeks
> > > Conversion failed!
> > >
> > > ... it works fine on i965 driver.
> >
> > Right, the specific workaround to not set any options on drivers which report no supported RC modes (highlighted above) needs to
> be
> > carried forward to this.  Added.
> >
> > Thank you for testing!
> >
> 
> Is there a v3 I can test?  Thanks.

FYI, we just released vaapi-fits (https://github.com/intel/vaapi-fits).
It comes with a basic default example test input spec that is sufficient
enough to catch this patch regression.  Keep in mind, though, that
some of the tests already fail with current ToT.  So you'll need to
compare results before and after patches.  Feel free to give it a try
before sending patches to catch simple regressions.

I recommend running like:

LIBVA_DRIVER_NAME=iHD vaapi-fits run test/ffmpeg-vaapi \
 --parallel-metrics -v -k tag:KBL

Add an additional "-v" for more verbosity (i.e. to see command
lines).  Also, change "-k tag:KBL" based on your physical Intel
platform.

We supplement our testing with this framework with more
comprehensive internal test input specifications, FWIW.

Feel free to ping me if you have any questions.

U. Artie

> 
> > - Mark
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel at ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list