Compile FFmpeg in Ubuntu10.10

Source: Internet
Author: User
Version Ubuntu10.10, refer to some compilation methods on the Internet. 1. Download git. According to the official documentation, download and compile ffmpeg requires git implementation. Therefore, download the git command: sudoapt-getinstallgitgit-core: Update git to the latest version. Run the following command: gitclonegit: // git.kernel.org/pub/scm/git/git.git?install git=and run the following command:

Ubuntu 10.10

1. Download git. According to the official documentation, You need to download and compile ffmpeg. Therefore, download the git command:

Sudo apt-get install git-core

Run the following command to update git to the latest version:

Git clone git: // git.kernel.org/pub/scm/git/git.git

To view the installed git version, run the following command:

Git -- version

 


2. Download The ffmpeg command:

Git clone git: // source.ffmpeg.org/ffmpeg.git ffmpeg

The source code of ffmpeg has been downloaded. You can first package it into a compressed package for backup. command:

Tar czf ffmpeg.tar.gz ffmpeg/

You can directly extract the data as needed. The command is as follows:

Tar xzf ffmpeg.tar.gz

 


3. Set up the c/c ++ program environment (this is not required if it has been set up)

Install the vim Editor

Apt-get install vim

Install c/c ++ compilation tools, including "gcc, g ++, gdb, make"

Apt-get install build-essential

You can use "gcc-v" to check whether the installation is successful.

Install related tools to automatically generate makefile. command:

Apt-get install automake1.9

In this way, the dependent tools will also be installed, including autoscan, aclocal, autoconf, and automake. With these tools, you don't have to write makefile on your own in a large development project.

 


4. Install the dependent Database: command:

Sudo apt-get install subversion checkinstall yasm texi2html libfaac-dev libfaad-dev libmp3lame-dev libsdl1.2-dev libtheora-dev libx11-dev libxvidcore4-dev zlib1g-dev

Note: The dependency libraries used for compiling ffmpeg posts on the Internet are different, and I don't know what is useful.

 

 

5. Install x264 with the following command:

$ Git clone git: // git.videolan.org/x264.git


$ Cd x264
$./Configure
$ Make
$ Sudo make install

 

 

6. Compile ffmpeg

Go to the ffmpeg directory

./Configure -- enable-gpl -- enable-libmp3lame -- enable-libxvid -- enable-libfaac -- enable-nonfree -- enable-shared -- enable-static -- prefix =/usr/local/ffmpeg

Note: -- enable-shared is used to allow compilation to generate a dynamic library, so -- enable-static should be used to generate a static library, which will be used in future programming. -- Prefix setting installation directory

Note:

The final compilation is complete. There are four directories in/usr/local/ffmpeg.

Lib dynamic link library location


Header files are used for include programming.
Bin execution file directory


There is also a share folder

To facilitate programming in the future, we put the so file in lib (so file is equivalent to dynamic library file dll, o file is equivalent to the compiled target file, and a file is a static library) copy to/usr/lib. Copy the ffmpeg directory under the include directory to the/usr/include directory.

After the compilation is successful, the dynamic library must be supported during execution, and the three dynamic library files must be copied to/usr/lib or/lib, otherwise, the dynamic library link cannot be found during execution. Another way to solve this problem is to add the/usr/local/ffmpeg/lib directory to/etc/ld. so. in config, execute ldconfig, or restart the computer, so that the system can find these three dynamic library files from the directory/usr/local/ffmpeg/lib.

The dependency library and configure commands used on the Internet:

1,

Sudo apt-get install build-essential libgtk2.0-dev libjpeg62-dev libtiff4-dev libjasper-dev libopenexr-dev cmake python-dev python-numpy libtbb-dev libeigen2-dev yasm libfaac-dev libopencore-amrnb-lidev bopencore -amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev

. /Configure -- enable-gpl -- enable-version3 -- enable-nonfree -- enable-postproc -- enable-libfaac -- enable-libopencore-amrnb -- enable-libopencore-amrwb -- enable-libtheora -- enable -- enable-libxvid -- enable-x11grab -- enable-swscale -- enable-shared

2,

Sudo apt-get install build-essential libxvidcore4-dev libfaad-dev libfaac-dev libmp3lame-dev subversion

./Configure -- enable-gpl -- enable-libmp3lame -- enable-libxvid -- enable-libfaac -- enable-nonfree

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.