Download FFmpeg
From FFmpeg official website: http://ffmpeg.org/download.html 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:
Configuration
This article makes a relatively simple configuration:
./configure–enable-shared–prefix=/usr/local/ffmpeg–disable-yasm
–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
Installation:
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:
- Copy all the. So files under the Lib folder directly to/usr/lib.
- Modify the configuration file in the following ways:
See the/etc/ld.so.conf file and find only one sentence inside:
Include ld.so.conf.d/*.conf
Indicates that it contains all the Conf files under LD.SO.CONF.D, so you can create a new file ffmpeg.conf in/etc/ld.so.conf.d/, which contains a sentence, which is the ffmpeg lib directory:
/usr/local/ffmpeg/lib
Run again:
sudo ldconfig
Update the Ld.so.cache 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