如何在 centos 6 中安装 libav-tools

如何在 centos 6 中安装 libav-tools

我按照教程从源代码编译它,但它对我来说不起作用。我在以下几点上遇到错误

下载x264编解码器并编译:

git clone git://git.videolan.org/x264.git x264
cd x264
./configure –enable-static
make && make install

错误日志:

 cd x264
     ./configure –enable-static
    Unknown option –enable-static, ignored
    Found no assembler
    Minimum version is yasm-1.2.0
    If you really want to compile without asm, configure with --disable-asm.
      make && make install
    Makefile:3: config.mak: No such file or directory
    ./configure
    Found no assembler
    Minimum version is yasm-1.2.0
    If you really want to compile without asm, configure with --disable-asm.
    make: *** [config.mak] Error 1

cd libav
./configure --enable-gpl --enable-nonfree
make && make install

错误日志:

 cd libav
./configure --enable-gpl --enable-nonfree
Unable to create and execute files in /tmp.  Set the TMPDIR environment
variable to another directory and make sure that it is not mounted noexec.
Sanity test failed.

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
[email protected] mailing list or IRC #libav on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solving the problem.
  make && make install
Makefile:1: config.mak: No such file or directory
Makefile:99: /common.mak: No such file or directory
Makefile:137: /libavutil/Makefile: No such file or directory
Makefile:137: /library.mak: No such file or directory
Makefile:139: /doc/Makefile: No such file or directory
Makefile:214: /tests/Makefile: No such file or directory
make: *** No rule to make target `/tests/Makefile'.  Stop.

参考链接: http://blog.droidzone.in/2013/12/24/convert-a-wmv-file-to-avi-on-the-linux-command-line/


我使用这些进行了安装,但仍然遇到问题

wget https://www.libav.org/releases/libav-10.5.tar.gz
tar xf libav-10.5.tar.gz
TMPDIR=/home/sociaow2/tmp/avco/libav-10.5 ./configure
make && make install
cd

当我输入该命令时,所有库都已安装

 avconv -i state.mp4  -r 20 -s 480x352 -b 600k  -vcodec libx264 out_state.mp4

命令中出现未知编码器‘libx264’

  avconv -i state.mp4  -r 20 -s 480x352 -b 600k  -vcodec libx264 out_state.mp4

命令中出现未知编码器‘libmp3lame’

 avconv -i state.mp4  -r 20 -s 480x352 -b 600k  -vcodec libx264 out_state.mp4

答案1

你可能缺少--enable-libx264配置行,并且你的服务器配置为禁用执行,/tmp我建议你做类似的事情

mkdir ~/tmp export TMPDIR=~/tmp ./configure --enable-gnu --enable-libx264

(更多信息这里

如上所述,x264 需要安装 yasm。

/usr/local/bin由于您要在那里安装 yasm、x264 和 libav,请确保您的 PATH 中有。

答案2

--enable-static(需要有双破折号)

答案3

当我尝试在我的 vps 上设置 ffmpeg 时,我也遇到了类似的问题玫瑰托管。rosehosting 支持人员修复了这个问题,并向我解释说我需要更高的亚斯姆版本来编译最新的 x264 版本。他们使用以下步骤在我的 vps 上安装 yasm:

git clone git://github.com/yasm/yasm.git
cd yasm
./autogen.sh
./configure
make
make install

至于第二个错误,我也遇到了这个问题,因为我的/tmp是使用 noexec 属性挂载的,因此为了解决这个问题,我需要将 TMPDIR 设置为一些方便的目录,例如:

export TMPDIR=~/mytmp
mkdir -p $TMPDIR

编译完成后,你可以使用以下命令删除并取消设置它

rm -rf $TMPDIR
unset $TMPDIR

答案4

安装依赖项:

yum install libvorbis  yasm freetype zlib bzip2 faac lame speex libvpx libogg  libtheora  x264 XviD openjpeg15 opencore-amr

从以下网址下载 tarball这里并安装它:

wget https://www.libav.org/releases/libav-10.5.tar.gz
tar xvf libav-10.5.tar.gz
cd libav-10.5
/configure --extra-cflags=-I/opt/local/include --extra-ldflags=-L/opt/local/lib --enable-gpl --enable-version3  --enable-libvpx
make
make install

相关内容