Install FFmpeg under Linux

Source: Internet
Author: User
Tags using git

Download FFmpeg

From FFmpeg official website: Download the latest FFmpeg installation package and unzip it using the following command:

TAR-JXVF ffmpeg-2.5.3.tar.bz2

or download it from GitHub using git:


This article makes a relatively simple configuration:


–prefix represents the directory where the program is installed, which is set to/usr/local/ffmpeg.

–enable-shared represents the generation of dynamic-link libraries, which can be used for later programming, and the resulting executable program also relies on these dynamic libraries.

–disable-yasm indicates that yasm is disabled.

Compiling the installation

It takes a while to compile, please wait patiently:



Make install

Environment configuration

After the installation is complete, four directories appear under/usr/local/ffmpeg:

    • Bin: Executable file directory
    • LIB: Dynamic link library Directory
    • Include: Header file directory for programming
    • Share

There are two ways to do this, whether the execution of a program or an executable is dependent on the dynamic library under Lib:

    1. Copy all the. So files under the Lib folder directly to/usr/lib.
    2. Modify the configuration file in the following ways:

See the/etc/ file and find only one sentence inside:


Indicates that it contains all the Conf files under LD.SO.CONF.D, so you can create a new file ffmpeg.conf in/etc/, which contains a sentence, which is the ffmpeg lib directory:


Run again:

sudo ldconfig

Update the for the changes to take effect.

In order to be able to run directly with FFmpeg in any place, instead of running the program in the same way as./ffmpeg or/usr/local/ffmpeg/bin/ffmpeg, you can copy the executable to the Bin directory:

sudo cp/usr/local/ffmpeg/bin/ffmpeg/usr/local/bin/
sudo cp/usr/local/ffmpeg/bin/ffprobe/usr/local/bin/
sudo cp/usr/local/ffmpeg/bin/ffserver/usr/local/bin/

Or you can create a link by using the following method:

sudo ln-s/usr/local/ffmpeg/bin/ffmpeg/usr/local/bin/
sudo ln-s/usr/local/ffmpeg/bin/ffprobe/usr/local/bin/
sudo ln-s/usr/local/ffmpeg/bin/ffserver/usr/local/bin/

Installation Complete

At this point, the installation is complete as shown in:

Install FFmpeg under Linux

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: 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.