ffmpeg部分错误

使用时如果出现
Failed to resolve hostname :xxx.com Temporary failure in name resolution错误
vim /etc/resolv.conf
添加域名解析服务器
nameserver 114.114.114.114
nameserver 8.8.8.8

unknow encoder 'libx264'
下载安装x264
cd x264
生成makefile
./configure --prefix=/home/x264 --includedir=/user/local/include --libdir=/usr/local/lib --enable-shared
如果不将include和lib安装在/usr/local目录,之后运行ffmpeg推流命令时可能仍然报ERROR:libx264 not found错误。如果已经安装x264了发现报错,则需要将x264.h这个文件要放在/usr/local/include下,libx264的库文件拷贝到/usr/local/lib下,而不是指定其它目录安装存放。推荐安装时直接运行以上命令。
可能报错:
Unknown option --enable-share, ignored Found no assembler Minimum > version is nasm-2.13
If you really want to compile without asm, configure with --disable-asm.
解决方案:
下载更新安装nasm新版本(nasm官网)或者通过yum/apt-get安装:
wget https://www.nasm.us/pub/nasm/releasebuilds/2.14/nasm-2.14.tar.gz
编译
make && make install
重新编译安装ffmpeg
./configure --enable-shared --enable-openssl --prefix=/usr/local/ffmpeg --enable-gpl --enable-libx264 --enable-nonfree
编译
make && make install
如果出现ffmpeg: error while loading shared libraries: libavdevice.so.58: cannot open shared object file: No such file or directory
vim /etc/ld.so.conf
添加下述文件
/usr/local/ffmpeg/lib/
输入ldconfig使修改生效

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容