如何在 Debian Jessie 上安装 ffmpeg?

如何在 Debian Jessie 上安装 ffmpeg?

我安装的 Debian Jessie 似乎正在尽一切努力阻止我安装 ffmpeg。

我读过了如何在 Debian 上安装 FFmpeg?,但 avconv 不是一个选项,添加deb http://www.deb-multimedia.org stable main non-free到我的 sources.list 中并没有真正帮助。我这样做了apt-get install libav-tools,认为它可以摆脱 ffmpeg 的依赖问题。

以下是尝试安装 ffmpeg 时得到的结果:

    $ sudo apt-get install ffmpeg
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 ffmpeg : Depends: libavcodec56 (>= 10:2.6.8) but 6:11.6-1~deb8u1 is to be installed
          Depends: libavdevice56 (>= 10:2.6.8) but it is not going to be installed
          Depends: libavfilter5 (>= 10:2.6.8) but 6:11.6-1~deb8u1 is to be installed
          Depends: libavformat56 (>= 10:2.6.8) but 6:11.6-1~deb8u1 is to be installed
          Depends: libavresample2 (>= 10:2.6.8) but 6:11.6-1~deb8u1 is to be installed
          Depends: libavutil54 (>= 10:2.6.8) but 6:11.6-1~deb8u1 is to be installed
          Depends: libpostproc53 (>= 10:2.6.8) but it is not going to be installed
          Depends: libswresample1 (>= 10:2.6.8) but it is not going to be installed
          Depends: libswscale3 (>= 10:2.6.8) but 6:11.6-1~deb8u1 is to be installed
E: Unable to correct problems, you have held broken packages.

apt-get 试图告诉我什么以及我该如何摆脱这个问题?

答案1

尝试使用aptitude它来安装它,因为它会给你提供可能的解决方案。只需确保仔细查看每一个即可。

sudo aptitude install ffmpeg

答案2

现在,它已作为反向移植版本提供给 Jessy 使用:https://packages.debian.org/jessie-backports/ffmpeg

将类似这样的内容添加到 /etc/apt/sources.list (使用您喜欢的镜像):

deb http://ftp.uk.debian.org/debian jessie-backports main

然后

apt-get update
apt-get install ffmpeg

答案3

修复损坏的包装

sudo apt-get install -f

将以下行添加到 /etc/apt/sources.list

deb http://www.deb-multimedia.org jessie main non-free
deb-src http://www.deb-multimedia.org jessie main non-free

更新:

apt-get update

添加密钥

apt-get install deb-multimedia-keyring

更新

apt-get update

删除ffmpegDebian 包

apt-get remove ffmpeg

以 root 身份安装库包和构建工具:

apt-get install build-essential libmp3lame-dev libvorbis-dev libtheora-dev libspeex-dev yasm pkg-config libfaac-dev libopenjpeg-dev libx264-dev

从以下位置下载最新的 ffmpeg这里

wget https://ffmpeg.org/releases/ffmpeg-3.0.2.tar.bz2

提取它

tar xvjf ffmpeg-3.0.2.tar.bz2

移至目录

cd ffmpeg-3.0.2

配置、构建和安装:

./configure --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-libspeex --enable-shared --enable-pthreads --enable-libopenjpeg --enable-libfaac --enable-nonfree
make -j 16
sudo make install

答案4

一个简单的选择是下载已经编译好的可执行文件ffmpeg

下载并解压后,您可以通过多种方式运行它:

  • 导航到包含可执行文件的目录并运行./ffmpeg -i ...(注意./前缀)。

  • 提供可执行文件的完整路径,例如/home/user/Downloads/ffmpeg -i ...

  • 将其放在你的某个位置PATH,例如~/bin。然后运行source ~/.profile或直接注销然后登录。现在您可以ffmpeg从任何地方运行该命令,而无需使用前两种方法。

可下载的可执行文件每天编译一次,并且始终比存储库中的内容保持更新。

相关内容