Debian11编译Qsv驱动
in Linux with 0 comment
Debian11编译Qsv驱动
in Linux with 0 comment

注:Debian默认已安装Intel显卡驱动,其次emby及jellyfin服务端程序新版也默认自带Intel显卡驱动,基本无需自己编译,除非你需要更新系统驱动给三方程序调用。

安装编译组件

apt install autoconf libtool libdrm-dev xorg xorg-dev openbox libx11-dev libgl1-mesa-glx libgl1-mesa-dev pkg-config automake meson git cmake -y

获取源码

git clone -b intel-gmmlib-22.0.1 https://github.com/intel/gmmlib.git
git clone -b intel-media-22.1 https://github.com/intel/media-driver.git 
git clone -b 2.13.0 https://github.com/intel/libva.git
git clone -b 2.13.0 https://github.com/intel/libva-utils.git 
git clone -b intel-mediasdk-22.1.0 https://github.com/Intel-Media-SDK/MediaSDK.git msdk

编译libva

cd libva
./autogen.sh
make -j($nproc)
make install | tee install.log 2>&1

编译libva-util

cd libva-util
./autogen.sh
make -j($nproc)
make install  | tee install.log 2>&1

编译gmmlib

cd gmmlib
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DARCH=64 ..
make -j$(nproc)

编译Qsv驱动

mkdir build_media
cd build_media
cmake ../media-driver
make -j$(nproc)
make install | tee install.log 2>&1

此时使用vainfo --display drm --device /dev/dri/renderD128已经可以看到可以正常返回编码信息

libva info: VA-API version 1.13.0
libva info: Trying to open /usr/local/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_13
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.13 (libva 2.13.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 22.1.1 ()
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
      VAProfileVP8Version0_3          : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointFEI
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD

编译Intel Media SDK

cd msdk
mkdir build && cd build
cmake ..
make -j$(nproc)
make install | tee install.log 2>&1

编译FFmpeg

git clone -b n5.0 https://github.com/FFmpeg/FFmpeg.git
./configure --prefix=/usr/local --enable-libmfx --enable-nonfree
make -j$(nproc)
make install | tee install.log 2>&1

测试ffmpeg是否支持qsv

ffmpeg -decoders | grep qsv

正常返回如下信息

 V....D h264_qsv             H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (Intel Quick Sync Video acceleration) (codec h264)
 V....D hevc_qsv             HEVC (Intel Quick Sync Video acceleration) (codec hevc)
 V....D mjpeg_qsv            MJPEG video (Intel Quick Sync Video acceleration) (codec mjpeg)
 V....D mpeg2_qsv            MPEG-2 video (Intel Quick Sync Video acceleration) (codec mpeg2video)
 V....D vc1_qsv              VC-1 video (Intel Quick Sync Video acceleration) (codec vc1)
 V....D vp8_qsv              VP8 video (Intel Quick Sync Video acceleration) (codec vp8)
 V....D vp9_qsv              VP9 video (Intel Quick Sync Video acceleration) (codec vp9)
msdk应该仅在需要编译ffmpeg的时候才需要编译安装

参考文章:
ubuntu 基于intel vaapi 接口调用集成显卡硬编解码
视频和视频帧:FFMPEG+Intel QSV硬解的环境安装篇
quick-sync-video-installation
get-started-with-the-oneapi-video-processing-library
mss-centos-install-options

The article has been posted for too long and comments have been automatically closed.