intel / intel-vaapi-driver

VA-API user mode driver for Intel GEN Graphics family
https://01.org/linuxmedia
Other
305 stars 126 forks source link

When using gstreamer vaapih264dec, I got wrong raw frame with YUV channels mismatch #522

Open b04505009 opened 3 years ago

b04505009 commented 3 years ago

I use gstreamer and vaapih264dec decoding h264 frames to raw frames. However, when I use opencv cvtColor to convert image from NV12 back to RGB, I got wrong image which has some green lines on the top. I tried mfxh264dec and avdec_h264 too and they worked fine, ,so I supposed it's vaapih264's problem.

Here is my test code: https://hackmd.io/@b04505009/HyRj9qFID

vainfo:

libva info: VA-API version 1.4.1
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_4
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.4 (libva 2.6.0)
vainfo: Driver version: Intel iHD driver - 19.1.0.git_42f6f23_2019-04-23
vainfo: Supported profile and entrypoints
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileNone                   : VAEntrypointStats
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointFEI
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointFEI
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointFEI
      VAProfileVP8Version0_3          : VAEntrypointVLD

I've tried on ubuntu 18.04 and 20.04 and got the same result.