Install FFmpeg on Ubuntu

Source: Internet
Author: User
Tags automake

installation package and main steps:

1. First install the system base environment

RHEL & CentOS Series: Yum install-y automake autoconf libtool gcc gcc-c++

Debian & Ubuntu Series: Apt-get install Automake autoconf libtool gcc gcc-c++

2. Download the latest FFmpeg source package

FFmpeg official: http://ffmpeg.org/download.html.

General direct use of the latest version, after the download is done, unzip, into the source folder, run "./configure--help" View Help, here is mainly to confirm the need to install the extension, some extensions are already open by default, and some need to download the extension source package separately to compile. For my needs, for example, you need to compile yasm, lame, Oencore AMR, AMRNB, and AMRWB separately, where lame is the MP3 decoder.

3. Compile the required source code package

Download the five source code packages from each official address, to ensure compatibility with the latest version of FFmpeg, be sure to also download the latest version of the Code:

Yasm:http://yasm.tortall.net/download.html

lame:http://lame.sourceforge.net/download.php

Oencore AMR:HTTP://SOURCEFORGE.NET/PROJECTS/OPENCORE-AMR

Amrnb & AMRWB:HTTP://WWW.PENGUIN.CZ/~UTX/AMR

Unzip and compile each of the above source packages, and use the "./configure && make && make install" button directly.

4. Compiling FFMPEF

Go back to the FFmpeg source directory, open the desired extension and compile the ffmpeg:

./configure--enable-libmp3lame--enable-libopencore-amrnb--ENABLE-LIBOPENCORE-AMRWB--enable-version3-- Enable-shared

Make && make install

Ldconfig

After the last write to config, the terminal runs the FFmpeg command, the success and installed extensions appear, and the run succeeds.

5. Issues that may be encountered

FFmpeg default installation directory is "/usr/local/lib", some 64-bit systems under the software directory is "/usr/lib64", the compilation process may appear "ffmpeg:error while loading shared libraries: Libmp3lame.so.0:cannot open Shared object file:no such file or directory "Similar error, the solution is to establish a soft link or move the library files to the appropriate directory:

Ln-s/usr/local/lib/libmp3lame.so.0.0.0/usr/lib64/libmp3lame.so.0

mv/usr/local/lib/libmp3lame.so.0.0.0/usr/lib64/libmp3lame.so.0

6. How to use

MP3 conversion amr:ffmpeg-i 1.mp3-ac 1-ar 8000 1.amr

AMR Conversion Mp3:ffmpeg-i 1.amr 1.mp3

Problems encountered and resolved:

1. Error:libopenjpeg not Found

http://code.google.com/p/openjpeg/downloads/detail?name=openjpeg-1.5.1.tar.gz&can=2&q=

Download openjpeg-1.5.1 Code, note Do not download openjpeg-2.0, otherwise ffmpeg and openjpeg interface is not supported, compile error.

Configure
Make,make Install

Find the header file is under/usr/local/include/openjpeg-1.5.1, and ffmpeg in the connection, is actually/usr/local/include, so the hint said "Error:libopenjpeg not found ”。 Copy the header file "Openjpeg.h" below/usr/local/include/openjpeg-1.5.1 to/usr/local/include below.

1,X264 also has this problem, x264.h this file to be placed under/usr/local/include, rather than under the/usr/local/to build a separate subdirectory. The other libraries are subfolders that were built on make install.

libx264 library files need to be copied to/usr/local/lib
Or, change the path directly in configure, as follows:
./configure--includedir=/usr/local/include--libdir=/usr/local/lib--enable-shared
Can.

2. ERROR:LIBFDK_AAC not Found

Http://sourceforge.net/projects/opencore-amr/?source=directory

Download fdk-aac-0.1.1.tar.gz

Perform

Configure

Make

Make install

3. ERROR:LIBILBC not Found

Https://github.com/dekkers/libilbc

git clone git://github.com/dekkers/libilbc.git

Extract

Install the CMake as shown below

sudo apt-get install CMake

Create a build directory and execute:

CD Build
CMake. (Here's the..) Meaning, if it is a. Represents CMakeLists.txt under the current path, two: Represents CMakeLists.txt in the previous level directory)

CMake install.
Make (the executable file will be found under Build/bin. )

Make install (copy the generated library to the Linux-related directory)

4. Error:libmp3lame >= 3.98.3 not found

sudo apt-get install Libmp3lame-dev

5. Error:libopencore_amrnb not Found

 sudo apt-get install libx264-dev libxvidcore-dev libopencore-amrwb-dev Libopencore-amrnb-dev Libfaad-dev Libfaac-dev libmp3lame-dev libtwolame-dev liba52-0.7.4-dev libcddb2-dev libcdaudio-dev libcdio-cdda-dev Libvorbis-dev Libopenjpeg-dev 

(5) Git chone git://git.videolan.org/x264.git
Configure
make && make install
(6) Error:libvo_aacenc not found
http://sourceforge.net/projects/opencore-amr/files/vo-aacenc/ Vo-aacenc-0.1.2.tar.gz/download
(7) Error:libvo_amrwbenc not found
http://sourceforge.net/projects/ opencore-amr/files/vo-amrwbenc/
(8) ERROR:LIBVPX decoder version must be >=0.9.1
http://code.google.com/p/ Webm/downloads/detail?name=libvpx-v1.1.0.tar.bz2&can=2&q=
(9) Compiling ffplay requires Libsdl1.2-dev library:
sudo apt-get install Libsdl1.2-dev (TEN) ffmpeg:error while loading shared libraries:libavdevice.so.52:cannot open Shared Object File

Solution:
Search the file libavdevice.so.52 on the server using the ' Find ' command

1 # find / -name libavdevice.so.52

You need to add the path to the directory of the file is in, the ' ld.so.conf ' file. If For example the file is located under "/usr/local/lib" directory, execute

1 # vi /etc/ld.so.conf

and add the following at the bottom of the file

/usr/local/lib

7. Encoder (codec ID 86017) not found for output stream #0.0

Solution: Http://diogomelo.net/blog/11/encoder-codec-id-86017-not-found-output-stream-00-compile-ffmpeg-yourself

Install FFmpeg on Ubuntu

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.