Install SDL
ffplay relies on SDL, if there is no SDL, ffplay will not be compiled. SDL2 can be compiled and installed from source code, or installed with apt (recommended).
sudo apt install libsdl2-dev
Check the header file location after installation
whereis SDL2
# 输出
SDL2: /usr/include/SDL2
Install yasm
yasm is used to support assembly optimization. If you don’t need assembly optimization support, you can turn off yasm in the compilation options (–disable-yasm)
sudo apt install yasm
Install FFmpeg
Unzip after download
tar zxf ffmpeg-4.3.1.tar.gz
cd ffmpeg-4.3.1
In order not to pollute the source code , create a new build folder and execute configure and make operations in it. --enable-shared
Is to generate so dynamic library.
mkdir build && cd build
./../configure --prefix=/usr/local --enable-shared
make
sudo make install
Add in ~/.bashrc
# 编译时链接动态库路径
export LIBRARY_PATH=/usr/local/lib/:$LIBRARY_PATH
# 运行时链接动态库路径
export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH
Re-validate ~/.bashrc
source ~/.bashrc
test
ffmpeg -version
ffplay -version
View dependent libraries
cd /usr/local/bin
ldd ffmpeg
Uninstall
Enter the build folder and execute
sudo make uninstall