linux(php環(huán)境) 安裝ffmpeghttps://www.cnblogs.com/lpyan/p/9015890.html
實(shí)現(xiàn)上傳視頻獲取視頻的第一幀當(dāng)做視頻封面
1、安裝ffmpeg
ffmpeg的下載鏈接https://ffmpeg.org/download.html
解壓安裝包
tar -jxvf ffmpeg-4.0.tar.bz2? ? ? ??
//可能這一步會(huì)報(bào)錯(cuò),如果報(bào)錯(cuò)是??yasm/nasm not found or too old. Use --disable-yasm for a crippledbuild錯(cuò)誤? ?
參考網(wǎng)址https://blog.csdn.net/yzhang6_10/article/details/75635734
在http://www.tortall.net/projects/yasm/releases下面找到適合自己平臺(tái)的yasm版本勘天。然后進(jìn)行安裝。舉例如下:
1)下載:wgethttp://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
2)解壓:tar zxvf yasm-1.3.0.tar.gz
3)切換路徑: cd yasm-1.3.0
4)執(zhí)行配置: ./configure
5)編譯:make
6)安裝:make install
進(jìn)入目錄
cd?ffmpeg-4.0
編譯安裝
./configure --enable-shared && make && make install
安裝完成之后 執(zhí)行 ffmpeg
如果能夠出現(xiàn)類似下列信息,說(shuō)明ffmpeg安裝成功昆咽。
ffmpeg version 4.0 Copyright (c)?2000-2018?the FFmpeg developers
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-18)
configuration: --enable-shared
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
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
Use -h to get full help or, even better, run 'man ffmpeg'
如果出現(xiàn):
ffmpeg: error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory
編輯這個(gè)文件? ? vim /etc/ld.so.conf
加上? ?
include ld.so.conf.d/*.conf
/usr/local/ffmpeg-4.0
執(zhí)行l(wèi)dconfig
再次輸入?ffmpeg
以上就是我遇到的問(wèn)題 并解決
need-to-insert-img
1人點(diǎn)贊
作者:往事love隨緣
鏈接:http://www.reibang.com/p/db107bbae302
來(lái)源:簡(jiǎn)書
著作權(quán)歸作者所有惜犀。商業(yè)轉(zhuǎn)載請(qǐng)聯(lián)系作者獲得授權(quán),非商業(yè)轉(zhuǎn)載請(qǐng)注明出處马昨。