I introduced an article about C3D two days ago, and a paper similar to this article uses ffmpeg to extract video streams. What is ffmpeg and how to install it, let’s learn together today.
What is ffmpeg?
FFmpeg is a set of open source computer programs that can be used to record, convert digital audio and video, and convert them into streams. Use LGPL or GPL license. It provides a complete solution for recording, converting, and streaming audio and video. FFmpeg has very powerful functions including: video capture, video format conversion, video screenshots, video watermarking, video slicing (m3u8, ts), video recording, video streaming, and changing audio and video parameters (encoding mode, resolution, bit rate) , Bit rate, etc.) functions, etc.
For more learning, refer to FFmpeg official website:
https://ffmpeg.org/
Regarding the installation of ffmpeg, I suggest compiling and installing from source code! Because the source code compilation in Linux is the latest version, otherwise there will be some warnings! Let's learn together next!
Why install yasm?
Because after installing yasm, the compilation speed of ffmpeg can be improved.
Problems encountered in the use of ffmpeg
When compiling ffmpeg, ffmpeg yasm not found, use --disable-yasm****for a crippled build appears, because ffmpeg uses assembly instructions to improve the compilation speed, if there is no yasm instruction in the system , There will be this problem.
solve
Win system, download a yasm.exe and install it under mingw/bin, recompile, the error will not appear;
For Ubuntu system, directly enter sudo apt-get install yasm
in the terminal, after installation, recompile and it will be OK.
Red hat series can be installed through yum, etc., other Linux similar operations!
Therefore, yasm is very useful, it is recommended to use ffmpeg!
Why install SDL2?
The function of the SDL (simple directMedia Layer) library is to encapsulate the complex interactive work at the bottom of the video and audio and simplify the difficulty of video and audio processing. The data decoded by ffmpeg can be played on different platforms, such as Windows and Linux.
Install library
sudo apt-get install libsdl1.2-dev --fix-missing
SDL2 package download address:
http://www.libsdl.org/download-2.0.php
Download xxx.tar.gz format, then compile and install!
tar -xvf SDL2-2.0.9.tar.gz
cd SDL2-2.0.9/./configure
sudo make
sudo make install
download link:
https://www.ffmpeg.org/download.html
Source code compilation:
tar -xvf ffmpeg-4.1.tar.gz
cd ffmpeg-4.1/./configure
sudo make
sudo make install
ffmpeg -version
ffplay -version
Study articles:
https://www.jianshu.com/p/7be3f58cbd3b
https://blog.csdn.net/chuanglan/article/details/80534196
Recommended Posts