ffmpeg升级和转移

下载编译安装

到 Ffmpeg 官网 https://ffmpeg.org/download.html 挑选你要升级到的版本

tar -zxvf FFmpeg-n4.4.tar.gz
cd FFmpeg-n4.4
./configure --enable-shared --prefix=/usr/local/ffmpeg
make -j2 && make install

动态链接库

cat >> /etc/ld.so.conf << 'EOF'
/usr/local/ffmpeg/lib
EOF

# 执行
ldconfig

设置环境变量

cat > /etc/profile.d/ffm.sh << 'EOF'
export FFM_HOME=/usr/local/ffmpeg
export PATH=$FFM_HOME/bin:$PATH
EOF
source /etc/profile

执行ffmpeg -version

[root@localhost ~]# ffmpeg -version
ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-44)
configuration: --prefix=/usr/local/FFMpeg
libavutil      56. 70.100 / 56. 70.100
libavcodec     58.134.100 / 58.134.100
libavformat    58. 76.100 / 58. 76.100
libavdevice    58. 13.100 / 58. 13.100
libavfilter     7.110.100 /  7.110.100
libswscale      5.  9.100 /  5.  9.100
libswresample   3.  9.100 /  3.  9.100

转移

由于编译比较慢

scp -r /usr/local/ffmpeg root@10.10.1.32:/usr/local/

动态链接库

cat >> /etc/ld.so.conf << 'EOF'
/usr/local/ffmpeg/lib
EOF

# 执行
ldconfig

设置环境变量

cat > /etc/profile.d/ffm.sh << 'EOF'
export FFM_HOME=/usr/local/ffmpeg
export PATH=$FFM_HOME/bin:$PATH
EOF
source /etc/profile

查看

ldd:用来查看程序运行所需的共享库,常用来解决程序因缺少某个库文件而不能运行的一些问题

[root@localhost bin]# cd /usr/local/ffmpeg/bin/
[root@localhost bin]# ldd ffmpeg
        linux-vdso.so.1 =>  (0x00007ffd85570000)
        libm.so.6 => /lib64/libm.so.6 (0x00007fea79bfd000)
        libxcb.so.1 => not found
        libxcb-shm.so.0 => not found
        libxcb-shape.so.0 => not found
        libxcb-xfixes.so.0 => not found
        libva.so.1 => not found
        libva-drm.so.1 => not found
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fea799e1000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fea79613000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fea79eff000)

安装缺少的依赖

yum install -y libxcb libva
yum install -y libavdevice  libavfilter libavformat libavcodec libswresample libswscale libavutil

查看版本

[root@localhost bin]# ffmpeg -version
ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-44)
configuration: --prefix=/usr/local/FFMpeg
libavutil      56. 70.100 / 56. 70.100
libavcodec     58.134.100 / 58.134.100
libavformat    58. 76.100 / 58. 76.100
libavdevice    58. 13.100 / 58. 13.100
libavfilter     7.110.100 /  7.110.100
libswscale      5.  9.100 /  5.  9.100
libswresample   3.  9.100 /  3.  9.100
posted @ 2021-09-06 17:36  1769987233  阅读(718)  评论(0编辑  收藏  举报