intel / gstreamer-media-SDK

GNU Lesser General Public License v2.1
90 stars 53 forks source link

mfxjpegenc issue with I420/YV12 #81

Closed araani closed 6 years ago

araani commented 6 years ago

Hi,

Currently facing an issue with the mfxjpegenc component...

gst-launch-1.0 videotestsrc num-buffers=1 ! video/x-raw, format=I420 ! mfxjpegenc ! filesink location=bad.jpeg and gst-launch-1.0 videotestsrc num-buffers=1 ! video/x-raw, format=YV12 ! mfxjpegenc ! filesink location=bad.jpeg

results in: bad

gst-launch-1.0 videotestsrc num-buffers=1 ! video/x-raw, format=NV12 ! mfxjpegenc ! filesink location=good.jpeg

results in: good

I'm currently using the following version: SRC_URI = "git://github.com/intel/gstreamer-media-SDK.git;protocol=https;branch=release/mr3.1" SRCREV = "e476a3729e10340b7d1b5523c4ad19b14e74ba09"

msdk:
intel-linux-mediasdk-16.7-710.rpm
intel-linux-mediasdk-devel-16.7-710.rpm

vainfo:
libva info: VA-API version 0.99.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /usr/lib/iHD_drv_video.so
libva info: Found init function __vaDriverInit_0_32
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.99 (libva 1.67.0.pre1)
vainfo: Driver version: 16.7.3.64751-ubit
vainfo: Supported profile and entrypoints
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointEncFEIIntel
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointEncFEIIntel
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointEncFEIIntel
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileVP8Version0_3          : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile0            : <unknown entrypoint>
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileNone                   : VAEntrypointStatisticsIntel
ishmael1985 commented 6 years ago

Can you try from this repo?

https://github.com/ishmael1985/gstreamer-media-SDK

I tried running your pipeline and I don't see the same issue with my repo.

ishmael1985 commented 6 years ago

It could be a kernel problem as well.

https://github.com/intel/media-driver/#known-issues-and-limitations

See point 1.

araani commented 6 years ago

we are using intel apollo lake platform...

found kernel patches that mention the same thing in the yocto software reference design

https://github.com/intel/iotg-yocto-bsp-public/tree/e3900/master/meta-intel-leafhill/recipes-kernel/linux/linux-yocto

ishmael1985 commented 6 years ago

In that case, it should work with the very latest on my repo, or from the https://github.com/intel/gstreamer-media-SDK/tree/topic_linux_and_window branch. I tested it on APL as well, but I used open-source MSDK with Linux Mint 18.3 (Ubuntu 16.04 base).

ishmael1985 commented 6 years ago

@araani , can we close this?

araani commented 6 years ago

the solution for the issue, as pointed out by ishmael1985

SKL: Green or other incorrect color will be observed in output frames when using YV12/I420 as input format for csc/scaling/blending/rotation, etc. on Ubuntu 16.04 stock (with kernel 4.10). The issue can be addressed with the kernel patch: WaEnableYV12BugFixInHalfSliceChicken7 commit https://cgit.freedesktop.org/drm-tip/commit/?id=0b71cea29fc29bbd8e9dd9c641fee6bd75f68274