[FFmpeg-trac] #7691(undetermined:new): GPU side format conversions working with MediaSDK and old i965 driver, fail with new iHD driver

FFmpeg trac at avcodec.org
Mon Jan 21 18:02:54 EET 2019


#7691: GPU side format conversions working with MediaSDK and old i965 driver, fail
with new iHD driver
-------------------------------------+-------------------------------------
             Reporter:  eero-t       |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:  git-
  undetermined                       |  master
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug: HW upload with format conversion for the decoded data
 doesn't work for iHD QSV & VA-API backends, although that same conversion
 works fine with the MediaSDK sample application, and with older i965
 driver VA-API backend.

 Setup:
 * Distro: Ubuntu 18.04
 * FFmpeg: latest compiled from Git
 * MediaSDK & its deps: latest compiled from Git
 * HW: tested on KBL GT2, KBL GT3e and CFL GT2

 How to reproduce:
 1. Use iHD driver:
 {{{
 $ export LIBVA_DRIVER_NAME=iHD
 }}}
 2. Decode + format conversion with MediaSDK sample app:
 {{{
 $ sample_decode -hw h265 -w 1920 -h 1080 -i420 -i 1920x540_8bit_60fps.h265
 -o /dev/null
 }}}
 3. Decode + format conversion with QSV:
 {{{
 $ ffmpeg -hwaccel qsv -qsv_device /dev/dri/renderD128 -c:v hevc_qsv -i
 1920x540_8bit_60fps.h265 -vf
 scale_qsv=w=1920:h=1080,hwdownload,format=yuv420p -f null -
 }}}
 4. Decode + format conversion with VA-API:
 {{{
 $ ffmpeg -hwaccel vaapi -vaapi_device /dev/dri/renderD128
 -hwaccel_output_format vaapi -i 1920x540_8bit_60fps.h265 -vf
 scale_vaapi=w=1920:h=1080,hwdownload,format=yuv420p -f null -
 }}}
 5. Switch to i965 driver:
 {{{
 $ export LIBVA_DRIVER_NAME=i965
 }}}
 4. Decode + format conversion with VA-API:
 {{{
 $ ffmpeg -hwaccel vaapi -vaapi_device /dev/dri/renderD128
 -hwaccel_output_format vaapi -i 1920x540_8bit_60fps.h265 -vf
 scale_vaapi=w=1920:h=1080,hwdownload,format=yuv420p -f null -
 }}}

 Expected output:
 * Decoded video format conversion works fine with all the drivers (it's
 just somewhat slower than hwdownloading the Media driver native format)

 Actual outcome:
 * Format conversion works with MSDK decode application and i965 VA-API,
 but fails with iHD VA-API and QSV.  Those seem to support only "nv12" for
 8-bit data and "p010" for 10-bit data

 Note:
 * With i965 driver, following formats work without errors: "yuv420p",
 "yuyv422", "uyvy422", "nv12", "rgb0", "bgr0", and "p010".  With i965,
 "p010" works only with 10-bit input, whereas MediaSDK sample application
 seems to support also 8-bit <=> 10-bit format conversions

 (Besides transcode, doing something for the decoded data is the other
 important use-case for video driver. For that, the video format needs to
 be something that decoded data consumer can do use.  If that conversion
 can't also be done on the GPU, especially for larger video sizes, there's
 much less point performance-wise in doing the decode there either.)

--
Ticket URL: <https://trac.ffmpeg.org/ticket/7691>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list