Intel-FFmpeg-Plugin / Intel_FFmpeg_plugins

mirror of git://source.ffmpeg.org/ffmpeg.git
http://ffmpeg.org
Other
35 stars 19 forks source link

10 bit hevc qsv encoding issue #43

Closed fulinjie closed 6 years ago

fulinjie commented 6 years ago

Hi, all:

Here is the description of a 10 bit hevc qsv encoding issue.

Test Env: Platfrom: KBL OS: Ubuntu 18.04 Kernel version: 4.15.0 VPG Driver: 6ecb1d70f (branch: master) Mediasdk: 7557124f3 (branch: master ) FFMPEG: bd1a484 (branch:intel_ffmpeg-3.4.1) repo: https://github.com/Intel-FFmpeg-Plugin/Intel_FFmpeg_plugins.git src: https://drive.google.com/file/d/1jkbhc8efhLo-FdcAzyyD_bvqL9_dcmAm/view?usp=sharing

command: ./ffmpeg -hwaccel qsv -hwaccel_device /dev/dri/renderD128 -v verbose -y -c:v hevc_qsv -i 4K_Jobs.mkv -c:v hevc_qsv –vsync 0 test.mp4

error msg: [hevc_qsv @ 0x55ddfc94d340] Error initializing the encoder: device failed (-17) 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

workaround: If add a condition of 10_bit_YUV420, the 10 bit hevc stream could be transcoded well.

_studio/mfx_lib/encode_hw/h265/src/mfx_h265_encode_vaapi.cpp @@ -946,7 +946,8 @@ mfxStatus VAAPIEncoder::CreateAccelerationService(MfxVideoParam const & par)

MFX_CHECK_WITH_ASSERT(VA_STATUS_SUCCESS == vaSts, MFX_ERR_DEVICE_FAILED);

-    if ((attrib[0].value & VA_RT_FORMAT_YUV420) == 0)
+    if ((attrib[0].value & VA_RT_FORMAT_YUV420) == 0
+         && (attrib[0].value & VA_RT_FORMAT_YUV420_10) == 0)
       return MFX_ERR_DEVICE_FAILED;
lizhong1008 commented 6 years ago

Duplicated with https://github.com/Intel-FFmpeg-Plugin/Intel_FFmpeg_plugins/issues/42