You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在CentOS 6上安装FFmpeg?求助安装失败解决方案

Fixing FFmpeg Installation Failures on CentOS 6

Hey, sorry to hear you've been stuck installing FFmpeg on CentOS 6 for two days—let's break this down. The core problem here is that CentOS 6 reached end-of-life (EOL) back in 2020, so its default software repositories are no longer maintained or accessible. That's almost certainly why the third-party script and tutorials you tried aren't working. Let's get this sorted:

Step 1: Replace CentOS 6's Dead System Repositories

First, we need to point your system to the archived CentOS 6 repositories (since the official ones are gone):

  1. Back up your old repo config to avoid mess:
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
  1. Create a new repo file pointing to CentOS's vault server:
cat > /etc/yum.repos.d/CentOS-Base.repo <<EOF
[CentOS-Base]
name=CentOS-6 - Base
baseurl=http://vault.centos.org/6.10/os/\$basearch/
gpgcheck=1
gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-6
EOF
  1. Refresh your yum cache to pick up the new repo:
yum clean all && yum makecache

Step 2: Install Required Build Dependencies

CentOS 6 has outdated packages, so we need to install all the tools and libraries needed to compile FFmpeg from source (this is more reliable than third-party scripts right now):

yum install -y gcc gcc-c++ make automake autoconf libtool git nasm pkgconfig
yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel libxml2-devel libxslt-devel
yum install -y libvorbis-devel libtheora-devel libogg-devel

FFmpeg 8.0 is likely too new for CentOS 6's old system libraries, so we'll use a stable, compatible version (4.4.x):

  1. Download the source code:
wget https://ffmpeg.org/releases/ffmpeg-4.4.4.tar.gz
tar -xvzf ffmpeg-4.4.4.tar.gz
cd ffmpeg-4.4.4
  1. Configure the build with options that work for CentOS 6:
./configure --prefix=/usr/local/ffmpeg --enable-shared --disable-static --enable-gpl --enable-version3 --enable-nonfree --enable-libvorbis --enable-libtheora --enable-libogg
  1. Compile and install (use -j$(nproc) to speed up compilation with all your CPU cores):
make -j$(nproc)
make install
  1. Add FFmpeg to your system's PATH so you can run it from anywhere:
echo 'export PATH=/usr/local/ffmpeg/bin:$PATH' >> /etc/profile
echo 'export LD_LIBRARY_PATH=/usr/local/ffmpeg/lib:$LD_LIBRARY_PATH' >> /etc/profile
source /etc/profile

Step 4: Verify the Installation

Run this command to confirm FFmpeg is working:

ffmpeg -version

If you run into any errors during compilation, check the output for missing dependencies—you can install them via yum using the archived repo we set up earlier.

内容的提问来源于stack exchange,提问作者sam67

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 04:19:51