git clone https://git.ffmpeg.org/ffmpeg.git ./configure --prefix=/usr/local/ffmpeg centos 编译FFmgeg执行./configure 时会报此错误。
nasm/yasm not found or too old. Use --disable-x86asm for a crippled build.
需要安装yasm的汇编编译器
sudo yum install yasm make make install
vim /etc/ld.so.conf # 输入以下内容
include ld.so.conf.d/*.conf /usr/local/ffmpeg/lib/
/usr/local/ffmpeg/bin/ffmpeg -version
vim /etc/profile PATH=$PATH:/usr/local/ffmpeg/bin export PATH
source /etc/profile
ffmpeg -version
安装SDL头文件找不到报错:
但是CentOS和Ubantu算两个不同系列,命令和软件基本不同。yum install安装libX11-dev libXext-dev libXtst-dev时确实找不到这三个包。 但这三个包属于libX11的,于是我用yum install libX11*搜索一下,发现有很多。于是把找到的包挨个看了下,发现有三个对应的, 分别是:libX11-devel,libXext-devel, libXtst-devel。猜想RedHat系列的Linux上应该就是用这三个,于是安装这三个包后,上面的问题没再出现。顺利安装好QT4库。 另外可想到以后在Ubantu上看到xxx-dev的包,应该在CentOS上有xxx-devel的包对应。
检查: pkg-config --variable pc_path pkg-config
拷贝/usr/local/ffmpeg/lib/pkgconfig里面的所有pc文件到/usr/share/pkgconfig
测试: gcc -o mediainfo mediainfo.c -I ./include/ `pkg-config --libs libavutil libavformat`
参考:https://www.cnblogs.com/niuben/p/13551013.html
https://blog.csdn.net/mandagod/article/details/49535537
https://blog.csdn.net/weixin_41041772/article/details/102767759