FFmpeg官網:http://www.ffmpeg.orgbash
官網介紹
FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATEacross Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations.ide
下載安裝
- 下載最新源碼包並解壓
$ wget http://ffmpeg.org/releases/ffmpeg-3.1.3.tar.bz2 $ tar jxvf ffmpeg-3.1.3.tar.bz2
- 安裝ffmpeg
$ cd ffmpeg-3.1.3 $ ./configure

報了錯誤,提示
yasm
沒有安裝
- 安裝yasm
解決錯誤:安裝yasm編譯器。安裝方法以下:post
1)下載:[yasm的下載連接](http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz)ui
2)解壓:把下載下來的壓縮包進行解壓spa
3)切換路徑: cd yasm-1.3.0.net
4)執行配置: ./configure3d
5)編譯:makecode
6)安裝:make install(提示:Permission denied,就執行sudo make install)orm
- 繼續安裝ffmpeg
$ ./configure $ make $ make install
- 安裝成功
$ ffmpeg
輸入ffmpeg
打印了相關信息,表示安裝成功視頻

設置軟鏈接 ln -s /usr/local/ffmpeg/bin/ffmpeg /usr/local/bin/ffmpeg把視頻轉換爲圖片ffmpeg -i "3.mp4" -r 1 -q:v 2 -f image2 pic-%03d.jpeg