ubuntu14.04安装ffmpeg的问题

ubuntu14.04安装ffmpeg的问题

我尝试按照https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu 我使用以下代码创建一个 shell 文件

sudo apt-get update
sudo apt-get -y install autoconf automake build-essential libass-dev libfreetype6-dev libgpac-dev \
  libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libx11-dev \
  libxext-dev libxfixes-dev pkg-config texi2html zlib1g-dev
mkdir ~/ffmpeg_sources

cd ~/ffmpeg_sources
wget http://download.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
tar xjvf last_x264.tar.bz2
cd x264-snapshot*
PATH="$PATH:$HOME/bin" ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-static --disable-opencl
PATH="$PATH:$HOME/bin" make
make install
make distclean

sudo apt-get install unzip
cd ~/ffmpeg_sources
wget -O fdk-aac.zip https://github.com/mstorsjo/fdk-aac/zipball/master
unzip fdk-aac.zip
cd mstorsjo-fdk-aac*
autoreconf -fiv
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
make
make install
make distclean


cd ~/ffmpeg_sources
wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
tar xjvf ffmpeg-snapshot.tar.bz2
cd ffmpeg
PATH="$PATH:$HOME/bin" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
  --prefix="$HOME/ffmpeg_build" \
  --extra-cflags="-I$HOME/ffmpeg_build/include" \
  --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
  --bindir="$HOME/bin" \
  --enable-libfdk-aac \
  --enable-libx264 \
PATH="$PATH:$HOME/bin" make
make install
make distclean
hash -r

(我为该文件添加了执行权限)并在命令行运行./mybashfile.sh)

它运行正确并开始下载,但最后一行终端输出是

.
.
.
rm -f libMpegTPEnc/src/.dirstamp
rm -f libPCMutils/src/.deps/.dirstamp
rm -f libPCMutils/src/.dirstamp
rm -f libSBRdec/src/.deps/.dirstamp
rm -f libSBRdec/src/.dirstamp
rm -f libSBRenc/src/.deps/.dirstamp
rm -f libSBRenc/src/.dirstamp
rm -f libSYS/src/.deps/.dirstamp
rm -f libSYS/src/.dirstamp
rm -f libtool config.lt
rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
rm -f cscope.out cscope.in.out cscope.po.out cscope.files
rm -f config.status config.cache config.log configure.lineno config.status.lineno
rm -rf ./.deps libAACdec/src/.deps libAACenc/src/.deps libFDK/src/.deps libMpegTPDec/src/.deps libMpegTPEnc/src/.deps libPCMutils/src/.deps libSBRdec/src/.deps libSBRenc/src/.deps libSYS/src/.deps
rm -f Makefile
--2014-09-07 15:18:35--  http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
Resolving ffmpeg.org (ffmpeg.org)... 192.190.173.45
Connecting to ffmpeg.org (ffmpeg.org)|192.190.173.45|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘ffmpeg-snapshot.tar.bz2’

    [ <=>                                   ] 13          --.-K/s   in 0s      

2014-09-07 15:18:45 (1.30 MB/s) - ‘ffmpeg-snapshot.tar.bz2’ saved [13]

bzip2: (stdin) is not a bzip2 file.
tar: Child returned status 2
tar: Error is not recoverable: exiting now
./install-ffmpeg.sh: line 31: cd: ffmpeg: No such file or directory
./install-ffmpeg.sh: line 32: ./configure: No such file or directory
make: *** No rule to make target `install'.  Stop.
make: *** No rule to make target `distclean'.  Stop.

问题在哪里?以及如何正确安装 ffmpeg?

答案1

最简单的方法是下载其中一个静态版本链接自FFmpeg 下载页面

然后你可以用

$ /opt/ffmpeg-2.3.3-64bit-static/ffmpeg

(或者您将档案扩展到的任何地方)。

答案2

以下是安装的示例脚本(下载/提取/放入用户binPATH 目录)最新的 ffmpeg静态版本:

wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz
tar -xvJf  ffmpeg-release-64bit-static.tar.xz  --strip-components=1 -C ./usr/bin

相关内容