Ubuntu18.04 编译ffmpeg、intel media sdk

一、下载intel media sdk

下载地址:https://github.com/Intel-Media-SDK/MediaSDK/releases

下载版本:Media SDK 20.2.0

流程参考资料:https://github.com/Intel-FFmpeg-Plugin/Intel_FFmpeg_plugins/wiki

Ubuntu18.04 编译ffmpeg、intel media sdk_第1张图片

选择MediaStack.tar.gz下载

 

二、 安装intel media sdk

将MediaStack.tar.gz解压到某个目录,执行install_media.sh的脚本

./install_media.sh

会存在/opt/intel/mediasdk目录

 

三、解压ffmpeg4.2.3到/opt目录下

cd /opt/ffmpeg-4.2.3

在/opt/ffmpeg-4.2.3目录下创建mfx文件夹

mkdir mfx
mkdir mfx/include
mkdir mfx/lib

四、拷贝intel media sdk文件夹的include和lib64文件到指定目录

\cp -rf /opt/intel/mediasdk/include/* /opt/ffmpeg-4.2.3/mfx/include
\cp -rf /opt/intel/mediasdk/lib64/* /opt/ffmpeg-4.2.3/mfx/lib

五、在/opt/ffmpeg-4.2.3/mfx目录下创建libmfx.pc

prefix=/opt/intel/mediasdk
    exec_prefix=/opt/intel/mediasdk/
    libdir=${prefix}/lib/lin_x64/
    includedir=${prefix}/include/
    Name: libmfx
    Description: mfx
    Version: 1.0.0
    Cflags: -I${includedir} 
    Libs: -L${libdir} -lmfx -ldl -lstdc++ -lrt -lva -lva-drm
    Libs.private: -lstdc++ -ldl

 

六、编译

PKG_CONFIG_PATH=/opt/ffmpeg-4.2.3/mfx \
./configure --prefix=/opt/ffmpeg-4.2.3/build \
--enable-debug \
--enable-shared \
--disable-static \
--arch=x86_64 \
--enable-stripping \
--enable-optimizations \
--enable-x86asm \
--enable-asm \
--disable-network \
--disable-iconv \
--extra-cflags=-I./mfx/include \
--extra-ldflags=-L./mfx/lib/ \
--disable-schannel \
--disable-xlib \
--disable-zlib \
--enable-protocol=file \
--enable-libmfx \
--enable-outdev=sdl2 \
--enable-nonfree \
--enable-version3 \
--enable-gpl \
--enable-ffmpeg \
--enable-ffplay \
--disable-ffprobe

 

七、make && make install

你可能感兴趣的:(Linux,ffmpeg)