您好,登錄后才能下訂單哦!
這篇文章主要介紹“Linux怎么安裝ffmpeg”的相關(guān)知識(shí),小編通過(guò)實(shí)際案例向大家展示操作過(guò)程,操作方法簡(jiǎn)單快捷,實(shí)用性強(qiáng),希望這篇“Linux怎么安裝ffmpeg”文章能幫助大家解決問(wèn)題。
mpeg 是領(lǐng)先的多媒體框架,能夠解碼、編碼、轉(zhuǎn)碼、混合、解密、流媒體、過(guò)濾和播放人類和機(jī)器創(chuàng)造的幾乎所有東西。它支持最晦澀的古老格式,直到最尖端的格式。
官網(wǎng)下載:http://ffmpeg.org/download.html
tar -xjvf ffmpeg-4.1.tar.bz2` `cd ffmpeg-4.1/
[root@slave ffmpeg-4.1]# ./configure gcc is unable to create an executable file. If gcc is a cross-compiler, use the --enable-cross-compile option. Only do this if you know what cross compiling means. C compiler test failed. If you think configure made a mistake, make sure you are using the latest version from Git. If the latest version fails, report the problem to the ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net. Include the log file "ffbuild/config.log" produced by configure as this will help solve the problem.
錯(cuò)誤的意思是 yasm/nasm 包不存在或者很舊,可以使用–disable-yasm禁用這個(gè)選項(xiàng)編譯,yasm是一款匯編器,并且是完全重寫(xiě)了nasm的匯編環(huán)境,接收nasm和gas語(yǔ)法,支持x86和amd64指令集,所以這里安裝一下yasm即可
官網(wǎng)下載:http://yasm.tortall.net/Download.html
tar -xvzf yasm-1.3.0.tar.gz` `cd yasm-1.3.0/` `./configure` `make` `make install
./configure --enable-shared --prefix=/opt/ffmpeg` `make`:編譯過(guò)程有點(diǎn)長(zhǎng) `make install
/opt/ffmpeg/
下耐心等待完成之后執(zhí)行 cd /opt/ffmpeg/
進(jìn)入安裝目錄,查看一下發(fā)現(xiàn)有bin
,include
,lib
,share
這4個(gè)目錄 bin
是ffmpeg主程序二進(jìn)制目錄 include
是C/C++頭文件目錄 lib
是編譯好的庫(kù)文件目錄 share
是文檔目錄
./ffmpeg -version
查看當(dāng)前版本的詳細(xì)信息,默認(rèn)情況下一般會(huì)報(bào)
libavdevice.so.57: cannot open shared object file: No such file or directory
原因是lib目錄未加載到鏈接到系統(tǒng)庫(kù)中 系統(tǒng)ld目錄列表在/etc/ld.so.conf
中,打開(kāi)文件會(huì)發(fā)現(xiàn), 里面引用了/etc/ld.so.conf.d/
下面所有的.conf
文件,比如mariadb-x86_64.conf
執(zhí)行命令:vim /etc/ld.so.conf.d/ffmpeg.conf
然后添加一行內(nèi)容:/opt/ffmpeg/lib
之后保存并退出,然后執(zhí)行 ldconfig
使配置生效, 現(xiàn)在再次執(zhí)行./ffmpeg -version
顯示就正常了
[root@slave ffmpeg-4.1]# ffmpeg -ersion ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-28) configuration: --enable-shared --prefix=/opt/ffmpeg-4 libavutil 56. 22.100 / 56. 22.100 libavcodec 58. 35.100 / 58. 35.100 libavformat 58. 20.100 / 58. 20.100 libavdevice 58. 5.100 / 58. 5.100 libavfilter 7. 40.101 / 7. 40.101 libswscale 5. 3.100 / 5. 3.100 libswresample 3. 3.100 / 3. 3.100
vim /etc/profile
:編輯寫(xiě)入↓
PATH=/opt/python364/bin/:/opt/ffmpeg-4/bin/:$PATH
source /etc/profile
:重新讀取文件使其生效
which ffmpeg
或者↓
直接輸入
ffmpeg
或者↓
使用文件進(jìn)行測(cè)試(文件自備)
ffmpeg -y -i a.wav -acodec pcm_s16le -f s16le -ac 1 -ar 16000 b.wav.pcm
關(guān)于“Linux怎么安裝ffmpeg”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識(shí),可以關(guān)注億速云行業(yè)資訊頻道,小編每天都會(huì)為大家更新不同的知識(shí)點(diǎn)。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。