Install FFmpeg in Linux-Linux Enterprise Application-Linux server application information. For details, refer to the following section. After ffmpeg is successfully installed in Redhat 9.0, the following is a record.
I downloaded ffmpeg-0.4.9-p200w.tar.bz2 on this network. I saw someone using svn to download it online, but I didn't have the svn client in my machine. Then I searched for it online and downloaded the version. If svn is used, you can download the latest ffmpeg version.
Among them: -- enable-shared is to allow it to compile and generate dynamic libraries, which will be used in future programming. -- Prefix specifies the installation directory.
4. Compile and install
Make
Make install
5. After installation, there will be three directories in/usr/local/ffmpeg.
Lib dynamic link library location
Header files are used for include programming.
Bin execution file directory
6. To facilitate programming in the future, copy the Three Link Libraries libavcodec. so libavformat. so libavutil. so in lib to/usr/lib. Copy the ffmpeg directory under the include directory to the/usr/include directory.
Run ffplay in the bin directory to play audio or video files. Example 1. MP3
./Ffplay 1.mp3
In addition, the bin directory contains two files: ffmpeg and ffserver.
Ffmpeg is a good Conversion Tool for video and audio formats. There are many instructions on the Internet. If you do not want to generate ffserver, you only need to add -- disable-ffserver in./configure.
7. Programming
If you have written a test. c file that contains the ffmpeg header file, you can write it as follows:
# Include
Compile: gcc-o test. c-lavformat-lavcodec-lavtuil (the premise is that there are 6th steps)
If there are no 6th operations, the compilation process is as follows:
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 above method uses the dynamic library to compile ffmpeg. If -- enable-shared is not added during configure, the static link is used and the Three dynamic libraries are not generated. At the same time, the generated ffplay and ffmpeg execution files are also large, because they can be executed without the support of dynamic libraries. But it is not conducive to re-development, so I use dynamic links. There are many options in configure, which can be viewed through./configure -- help, or directly view the configure file. This is important during configuration.
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