Install ffmpeg in linux

Source: Internet
Author: User
Install ffmpeg1 in linux and download ffmpeg. 2 unzip tarxvfjffmpeg-0.11.1.tar.bz2 to obtain the decompressed directory is ffmpeg-0.11.13, configure www.2cto.com./configure -- enable-shared -- prefix/usr/local/ffmpeg...
Install ffmpeg 1 in linux and download ffmpeg. 2, unzip tar xvfj ffmpeg-0.11.1.tar.bz2 to obtain the directory after decompression is ffmpeg-0.11.1 3, configure www.2cto.com. /configure -- enable-shared -- prefix =/usr/local/ffmpeg Where: -- enable-shared allows it to compile and generate dynamic libraries, these dynamic libraries will be used in future programming. -- Prefix specifies the installation directory. 4. Compile and install make install. 5. after installation, you will see four directories in/usr/local/ffmpeg: lib dynamic link library location. For include programming, the directory where the bin execution file of the header file is used. share 6. to facilitate programming in the future, we put the three link libraries libavcodec in lib. so libavformat. so libavutil. copy so 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. For example, tutorial 1.mp3./ffplay 1.mp3 www.2cto.com. In addition, there are two files in the bin directory: ffmpeg and ffserver ffmpeg are good video and audio format conversion tools. 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 a test is written. to include the ffmpeg header file in the c file, you can write: # include "" compile: gcc-o test. c-lavformat-lavcodec-lavtuil (provided that there are steps 6th). if there are no 6th operations, compile as follows: www.2cto.com gcc-o test. after c-I/usr/local/ffmpeg/include-L/usr/local/ffmpeg/lib-lavformat-lavcodec-lavtuil is compiled successfully, the dynamic library is required for 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.
Related Article

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.