Linux arm环境下pip3安装av失败


报如下错误:
Could not find libavformat with pkg-config. Could not find libavcodec with pkg-config. Could not find libavdevice with pkg-config. Could not find libavutil with pkg-config. Could not find libavfilter with pkg-config. Could not find libswscale with pkg-config. Could not find libswresample with pkg-config.

可以对应安装apt-get install libavformat-dev 等库

如果编译错误,可以尝试:

root用户下安装步骤:
安装ffmpeg

mkdir ffmpeg
wget http://www.ffmpeg.org/releases/ffmpeg-4.1.3.tar.gz tar -zxvf ffmpeg-4.1.3.tar.gz cd ffmpeg-4.1.3 ./configure --enable-shared --enable-pic --enable-static --disable-x86asm --prefix=/root/yuefu/ffmpeg #其中/root/yuefu/ffmpeg换成自己要安装的路径 make -j32 make install 
 

vi /etc/ld.so.conf.d/ffmpeg.conf
在末尾添加一行,路径换成自己的
/root/yuefu/ffmpeg/lib
使配置生效
ldconfig

配置profile系统文件
vim /etc/profile
在末尾添加一行
export PATH=$PATH:/root/yuefu/ffmpeg/bin
使配置文件生效
source /etc/profile
使opencv能找到ffmpeg
pip3 install opencv-python
cp /root/yuefu/ffmpeg/lib/pkgconfig/* /usr/share/pkgconfig

安装pyav

git clone https://gitee.com/mirrors/PyAV.git cd PyAV/ python3 setup.py build --ffmpeg-dir=/root/yuefu/ffmpeg python3 setup.py install 
 

测试pyav安装是否成功
cd ..
python3
import av
注意:不要再PyAv目录下测试,否则报错
ModuleNotFoundError: No module named 'av._core'


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM