原文:https://blog.csdn.net/thomaszhaoyc/article/details/78233555
1.库文件:
生成编译ffplay的配置,最后查找原因是由于缺少了两个库:
sdl2.0
sdl1.2
安装sdl1.2十分方便,直接通过apt-get进行:
$ sudo apt-get install libsdl1.2-dev
安装成功。接下来安装sdl2.0
$ tar -zxvf SDL2-2.0.6.tar.gz
解压之后进入文件夹,进行编译安装:
$ ./configure
$ make
$ sudo make install
2.安装FFMPEG4.0
首先在官网上下载最新的FFmpeg
压缩包的格式是.tar.bz2,解压压缩文件,以ffmpeg-4.0.tar.bz2为例,这里需要用到的命令是:
tar -jxvf ffmpeg-3.3.4.tar.bz2
然后到解压下的文件夹下查看INSTALL.md
cat INSTALL.md
#Installing FFmpeg:
1. Type `./configure` to create the configuration. A list of configure
options is printed by running `configure --help`.
`configure` can be launched from a directory different from the FFmpeg
sources to build the objects out of tree. To do this, use an absolute
path when launching `configure`, e.g. `/ffmpegdir/ffmpeg/configure`.
2. Then type `make` to build FFmpeg. GNU Make 3.81 or later is required.
3. Type `make install` to install all binaries and libraries you built.
NOTICE
------
- Non system dependencies (e.g. libx264, libvpx) are disabled by default.
$ ./configure
$ make
$ sudo make install
安装成功,查看版本
$ ffmpeg -version && ffplay
ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.9) 20160609
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 version 4.0 Copyright (c) 2003-2018 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.9) 20160609
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
Simple media player
usage: ffplay [options] input_file