Intel FFmpeg QSV安装

来源:互联网 发布:中国的未来是一群正知 编辑:程序博客网 时间:2024/05/17 21:50

1 Downlod

 git clone https://github.com/Intel-FFmpeg-Plugin/Intel_FFmpeg_plugins.git

2 Config libmfx

cd /opt/intel/mediasdk/includesudo mkdir mfxsudo cp *.h mfx/touch libmfx.pc

add the following lines to libmfx.pc

prefix=/opt/intel/mediasdkexec_prefix=/opt/intel/mediasdk/libdir=${prefix}/lib/lin_x64/includedir=${prefix}/include/Name: libmfxDescription: mfxVersion: 1.0.0Cflags: -I${includedir} Libs: -L${libdir} -lmfx -ldl -lstdc++ -lrt -lva -lva-drmLibs.private: -lstdc++ -ldlsudo cp libmfx.pc /usr/lib64/pkgconfigpkg-config --modversion libmfx

3 Install yasm

sudo yum install -y yasm

or

wget -c http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gztar xzvf yasm-1.3.0.tar.gzcd yasm-1.3.0/./configure --prefix=/usr --libdir=/usr/lib64make -j4sudo make installyasm –version

4. install libx264

git clone http://git.videolan.org/git/x264.gitcd x264/./configure --prefix=/usr --libdir=/usr/lib64 --enable-static --disable-climake -j4sudo make installpkg-config --modversion x264

5. Install libvpx 1.6.0

git clone https://github.com/webmproject/libvpx.git cd libvpx/./configure --prefix=/usr --libdir=/usr/lib64 --enable-static --disable-shared --disable-libyuv --disable-avx --disable-avx2make -j4sudo make installpkg-config --modversion vpx

6. Install libfdk-aac 0.1.5

git clone https://github.com/mstorsjo/fdk-aac.git cd fdk-aac/./autogen.sh./configure --prefix=/usr --libdir=/usr/lib64 --enable-static --disable-sharedmake -j4sudo make installpkg-config --modversion fdk-aac

7. Compile ffmepg_qsv

./configure --prefix=/usr --libdir=/usr/lib64 --enable-nonfree --disable-static --enable-shared --enable-opencl --enable-libmfx --enable-memalign-hack --enable-gpl --disable-libfdk-aac --enable-libx264 --extra-cflags=-I/opt/intel/opencl/include --extra-ldflags=-L/opt/intel/openclmake -j8sudo make install

错误解决

  • 如果出现乱码,检查libmfx.pc是不是拷贝的过程中出现win到unix字符编码不一致

  • 如果出现以下错误

/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libx264.a(common.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libx264.a: error adding symbols: Bad valuecollect2: error: ld returned 1 exit status 

用yum安装x264-devel

sudo yum install -y x264-devel
  • -fPIC
    如果报错
relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC

在从figure后面加上

--enable-pic

./configure --prefix=/usr --libdir=/usr/lib64 --enable-nonfree --disable-static --enable-shared --enable-opencl --enable-libmfx --enable-memalign-hack --enable-gpl --disable-libfdk-aac --enable-libx264 --extra-cflags=-I/opt/intel/opencl/include --extra-ldflags=-L/opt/intel/opencl --enable-pic

参考

http://blog.csdn.net/ww506772362/article/details/49865437