现在的位置: 首页 > 综合 > 正文

FFMpeg 源码编译 在ubuntu

2013年10月03日 ⁄ 综合 ⁄ 共 2409字 ⁄ 字号 评论关闭

1. ffmpeg的下载:我们就可以通过svn命令获取最新的ffmpeg,命令如下:

svn co svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg

进入ffmpeg目录

配置编译
   for x86
#./configure --prefix=/usr/local

它会依懒于yasm 一些模块,如果ubuntu没有安装该软件,需要到ubtuntu ->系统-》系统管理-》新立得软件包管理-》搜索并安装一下

默认安装

然后再执行#./configure --prefix=/usr/local

执行完,直接执行 make

2. support more

*xvid

安装xvid的获取地址如下:
http://www.xvid.org/
wget
http://downloads.xvid.org/downloads/xvidcore-1.1.3.tar.gz

配置编译
   for x86

andy@andy-desktop:~/FFMpeg/xvidcore-1.1.3$ find -name configure
./build/generic/configure
andy@andy-desktop:~/FFMpeg/xvidcore-1.1.3$ ./build/generic/configure --prefix=/usr/local
andy@andy-desktop:~/FFMpeg/xvidcore-1.1.3/build/generic$ make

andy@andy-desktop:~/FFMpeg/xvidcore-1.1.3/build/generic$ sudo make install
[sudo] password for andy:
  D: /usr/local/lib
  I: /usr/local/lib/libxvidcore.so.4.1
  I: /usr/local/lib/libxvidcore.a
  D: /usr/local/include
  I: /usr/local/include/xvid.h

*x264

官网http://www.videolan.org/developers/x264.html

Getting x264

The latest x264 source code can always be found by anonymous
git
repository:

# git clone git://git.videolan.org/x264.git

andy@andy-desktop:~/FFMpeg/x264/x264$ git clone git://git.videolan.org/x264.git

配置编译
   for x86
#./configure --enable-shared --prefix=/usr/local

可能会出现以下错误情况:

andy@andy-desktop:~/FFMpeg/x264/x264$ ./configure --enable-shared --prefix=/usr/local
Found yasm 0.8.0.2194
Minimum version is yasm-1.0.0
If you really want to compile without asm, configure with --disable-asm.
====》解决方法:可直接到yasm官网下载源码安装:

http://yasm.tortall.net/releases/Release1.2.0.html 下载1.0以上的版本

解压 然后make install

On UNIX-compatible operating systems, Yasm builds using the standard “./configure; make; make install” commands. GNU make is not required. While Yasm development requires a larger toolchain (see the HACKING file), building Yasm should not require more than
just a C compiler.

===========

再次执行

andy@andy-desktop:~/FFMpeg/x264/x264$ ./configure --enable-shared --prefix=/usr/local
#make
#sudo make install

andy@andy-desktop:~/FFMpeg/x264/x264$ sudo make install
[sudo] password for andy:
install -d /usr/local/bin
install x264 /usr/local/bin
install -d /usr/local/include
install -d /usr/local/lib
install -d /usr/local/lib/pkgconfig
install -m 644 x264.h /usr/local/include
install -m 644 x264_config.h /usr/local/include
install -m 644 x264.pc /usr/local/lib/pkgconfig
ln -f -s libx264.so.120 /usr/local/lib/libx264.so
install -m 755 libx264.so.120 /usr/local/lib

*Lame

lame的获取地址如下:
http://lame.sourceforge.net/index.php

解压tar -xvf lame-3.99.3.tar.gz

andy@andy-desktop:~/FFMpeg/lame-3.99.3$ ./configure --enable-shared --prefix=/usr/local
make

sudo make install 

抱歉!评论已关闭.