Centos7 安装FFmpeg

1.官网地址
http://ffmpeg.org/download.html
2.本次使用的文件为gitHub上下载下来的

image.png

image.png

3.在服务器中创建属于自己的目录 mydata

mkdir mydata

3.下载下来之后上传到服务器mydata 目录下

image.png

解压命令

tar xvJf ffmpeg-master-latest-linux64-gpl.tar.xz

4.查看是否缺少依赖

ldd /mydata/ffmpeg-master-latest-linux64-gpl/bin/ffmpeg

        linux-vdso.so.1 (0x00007ffebe5ab000)
        libm.so.6 => /usr/lib64/libm.so.6 (0x00007fb3b102a000)
        libdl.so.2 => /usr/lib64/libdl.so.2 (0x00007fb3b0e26000)
        librt.so.1 => /usr/lib64/librt.so.1 (0x00007fb3b0c1e000)
        libpthread.so.0 => /usr/lib64/libpthread.so.0 (0x00007fb3b0a00000)
        libc.so.6 => /usr/lib64/libc.so.6 (0x00007fb3b0666000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fb3b133a000)
        libmvec.so.1 => not found  #注:明显 libmvec.so.1 => not found 是缺少的

5.下载glibc
我这里下载的是2.25版本的
http://ftp.gnu.org/gnu/glibc/glibc-2.25.tar.gz

执行解压

tar -zxvf glibc-2.25.tar.gz
# 进入已解压的文件
cd glibc-2.25
# 创建构建文件目录
mkdir build
# 进入目录
cd build
# 编译 编译安装
../configure --prefix=/usr
make -i
make install -i
  1. 添加环境变量
vi /etc/profile
image.png
unset i
unset -f pathmunge
# 添加这一句
export PATH=$PATH:/mydata/ffmpeg-master-latest-linux64-gpl/bin

让环境生效

source /etc/profile

7.执行查看安装版本

[root@localhost /]# ffmpeg -version
ffmpeg version N-107322-g03d81a044a-20220707 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 12.1.0 (crosstool-NG 1.25.0.55_3defb7b)
configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-ffbuild-linux-gnu- --arch=x86_64 --target-os=linux --enable-gpl --enable-version3 --disable-debug --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --enable-libpulse --enable-libvmaf --enable-libxcb --enable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-mbedtls --enable-librist --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --disable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --enable-libdrm --enable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags=-pie --extra-libs='-ldl -lgomp' --extra-version=20220707
libavutil      57. 27.100 / 57. 27.100
libavcodec     59. 36.100 / 59. 36.100
libavformat    59. 26.100 / 59. 26.100
libavdevice    59.  6.100 / 59.  6.100
libavfilter     8. 41.100 /  8. 41.100
libswscale      6.  6.100 /  6.  6.100
libswresample   4.  6.100 /  4.  6.100
libpostproc    56.  5.100 / 56.  5.100

到此安装成功,其他方式的安装,这里就不罗列,如果步骤有其他不足的地方,欢迎指点。

你可能感兴趣的:(Centos7 安装FFmpeg)