注意:本文在centos9/rocky9 x64版本下可用,其他版本没有测试.
在线安装(注意,安装ffmpeg所有步骤都须在root权限下实行)
添加 EPEL 和 RPM Fusion 源:
yum install epel-release
yum install https://download1.rpmfusion.org/free/el/rpmfusion-free-release-$(rpm -E %rhel).noarch.rpm
安装 FFmpeg
由于ffmpeg安装需要不少依赖文件,所以需要做些前提工作.
yum -y install rpm&yum -y install wget&yum -y install curl&yum -y install unzip&yum -y install tar
下载 FFmpeg 的预编译二进制文件:
sudo curl -O https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz
解压并安装:
tar -xvf ffmpeg-release-amd64-static.tar.xz
sudo mv ffmpeg-*-static/ffmpeg /usr/local/bin/
sudo mv ffmpeg-*-static/ffprobe /usr/local/bin/
验证:
ffmpeg -version
如果出现下面这种带版本号的就说明成功了.
[root@ray ~]# ffmpeg -version
ffmpeg version 7.0.2-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2024 the FFmpeg developers
built with gcc 8 (Debian 8.3.0-6)
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
libavutil 59. 8.100 / 59. 8.100
libavcodec 61. 3.100 / 61. 3.100
libavformat 61. 1.100 / 61. 1.100
libavdevice 61. 1.100 / 61. 1.100
libavfilter 10. 1.100 / 10. 1.100
libswscale 8. 1.100 / 8. 1.100
libswresample 5. 1.100 / 5. 1.100
libpostproc 58. 1.100 / 58. 1.100
[root@ray ~]# 参考
安装yt-dlp
下载yt-dlp二进制文件
wget -O /usr/local/bin/yt-dlp https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp
为二进制文件添加执行权限:
sudo chmod a+rx /usr/local/bin/yt-dlp
验证安装:
yt-dlp --version
如果成功,您会看到 YT-DLP 的版本号.如下:
[root@ray ~]# yt-dlp --version
2025.02.19
升级版本:
yt-dlp -U
效果如下:
[root@ray ~]# yt-dlp --version
2025.02.19
[root@ray ~]# yt-dlp -U
Latest version: stable@2025.02.19 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2025.02.19 from yt-dlp/yt-dlp)
[root@ray ~]#
文献: