Ubuntu 18.04 source code compile and install ffmpeg4.1

Ubuntu 18.04 source code compile and install ffmpeg4.1

0. Introduction

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!

1. Install yasm

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!

2. Install SDL2

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

3. Install ffmpeg4.1

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

4. Test

ffmpeg -version

ffplay -version

Study articles:

https://www.jianshu.com/p/7be3f58cbd3b
https://blog.csdn.net/chuanglan/article/details/80534196

Recommended Posts

Ubuntu 18.04 source code compile and install ffmpeg4.1
Compile and install OpenJDK8 from source code under Ubuntu 18.04.1
CentOS7.5 source code compile and install mysql5.7.29
CentOS7.4 source code compile and install MySQL8.0
Ubuntu 16.04 compile and install PHP 7.2
How to compile and install xdebug from source code in Ubuntu environment
Compile FFMPEG source code under CentOS7
Compile and install QEMU under Ubuntu
Ubuntu 18.04 install Odoo14 tutorial through source code
CentOs7.3 compile and install Nginx 1.9.9
ubuntu install and configure GitLab
Centos compile JDK8 source code
Centos7 compile and install ntp-4.2.8p11
CentOS 6.9 compile and install python
CentOS 6 compile and install python 3
Ubuntu16.04 install SVN and configuration
Ubuntu16.04 install and uninstall VMware-Workstation 14
How to compile and install PHP and Nginx in Ubuntu environment
CentOS Yum compile and install MySQL 5.6
Compile and install LAMP under Centos 5.2
Install and configure MySQL on Ubuntu
CentOS 6.x compile and install Nginx
Install and configure Docker in Ubuntu
CentOS7 compile and install L(A|N)MP environment
Android source code compilation (ubuntu16.04 64-bit)
Install and deploy Gerrit under Ubuntu
Install nodejs and npm under Ubuntu 16.04
Linux CentOS6 compile and install Pyt
Ubuntu configuration source and installation software
Install Gnome and VNC on Ubuntu Server
Compile and install libmodbus library under CentOS7
[Daily] Win10 open and install ubuntu subsystem
Ubuntu install Elasticsearch and elasticsearch-analysis-ik word segmentation
Install docker on ubuntu and basic usage
Ubuntu19.10 compile and run C language program
Centos7 compile and install MySQL8 problem record
Install fonts on Ubuntu and switch default fonts
Install Zimbra Open Source Edition on Ubuntu 14.04
Ubuntu install PHP and PHP Nginx configuration method
Download OpenJDK11 source code in Ubuntu environment
Install and uninstall CUDA and CUDNN on Ubuntu
Compile and install nodejs and yum in Centos8
Linux install Docker and run Ubuntu system
Ubuntu install ftp server and possible problems
How to install Ubuntu20.04 and install NVIDIA driver
Edit OpenJDK11 source code in Ubuntu environment
How to install Visual Studio Code on Ubuntu 20.04
How to install Pycharm and Ipython on Ubuntu 16.04/18.04
How to install and configure NATS on Ubuntu 16.04
Install JDK and configure environment variables on Ubuntu 16.04
How to install and configure Gogs on Ubuntu 18.04
ubuntu18.04 install python2
How to install and configure Cyberpanel on Ubuntu 18.04
Debian and Ubuntu installation source configuration file description
How to install and secure phpMyAdmin on Ubuntu 16.04
How to install and configure ownCloud on Ubuntu 16.04
How to install and configure ownCloud on Ubuntu 16.04
ubuntu12.04 install python3
Install and use Git and GitHub on Ubuntu Linux
How to install openssh from centos 7 source code
Ubuntu install guide