一、准备软件:
下载SDL2 http://www.libsdl.org/download-2.0.php
下载FFmpeg http://ffmpeg.org/download.html
$ wget http://www.libsdl.org/release/SDL2-2.0.8.tar.gz
$ wget https://ffmpeg.org/releases/ffmpeg-4.0.2.tar.bz2
安装SDL是为了安装ffplay,否则编译安装ffmpeg不会安装ffplay
二、安装软件
1、安装yasm
$ sudo apt-get install yasm
2、安装sdl1.2
$ sudo apt-get install libsdl1.2-dev
3、安装sdl2.0
$ tar -zxvf SDL2-2.0.8.tar.gz
$ cd SDL2-2.0.8
$ mkdir build
$ cd build
$ ../configure
$ make
$ sudo make install
三、安装ffmpeg
$ tar jxvf ffmpeg-4.0.2.tar.bz2
$ cd ffmpeg-4.0.2
$ mkdir build
$ cd ./build
$ ../configure
$ make
$ sudo make install
查看ffmpeg版本:
$ ffmpeg -version
ffmpeg version 4.0.2 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
configuration:
libavutil 56. 14.100 / 56. 14.100
libavcodec 58. 18.100 / 58. 18.100
libavformat 58. 12.100 / 58. 12.100
libavdevice 58. 3.100 / 58. 3.100
libavfilter 7. 16.100 / 7. 16.100
libswscale 5. 1.100 / 5. 1.100
libswresample 3. 1.100 / 3. 1.100
查看ffplay版本:
$ ffplay -version
ffplay version 4.0.2 Copyright (c) 2003-2018 the FFmpeg developers
built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
configuration:
libavutil 56. 14.100 / 56. 14.100
libavcodec 58. 18.100 / 58. 18.100
libavformat 58. 12.100 / 58. 12.100
libavdevice 58. 3.100 / 58. 3.100
libavfilter 7. 16.100 / 7. 16.100
libswscale 5. 1.100 / 5. 1.100
libswresample 3. 1.100 / 3. 1.100