ffmpeg轉換多媒體文件,真香

【轉載請註明出處】:https://blog.csdn.net/huahao1989/article/details/107877488html

1. 安裝yasm(若是已經安裝能夠略過)

先在官網http://yasm.tortall.net/Download.html下載最新版yasm源碼
image.png
執行下面的命令進行安裝算法

wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar -zxvf yasm-1.3.0.tar.gz
cd yasm-1.3.0
./configure
make 
make install

2. 安裝amr編碼庫(若是須要轉amr,mp3相似)

下載官網後端

wget https://sourceforge.net/projects/opencore-amr/files/opencore-amr/opencore-amr-0.1.5.tar.gz
tar -zxvf opencore-amr-0.1.5.tar.gz
cd opencore-amr-0.1.5
./configure --enable-shared=no --enable-static=yes
make 
make install

3. 安裝ffmpeg

先在官網http://www.ffmpeg.org/download.html下載最新版ffmpeg學習

wget https://ffmpeg.org/releases/ffmpeg-4.0.2.tar.bz2
tar -xvjf ffmpeg-4.0.2.tar.bz2
cd ffmpeg-4.0.2
## ./configure --prefix=/usr/local/ffmpeg
./configure --enable-version3 --enable-nonfree --disable-ffplay --disable-ffprobe --enable-libopencore-amrnb --enable-libopencore-amrwb --prefix=/usr/local/ffmpeg
make 
make install

注:若是沒法解壓,請先安裝bzip2 以後再解壓測試

yum -y install bzip2

安裝完成以後配置環境變量編碼

vi /etc/profile

在最後PATH添加環境變量:spa

PATH=$PATH:/usr/local/ffmpeg/bin
export PATH
source /etc/profile
ffmpeg -version

測試.net

ffmpeg -i input.mp4 output.avi
ffmpeg -i 123.aac -ac 1 -ar 8000 123.amr
歡迎關注 「後端老鳥」 公衆號,接下來會發一系列的專題文章,包括Java、Python、Linux、SpringBoot、SpringCloud、Dubbo、算法、技術團隊的管理等,還有各類腦圖和學習資料,NFC技術、搜索技術、爬蟲技術、推薦技術、音視頻互動直播等,只要有時間我就會整理分享,敬請期待,現成的筆記、腦圖和學習資料若是你們有需求也能夠公衆號留言提早獲取。因爲本人在全部團隊中基本都處於攻堅和探路的角色,搞過的東西多,遇到的坑多,解決的問題也不少,歡迎你們加公衆號進羣一塊兒交流學習。

【轉載請註明出處】:https://blog.csdn.net/huahao1989/article/details/107877488code

image

相關文章
相關標籤/搜索