Question / Help Finally! Centos 7.3 + Intel MSS + Obs VAAPI

bywant

New Member
I can finally use OBS with VAAPI on my Centos 7.3 Server with intel media server studio R3 installed.

I am using intel mss's quick sync support(h264_qsv) on ffmpeg very often, so i dont want to give up the media server studio.

The problem was the libva and and intel vaapi driver installed with media server studio.

Code:
[emreunal@emreunal ~]$ /usr/bin/vainfo
error: can't connect to X server!
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 /opt/intel/mediasdk/lib64/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.5.2.64009-ubit
vainfo: Supported profile and entrypoints
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: <unknown entrypoint>
      VAProfileH264ConstrainedBaseline: <unknown entrypoint>
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264Main               : <unknown entrypoint>
      VAProfileH264Main               : <unknown entrypoint>
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264High               : <unknown entrypoint>
      VAProfileH264High               : <unknown entrypoint>
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileVP8Version0_3          : VAEntrypointEncSlice
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileVP8Version0_3          : <unknown entrypoint>
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileVP9Profile0            : <unknown entrypoint>
      <unknown profile>               : VAEntrypointVideoProc
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileNone                   : <unknown entrypoint>

Because of some missing profile entry points (<unknown entrypoint>) i got always this error on obs:

Code:
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 /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function __vaDriverInit_0_32
libva info: va_openDriver() returns 0
error: [VAAPI encoder]: "vaCreateConfig(display, profile, entrypoint, vaapi_config_attribs, vaapi_config_attribs_cnt, &config_id)": the requested VAProfile is not supported
error: [VAAPI encoder]: "vaCreateConfig(display, profile, entrypoint, vaapi_config_attribs, vaapi_config_attribs_cnt, &config_id)": the requested VAProfile is not supported
error: [VAAPI encoder]: "vaCreateConfig(display, profile, entrypoint, vaapi_config_attribs, vaapi_config_attribs_cnt, &config_id)": the requested VAProfile is not supported


Then i found this awesome gist, did some tests and asked a couple of questions to Dennis:

https://gist.github.com/Brainiarc7/eb45d2e22afec7534f4a117d15fe6d89

His answer about the missing entry points:

That's because you're using the proprietary driver from Intel's Media SDK.

Some of these entry points are only exposed to and by the proprietary driver, and as such, the exported symbols are not generally available to other utilities that use VAAPI.

If you want to list and use all the publicly known VAAPI interfaces, you'll need to stick to the opensource i965 driver.

and about the obs error:
You're getting that error because Intel's proprietary driver doesn't expose support for that standard.


I installed the latest version of intel-vaapi-driver and libva (4. and 3. in gist, you dont need
the "--enable-hybrid-codec" in 3.) and compiled ffmpeg like in ffmpeg's official quide with some additions.

  • You have to compile ffmpeg with "--enable-shared --enable-pic --disable-static" (Thank you @w23)
  • To able to do that, you have to compile libx264, libfdk_aac, libmp3lame etc. with "--enable-shared".
  • You have to add the cflag and ldflag to your ffmpeg configuration(to use the new installed libva version)
Libva is installed in /usr/local so the flags are:

Code:
--extra-cflags='-I$HOME/ffmpeg_build/include -I/usr/local/include' --extra-ldflags='-L$HOME/ffmpeg_build/lib -ldl -L/usr/local/lib/ -lva'

Ffmpeg is ready now to use with OBS. I am using Bleuzens ffmpeg-vaapi branch.

Before running cmake, you have to set envvar PKG_CONFIG_PATH=<where-you-installed-ffmpeg>/lib/pkgconfig. (
PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" for me).

Now, if you want to run OBS with vaapi support, open your terminal, change libva driver name to i965 (LIBVA_DRIVER_NAME=i965) and run obs from your terminal.


Note: To check which libva librarys are being used from ffmpeg, run 'ldd <path to ffmpeg> | grep libva':

Code:
$ ldd $HOME/bin/ffmpeg | grep libva
        libva.so.2 => /usr/local/lib/libva.so.2 (0x00007f925cd53000)
        libva-drm.so.2 => /usr/local/lib/libva-drm.so.2 (0x00007f925759f000)
        libva-x11.so.2 => /usr/local/lib/libva-x11.so.2 (0x00007f9256498000)


If you run vainfo after LIBVA_DRIVER_NAME=i965, you will see:

Code:
libva info: VA-API version 0.99.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'i965'
libva info: Trying to open /opt/intel/mediasdk/lib64/i965_drv_video.so
libva error: /opt/intel/mediasdk/lib64/i965_drv_video.so has no function __vaDriverInit_0_32
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

Dont panic. This is because of the old libva-utils(which provides vainfo) version installed with intel media server studio.

Install the newer version from https://github.com/01org/libva-utils. This will install vainfo to the /usr/local/bin. So to run vainfo installed with intel mss run /usr/bin/vainfo and to run the newer version, run /usr/local/bin/vainfo:
Code:
/usr/local/bin/vainfo
error: can't connect to X server!
libva info: VA-API version 1.0.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'i965'
libva info: Trying to open /opt/intel/mediasdk/lib64/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_0
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.0 (libva 2.0.1.pre1)
vainfo: Driver version: Intel i965 driver for Intel(R) Skylake - 2.0.1.pre1 (2.0.0-6-g4997665)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileH264ConstrainedBaseline: VAEntrypointFEI
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264Main               : VAEntrypointFEI
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointFEI
      VAProfileH264MultiviewHigh      : VAEntrypointVLD
      VAProfileH264MultiviewHigh      : VAEntrypointEncSlice
      VAProfileH264StereoHigh         : VAEntrypointVLD
      VAProfileH264StereoHigh         : VAEntrypointEncSlice
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileVP8Version0_3          : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
 
Last edited:
Top