1、下载ffmpeg
下载网址:http://www.ffmpeg.org/download.html
2、环境
PC操作系统:Ubuntu kylin 14.04
FFmpeg Source:ffmpeg-3.2.2.tar.bz2
3、安装SDL
网上常见的SDL安装步骤介绍如下:
SDL是一个开源的多媒体开发库,可以设置图像和视频的绘制等操作。如果不安装SDL,FFMPEG将不能生成ffplay.exe播放器。在Ubuntu下安装SDL也很简单,只需要依次执行下列命令:
sudo apt-get install libsdl1.2-dev
sudo apt-get install libsdl-image1.2-dev
sudo apt-get install libsdl-mixer1.2-dev
sudo apt-get install libsdl-ttf2.0-dev
sudo apt-get install gfx1.2-dev
在./configure后,发现ffplay不支持,查到原因是ffmpeg 3.2.2版本不再支持sdl1.2,需要使用sdl2。所以安装sdl2后可以configure出ffplay。执行命令:
sudo apt-get install libsdl2-dev
FFmpeg官网说明如下:
http://www.ffmpeg.org/index.html#news
September 24th, 2016, SDL1 support dropped.
Support for the SDL1 library has been dropped, due to it no longer being maintained (as of January, 2012) and it being superseded by the SDL2 library. As a result, the SDL1 output device has also been removed and replaced by an SDL2 implementation. Both the ffplay and opengl output devices have been updated to support SDL2.
4、安装yasm
yasm用于x264中汇编语言优化
在Ubuntu下安装yasm也很简单,只需要执行如下命令:
sudo apt-get install yasm
5、配置
./configure --prefix=/usr/local/ffmpeg
6、编译安装
make
make install
7、ffplay播放测试
./ffplay xx.mp4