在ubuntu 14.04中安装ffmpeg的问题

我尝试根据https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu在unbutu中安装ffmpeg我使用下面的代码创建一个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?

最简单的方法是下载从FFmpeg下载页面链接的静态构建之一 。

然后你可以运行它

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

(或将存档扩展到的任何地方)。

这是一个安装示例脚本(下载/提取/放入用户bin PATH目录) 最新的 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