[FFmpeg-trac] #7764(undetermined:new): Support for HW accelerated 10-bit -> 8-bit conversion support

FFmpeg trac at avcodec.org
Fri Mar 1 18:17:34 EET 2019

#7764: Support for HW accelerated 10-bit -> 8-bit conversion support
             Reporter:  eero-t       |                     Type:
                                     |  enhancement
               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:

 MediaSDK sample application can transcode 10-bit (HEVC) content to 8-bit
 (AVC), so same should(?) be possible in HW accelerated manner also with
 VAAPI and/or QSV backend.

 However, it fails, and one needs to do the conversion with round trip
 through CPU side.

 How to reproduce:
 ffmpeg -y -hwaccel vaapi -vaapi_device /dev/dri/renderD128
 -hwaccel_output_format vaapi -i
 SES.Astra.UHD.Test.1.2160p.UHDTV.AAC.HEVC.x265-LiebeIst.mkv -c:v
 h264_vaapi -vf format=nv12 output.h264
 ffmpeg version N-93264-g85051febc6 Copyright (c) 2000-2019 the FFmpeg
   built with gcc 7 (Ubuntu 7.3.0-27ubuntu1~18.04)
 Input #0, matroska,webm, from
     encoder         : libebml v1.3.1 + libmatroska v1.4.2
     creation_time   : 2015-10-03T13:49:42.000000Z
   Duration: 00:01:49.29, start: 0.816000, bitrate: 18484 kb/s
     Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv), 3840x2160 [SAR
 1:1 DAR 16:9], 60 fps, 60 tbr, 1k tbn, 60 tbc (default)
 Stream mapping:
   Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_vaapi))
 Press [q] to stop, [?] for help
 Impossible to convert between the formats supported by the filter 'graph 0
 input from stream 0:0' and the filter 'auto_scaler_0'
 Error reinitializing filters!
 Failed to inject frame into filter network: Function not implemented
 Error while processing the decoded data for stream #0:0
 Conversion failed!

 FFmpeg gives exactly the same error with i965 driver (in Ubuntu 18.04) as
 with above git version of iHD media-driver.

 QSV with git version of MediaSDK gives also exactly the same error:
 ffmpeg -y -hwaccel qsv -qsv_device /dev/dri/renderD128 -c:v hevc_qsv -i
 SES.Astra.UHD.Test.1.2160p.UHDTV.AAC.HEVC.x265-LiebeIst.mkv -c:v h264_qsv
 -vf format=nv12  output.h264

 With MediaSDK sample application, it works fine (when one tells with -ec
 option the format to which the 10-bit data needs to be converted):
 sample_multi_transcode -i::h265
 SES.Astra.UHD.Test.1.2160p.UHDTV.AAC.HEVC.x265-LiebeIst.h265 -ec::nv12
 -o::h264 output.h264

 With VAAPI, one can do the conversion with roundtrip through CPU side, but
 that's several times slower:
 ffmpeg -y -hwaccel vaapi -vaapi_device /dev/dri/renderD128
 -hwaccel_output_format vaapi -i
 SES.Astra.UHD.Test.1.2160p.UHDTV.AAC.HEVC.x265-LiebeIst.mkv -c:v
 h264_vaapi -vf hwdownload,format=nv12,hwupload output.h264

 FYI: Test video is from here: http://4ksamples.com/ses-astra-uhd-test-1

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

More information about the FFmpeg-trac mailing list