Opened 7 weeks ago

Last modified 3 weeks ago

#7764 new enhancement

Support for HW accelerated 10-bit -> 8-bit conversion support

Reported by: eero-t Owned by:
Priority: wish Component: undetermined
Version: git-master Keywords: vaapi
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

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 developers
  built with gcc 7 (Ubuntu 7.3.0-27ubuntu1~18.04)
...
Input #0, matroska,webm, from 'SES.Astra.UHD.Test.1.2160p.UHDTV.AAC.HEVC.x265-LiebeIst.mkv':
  Metadata:
    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-2160p-uhdtv/

Change History (1)

comment:1 Changed 3 weeks ago by cehoyos

  • Keywords vaapi added
  • Priority changed from normal to wish
Note: See TracTickets for help on using tickets.