FFmpeg is a very powerful audio and video processing tool, the official website is: http://ffmpeg.org/website Introduction FFmpeg is: A complete, cross-platform solution, can record, transform and transfer audio and video. FFmpeg can play video as well as command line tools to handle video, there is also a powerful video processing library for development, the following is the example of Linux to introduce ffmpeg installation process of the simple command line to transcode video, is the most simple entry in FFmpeg.
First go to the official website download source package, here download is the latest ffmpeg-3.3.1.tar.bz2, download after uploading to Linux ready to install, first unpack the installation package:
tar -xjvf ffmpeg-3.3. 1. Tar . BZ2CD ffmpeg-3.3. 1/
If the Configure configuration is now executed directly, the following error may be reported:
The error means that the YASM/NASM package does not exist or is very old, you can use--disable-yasm disable this option to compile, Yasm is a assembler, and is completely rewritten NASM assembly environment, receive NASM and gas syntax, support x86 and AMD64 instruction set, So here to install Yasm can, is: http://yasm.tortall.net/Download.html enter after the download 1.3.0 source package, execute the following command installation:
tar -xvzf yasm-1.3. 0. Tar . GZCD yasm-1.3. 0/. /Configuremake doinstall
Compile parameters are the default, directly installed in the system, and then continue to the successful installation after the FFmpeg extracted directory, execute the following command to compile and install:
./configure--enable-shared--prefix=/monchickey/ffmpegmake doinstall
The compilation process is a bit long, wait patiently for completion cd/monchickey/ffmpeg/ go to the installation directory and see Bin,include,lib,share 4 directories, where bin is the FFmpeg main program binary directory , include is the C + + header file directory, Lib is a compiled library file directory, share is the document directory, and then into the bin directory, execute ./ffmpeg-version View the details of the current version, which is generally reported by default to Libavdevice.so.57:cannot open shared object file:no such file or directory, The reason is that the Lib directory is not loaded into the system library, the System LD directory list in/etc/ld.so.conf, open the file will be found, which refers to/etc/ld.so.conf.d/below all of the. conf files, such as mariadb-x86_64. conf We just need to create a file and write to the Lib path, execute the command: vim/etc/ld . so.conf.d/ffmpeg.conf Then add a line of content: /monchickey/ffmpeg/lib then save and exit, then execute ldconfig make the configuration take effect, now execute again ./ffmpeg-version display is normal
You can then add the bin directory to the environment variable as needed to ensure you can use the FFmpeg command at any time, and test the video transcoding below:
First by an AVI format video file, size is 37M, now use ffmpeg conversion to MP4 format, execute the following command:
Ffmpeg-i Test.avi Out.mp4
After confirmation, see the screen scrolling started processing, about half a minute after the video is converted, after the conversion of the MP4 video size is 17M, specifically can download it to see
Now that the FFmpeg installation and the simplest command-line video conversion is complete, the ffmpeg command-line tool can actually have a lot of parameters without programming to achieve powerful functions, this very cow
Install FFmpeg under Linux