Compile FFmpeg in Ubuntu
Previously, we successfully used mingw + msys to compile FFmpeg on the Windows platform (see examples and generate ffplay.exe. Now recompile on the Ubuntu platform. Compared to the time-consuming and extremely difficult work required for compiling on Windows, compiling FFmpeg on Ubuntu is very easy and simple, and several simple commands can be easily completed.
First, you need to call the command line interface on the Ubuntu interface. The most convenient way is to use the shortcut key Ctrl + Alt + T.
The second step is to install SDL. SDL is an open-source multimedia development library that allows you to set image and video rendering operations. If sdlis not installed, ffmpegcannot generate the ffplay.exe player. Installing SDL in Ubuntu is also very easy. You only need to execute the following commands in sequence:
Sudo apt-get install libsdl1.2-dev
Sudo apt-get install libsdl-image1.2-dev
Sudo apt-get install libsdl-mixer1.2-dev
Sudo apt-get install libsdl-ttf2.0-dev
Sudo apt-get install gfx1.2-dev
The third part is to install x264 and yasm. X264 is a very popular video codec tool, and yasm is used for assembly language optimization in x264. When installing yasm, you must obtain the root permission of the system by using the following command:
Sudo passwd root
Then, in the root mode:
Su root
Disable root mode:
Sudo passwd-l root
Yasm needs to download the source code on the official website, decompress the package, and manually compile and install it:
./Configure
Make
Make install
During compilation, most of the Code is compiled in this way.
Download the X264 source code from the official website and compile the Code:
. /Configure -- prefix =/usr -- enable-shared <span style = "white-space: pre"> </span> // The prefix must be specified, otherwise, libx264 cannot be found when ffmpeg is compiled.
Make
Make install
The fourth step is to install other dependency libraries of ffmpeg, which are completed using two commands:
Sudo apt-get update
Sudo apt-get install build-essential subversion git-core checkinstall yasm texi2html libfaac-dev libfaad-dev libmp3lame-dev libsdl1.2-dev libtheora-dev libx11-dev libxvidcore4-dev zlib1g-dev
It is best to download the ffmpeg source code from the ffmpeg official website, decompress and compile the code.
. /Configure -- enable-gpl -- enable-nonfree -- enable-pthreads -- enable-libfaac -- enable-libmp3lame -- enable-libtheora -- enable-libx264 -- enable-libxvid -- enable-x11grab -- enable-libopencore-amrnb -- enable -libopencore-amrwb -- enable-libopencore-amrnb -- enable-version3 -- disable-optimizations -- disable-asm
Make
Make install
Then, we can see that ffmpeg.exe/ffplay.exe/ffprob.exe has been generated in/usr/local/bin. You can use ffplay.exe to play a video file in the command line.
Compile FFmpeg in Linux to download and compile the source file
Linux compiling and upgrading FFmpeg
Install FFMPEG on CentOS 5.6
Install FFmpeg in Ubuntu
Compile ffmpeg in Ubuntu 12.04
Install FFmpeg 2.2.2 In PPA in Ubuntu 14.04
FFmpeg details: click here
FFmpeg: click here