暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

欧拉系统上编译ffmpeg2.8版本

zayki 2024-10-23
206

一、ffmpeg版本及编译参数和支持的格式

# ffmpeg -version x265 [warning]: libx265_main10.so does not support requested bitDepth 10 ffmpeg version 2.8 Copyright (c) 2000-2015 the FFmpeg developers built with gcc 10.3.1 (GCC) configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --extra-ldflags='-Wl,-z,relro ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-libass --enable-libcdio --disable-libdc1394 --enable-libfdk-aac --enable-nonfree --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab--enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect libavutil 54. 31.100 / 54. 31.100 libavcodec 56. 60.100 / 56. 60.100 libavformat 56. 40.101 / 56. 40.101 libavdevice 56. 4.100 / 56. 4.100 libavfilter 5. 40.101 / 5. 40.101 libavresample 2. 1. 0 / 2. 1. 0 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 2.101 / 1. 2.101 libpostproc 53. 3.100 / 53. 3.100 # cat /etc/os-release 欧拉2.0版本,内核是5.10

二、编译
1、下载FFmpeg源代码
FFmpeg官网(https://ffmpeg.org/download.html)
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
2、安装依赖
FFmpeg的编译过程需要依赖一些其他的库文件,例如libx264、libmp3lame、libopus等。
sudo yum install autoconf automake bzip2 cmake freetype-devel gcc gcc-c++ git libtool make mercurial pkgconfig zlib-devel
3、配置编译选项(关键)
启用GPL和非自由许可证,同时启用libx264、libmp3lame、libopus、libvpx和libass等库的支持。
./configure --enable-shared --disable-static --enable-gpl --enable-nonfree --enable-libx264 --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libass

这一步将生成用于下一步编译用的make文件,这一步如果执行失败,是无法进行下一步编译的。
这是成功的图:

linux依赖手动编译安装
提供一些失败的解决方案:
告诉你缺了xxxx库

手动wget+make安装 wget https://www.nasm.us/pub/nasm/releasebuilds/2.16.01/nasm-2.16.01.tar.gz tar -xvf nasm-2.16.01.tar.gz ./configure make sudo make install + 缺少依赖的解决方案 ```txt sudo find / -name "libavdevice.so.60“ sudo ldconfig export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH 另外,装个 EPEL 仓库 sudo yum install epel-release 遇到的其他一些包的缺失 sudo yum install mercurial hg version sudo yum install -y nasm yasm pkg-config --modversion libass tar -xvf libass-<version>.tar.gz cd libass-<version> ./configure make sudo make install sudo yum update libass luaCopy code pkg-config --modversion libass sudo yum install autoconf automake cmake freetype-devel gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel 其他缺失包2 sudo yum install libvdpau sudo yum install SDL 可能还有一些,反正缺啥装啥就行 Nux Dextop 软件源仓库一定要装,其他有最好,没有就换阿里云源,再不行官网下载,手动编译安装。 —————————————————————————— centos8换源阿里云 # 备份 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup # 换源 wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo # 清理缓存 yum clean all # 生成缓存 yum makecache # 更新最新源设置 yum update -y 4、编译源代码 make即可 5、安装FFmpeg 编译完成后,执行以下命令进行安装: sudo make install 6、验证安装 ffmpeg -version 三、参考链接: 1. https://www.cnblogs.com/pengxiaoshu/p/17270327.html 2. https://developer.aliyun.com/article/1448839
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论