您的位置:首页 > 文旅 > 旅游 > 网站网页设计原则_网盘搜索_郑州seo服务公司_最新疫情爆发

网站网页设计原则_网盘搜索_郑州seo服务公司_最新疫情爆发

2025/2/24 3:42:43 来源:https://blog.csdn.net/heshiyuan1406146854/article/details/145779587  浏览:    关键词:网站网页设计原则_网盘搜索_郑州seo服务公司_最新疫情爆发
网站网页设计原则_网盘搜索_郑州seo服务公司_最新疫情爆发
参考博客:1. linux(centos)安装 ffmpeg,并添加 libx264库:https://blog.csdn.net/u013015301/article/details/140778199ffmpeg 执行时如添加参数 -vcodec libx264,会出现错误:Unknown encoder 'libx264’的错误,缺少libx264库,需要安装该库,安装步骤如下:$ 代表普通用户 # 代表root权限确认 linux版本为 fedora:
cat /etc/*-releaseAmazon Linux release 2023.5.20240819 (Amazon Linux)NAME="Amazon Linux"VERSION="2023"ID="amzn"ID_LIKE="fedora"    // !!!!!!VERSION_ID="2023"PLATFORM_ID="platform:al2023"PRETTY_NAME="Amazon Linux 2023.5.20240819"ANSI_COLOR="0;33"CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2023"HOME_URL="https://aws.amazon.com/linux/amazon-linux-2023/"DOCUMENTATION_URL="https://docs.aws.amazon.com/linux/"SUPPORT_URL="https://aws.amazon.com/premiumsupport/"BUG_REPORT_URL="https://github.com/amazonlinux/amazon-linux-2023"VENDOR_NAME="AWS"VENDOR_URL="https://aws.amazon.com/"SUPPORT_END="2028-03-15"Amazon Linux release 2023.5.20240819 (Amazon Linux)
   2. 安装步骤此步骤包含安装nasm、x264和ffmpeg。2.1 安装nasm2.1.1 下载nasm下载地址:wget https://www.nasm.us/pub/nasm/releasebuilds/2.14/nasm-2.14.tar.gz2.1.2 解压tar -zxvf nasm-2.14.tar.gz2.1.3 进入nasm目录cd nasm-2.142.1.4 执行nasm配置执行:./configure2.1.5 编译nasm执行:make2.1.6 安装nasmsudo make install2.1.7 查看是否安装成功nasm -v2.2 x264 安装2.2.1 下载x264下载地址:git clone https://code.videolan.org/videolan/x264.git2.2.2 进入x264目录cd x2642.2.3 执行x264配置注:如果不将include和lib安装在/usr/local目录,之后运行ffmpeg命令时可能仍然报错误./configure --prefix=/usr/x264/ --includedir=/usr/local/include --libdir=/usr/local/lib --enable-shared2.2.4 编译x264执行:make2.1.6 安装x264make install2.1.7 x264配置环境变量编辑bashrc文件,执行:vim ~/.bashrc在最后PATH添加环境变量:export PATH="/usr/local/nasm/bin:$PATH"export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH保存退出。设置生效,执行:source ~/.bashrc2.1.8 验证是否安装成功pkg-config --libs x2642.3 安装 ffmpeg2.3.1 下载ffmpeg下载地址:wget https://ffmpeg.org//releases/ffmpeg-6.1.tar.gz2.3.2 解压tar -zxvf ffmpeg-6.1.tar.gz2.3.3 进入ffmpeg目录cd ffmpeg-6.12.3.4 执行ffmpeg配置./configure --enable-gpl --enable-libx264 --enable-shared --extra-ldflags=-L/usr/local/lib --extra-cflags=-I/usr/local/include2.3.5 编译ffmpeg执行:make2.3.6 安装ffmpegsudo make install2.3.7 配置环境变量编辑/etc/profile文件,执行:vi /etc/profile在文件的最后位置添加环境变量:export PATH=$PATH:/usr/local/ffmpeg/bin刷新资源,使其生效,执行:source /etc/profile2.3.8 验证是否安装成功ffmpeg -version2.3.9 ffmpeg卸载使用root用户登录停止ffmpeg进程sudo pkill ffmpeg卸载ffmpegsudo yum remove ffmpeg删除ffmpeg的配置文件和数据sudo rm -rf /usr/local/etc/ffmpeg /usr/local/share/ffmpeg /usr/local/share/doc/ffmpeg /usr/local/share/man/man1/ffmpeg*3 遇到过的异常3.1 ERROR: x264 not found using pkg-config说明后缀指定的地址不对,这里x264有三个包,根据大家安装的地址确定 后缀的地址。如上文安装的 包./configure --prefix=/usr/x264/ --includedir=/usr/local/include --libdir=/usr/local/lib --enable-shared那么 咱们的包就是 /usr/local/include,/usr/local/lib这里有了后,还需要一个pkg-config 包,这样,就能解决这个报错了。用来存放x264.pc我们的pkg-config 包 可以看下地址 /usr/local/lib/pkgconfig解决方案1:vim /etc/profile末尾加入内容export PKG_CONFIG_PATH=/usr/local/x264/lib/pkgconfig,具体看各位自己x264的安装路径source /etc/profile然后再./configure ...就没问题了解决方案2:这个错误信息表示在运行 ./configure 配置脚本时,检测到 libx264 库没有被找到。这可能是由于缺少 libx264 库或者没有正确安装 libx264 的开发包引起的。执行:sudo yum install pkgconfigexport PKG_CONFIG_PATH="/path/to/libx264/lib/pkgconfig"3.2 libavcodec/libavcodec.so: undefined reference to `x264_param_cleanup’这个错误表明在链接 libavcodec 库时,编译器无法找到或解析 x264_param_cleanup 函数。这可能是由于 libx264 版本不匹配或编译选项不正确引起的。以下是一些建议:(1)检查 libx264 版本:确保你的 libx264 版本与 ffmpeg 兼容。有时,特定版本的 ffmpeg 可能需要特定版本的 libx264。尽量使用较新的版本。(2)重新编译 libx264:如果你手动编译了 libx264,请尝试重新编译并安装,确保编译选项正确。可以尝试使用以下步骤:bashCopy codecd path/to/x264/sourcemake distclean./configure --enable-sharedmakesudo make install然后,重新编译 ffmpeg。(3)检查 libx264 的链接选项:确保在链接 libavcodec 时,正确引用了 libx264 库。你可以在编译 ffmpeg 时,通过 lx264 或 llibx264 选项来指定链接 libx264 库。例如,你可以在 ffmpeg 的 configure 阶段添加 --extra-libs=-lx264:./configure --enable-libx264 --extra-libs=-lx264然后,继续编译 ffmpeg。3.3 No package ‘x264’ foundpkg-config --modversion x264Package x264 was not found in the pkg-config search path.Perhaps you should add the directory containing `x264.pc’to the PKG_CONFIG_PATH environment variableNo package ‘x264’ found(1)设置 PKG_CONFIG_PATH:如果找到了 libx264.pc 文件,请将其路径添加到 PKG_CONFIG_PATH 环境变量中。例如:bashCopy codeexport PKG_CONFIG_PATH=/path/to/directory/containing/libx264.pc:$PKG_CONFIG_PATH请将 /path/to/directory/containing/ 替换为实际的目录路径。如果 libx264.pc 文件在 /usr/lib/pkgconfig/ 中,可以运行:bashCopy codeexport PKG_CONFIG_PATH=/usr/lib/pkgconfig:$PKG_CONFIG_PATH(2)重新运行 configure:在重新运行 ./configure 之前,请确保清理之前的编译残留:bashCopy codemake distclean然后重新运行 configure:bashCopy code./configure --enable-gpl --enable-shared --enable-libx2643.4 x264 安装好了,可以看到版本信息,但是pkg-config --libs x264 查询报错x264 --versionx264 0.164.3173 4815cca(libswscale 5.5.100)built on Feb  1 2024, gcc: 4.8.5 20150623 (Red Hat 4.8.5-44)x264 configuration: --chroma-format=alllibx264 configuration: --chroma-format=allx264 license: GPL version 2 or laterlibswscale license: nonfree and unredistributableWARNING: This binary is unredistributable![root@VM-16-10-centos x264]# pkg-config --libs libx264Package libx264 was not found in the pkg-config search path.Perhaps you should add the directory containing `libx264.pc'to the PKG_CONFIG_PATH environment variableNo package 'libx264' found[root@VM-16-10-centos x264]# pkg-config --libs x264Package x264 was not found in the pkg-config search path.Perhaps you should add the directory containing `x264.pc'to the PKG_CONFIG_PATH environment variableNo package 'x264' found在这种情况下,问题可能是 x264.pc 文件不在默认的 pkg-config 搜索路径中。通常来说,x264.pc 文件应该在 lib 或 lib/pkgconfig 目录下。如果找到 x264.pc 文件,请将其路径添加到 PKG_CONFIG_PATH 环境变量中:export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH根据你的输出,pkg-config 仍然无法找到 libx264 的信息。在这种情况下,有几个可能的原因:(1)libx264 的 .pc 文件不存在或未正确安装: .pc 文件是由 libx264 的开发包提供的,用于告诉 pkg-config 如何链接到该库。确保你已经安装了 libx264 的开发包,或者手动指定 libx264 的路径。(2)PKG_CONFIG_PATH 未正确设置: 确保 PKG_CONFIG_PATH 包含 libx264 的 .pc 文件所在的目录。你可以通过运行以下命令来设置:bashCopy codeexport PKG_CONFIG_PATH=/path/to/libx264/pkgconfig:$PKG_CONFIG_PATH其中 /path/to/libx264/pkgconfig 是包含 libx264.pc 文件的目录路径。(3)libx264 的库文件不在默认的库加载路径中: 尝试将 libx264 的库路径添加到 LD_LIBRARY_PATH 中:bashCopy codeexport LD_LIBRARY_PATH=/path/to/libx264/lib:$LD_LIBRARY_PATH其中 /path/to/libx264/lib 是包含 libx264.so 文件的目录路径。请注意,确保替换上述命令中的 /path/to/libx264 为你系统上 libx264 的实际路径。完成这些步骤后,再次运行 pkg-config 或者 ./configure,看看问题是否解决。3.5 ffmpeg: error while loading shared libraries: libavdevice.so.60: cannot open shared object file: No such file or directory// 首先查找 libavdevice.so.60sudo find / -name libavdevice.so.60//查找发现 path/usr/local/lib// 配置文件中是否存在,换行追加对应路径vim /etc/ld.so.conf// include ld.so.conf.d/*.conf// /usr/local/lib// wq!保存退出// 更新库配置sudo ldconfig

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com