This article divides FFmpeg into three steps to install, and summarizes some methods and errors.
Step 1: Install the support library:
sudo apt-get install -y autoconf automake build-essential git libass-dev libfreetype6-dev libsdl2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev pkg-config texinfo wget zlib1g-dev
First error:
E: 无法获得锁 /var/lib/dpkg/lock-frontend - open (11: 资源暂时不可用)
E: 无法获取 dpkg 前端锁 (/var/lib/dpkg/lock-frontend),是否有其他进程正占用它?
reason:
The reason for this problem may be that another program is running, because it will occupy the system lock when the software source is updated (hereinafter referred to as "system update lock", this lock file is in "/var/lib/apt/ lists/" directory), and when a new apt-get process is generated, it will appear "E: Unable to obtain lock /var/lib/apt/lists/lock - open (11 : Resource temporarily unavailable)” error message!
The reason why the resource is locked may be that the last installation was not completed normally, which led to this situation.
Therefore, as long as we kill the original apt-get process and reactivate the new apt-get process, the software manager can work normally!
solution:
1. Method 1:
Use this command to check the related process of apt-get:
ps -e | grep apt
shows:
11669 ? 00:00:02 aptd
25379 ? 00:00:00 update-apt-xapi
Then execute:
$sudo kill 11669
$sudo kill 25379
But with the above method, it seems useless, so I used the second method again,
2. Method 2:
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
sudo rm /var/lib/dpkg/lock-frontend
After executing the third sentence, you can update it.
Reference link: https://blog.csdn.net/dream_follower/article/details/90311799
Step 2: Install the support library
Install the necessary libraries
There are three main installations: yasm, sdl1.2 and sdl2.0.
安装 yasm
sudo apt-get install yasm
安装sdl1.2
sudo apt-get install libsdl1.2-dev
安装 sdl2.0
sudo apt-get install libstdl2-dev
In addition to the above libraries, the following libraries can be added as needed:
sudo apt install libavformat-dev
sudo apt install libavcodec-dev
sudo apt install libswresample-dev
sudo apt install libswscale-dev
sudo apt install libavutil-dev
sudo apt install libsdl1.2-dev
If the following error occurs, it is because there is no addition sudo
, root
run with permission
E: 无法打开锁文件 /var/lib/dpkg/lock-frontend - open (13: 权限不够)
E: 无法获取 dpkg 前端锁 (/var/lib/dpkg/lock-frontend),请查看您是否正以 root 用户运行?
Step Two: Install
method one:
Download and use directly from the git repository
git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
Method Two:
Download FFmpeg source code
The download link is: http://ffmpeg.org/download.html
Compile and install FFmpeg
Go to the ffmpeg folder after decompression, and execute the following commands in sequence:
./configure
make
sudo make install
Method three:
Download and install directly.
sudo apt-get install ffmpeg
Step Three: Test
ffmpeg –version
ffmplyer –version
Original FFmpeg Full Tutorial Installation Guide - Programmer Sought
★The business card at the end of the article can receive audio and video development learning materials for free, including (FFmpeg, webRTC, rtmp, hls, rtsp, ffplay, srs) and audio and video learning roadmaps, etc.
see below!