日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Linu下安装ffmpeg

發布時間:2023/12/14 编程问答 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Linu下安装ffmpeg 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

首先要安裝各種解碼器。

注意事項:

①下面所有./configure操作,如果報錯,加上自己的機型,例如我的機器是Arm的,命令就為 ./configure --enable-shared?? --build=arm-linux

②其中–enable-shared表示生成動態鏈接庫,可以供以后編程使用,同時生成的可執行程序也依賴這些動態庫。如果不加上–enable-shared選項則使用靜態鏈接的方式編譯,此時不會生成動態庫,同時生成的ffmpeg等的可執行文件也比較大,但他們不需要動態庫就可以直接運行。

③權限不夠則加上sudo,例如最后make里面有用到unzip的,沒有權限會則報錯

④ffmprg每年接口都變動,所以參考以前代碼的時候,注意接口的變化,附上官網接口變化說明:FFmpeg: Deprecated List

1、lame
lame-3.99.5.tar.gz
Url:LAME (Lame Aint an MP3 Encoder) - Browse /lame at SourceForge.net
安裝方法如下:

tar -zxvf lame-3.99.5.tar.gz cd lame-3.99.5 ./configure --enable-shared make sudo make install

2、libogg
libogg-1.3.1.tar.gz
Url:https://ftp.osuosl.org/pub/xiph/releases/ogg/
安裝方法如下:

./configure make sudo make install

3、libvorbis
libvorbis-1.3.3.tar.gz
Url:http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz

(libvorbis依賴于libogg, 所以libogg必須先于libvorbis安裝)
安裝方法如下:

./configure make sudo make install

4、xvid
xvidcore-1.3.2.tar.gz
Url:http://downloads.xvid.org/downloads/xvidcore-1.3.2.tar.gz
安裝方法如下:

tar zvxf xvidcore-1.3.2.tar.gz cd xvidcore-1.3.2/build/generic ./configure make make install

5、x264
latest_x264.tar.bz2 (其中包含的目錄是 x264-snapshot-20131023-2245)
Url:x264, the best H.264/AVC encoder - VideoLAN
ftp://ftp.videolan.org/pub/videolan/x264/snapshots/
安裝方法如下:

tar -jxvf latest_x264.tar.bz2 ./configure make make install

6、libdts
libdca-0.0.5.tar.bz2
Url:?libdca - VideoLAN
安裝方法:

tar -jxvf libdca-0.0.5.tar.bz2 cd libdca-0.0.5 ./configure make sudo make install

7、a52
a52dec-0.7.4.tar.gz???
liba52 - downloads??????
安裝方法:

./configure make sudo make install

8、faad2
faad2-2.7.tar.gz
https://www.linuxfromscratch.org/blfs/view/svn/multimedia/faad2.html
安裝方法

autoreconf -vif ./configure --with-mp4v2 --enable-shared make sudo make install

9、faac
faac-1.28.tar.gz
Freeware Advanced Audio Codec download | SourceForge.net
安裝方法:

tar zxvf faac-1.28.tar.gz cd faac-1.28 ./bootstrap ./configure make sudo make install

10、amr-nb
amrnb-10.0.0.0.tar.bz2
Index of /pub/users/utx/amr
安裝方法:

sudo ./configure sudo make sudo make install

11、amr-wb
amrwb-7.0.0.1.tar.bz2
Index of /pub/users/utx/amr
安裝方法:

./configure sudo make sudo make install

12、安裝ffmpeg

從ffmpeg官網:Download FFmpeg下載tar.bz2格式包

打開ffmpeg源碼,把FFmpeg/libswscale/yuv2rgb.c中的下面的代碼注釋掉,大概在690行,否則會一直告警No accelerated colorspace conversion found from yuv420p to bgr24

av_log(c, AV_LOG_WARNING,"No accelerated colorspace conversion found from %s to %s.\n",av_get_pix_fmt_name(c->srcFormat), av_get_pix_fmt_name(c->dstFormat));

編譯安裝:(我這里安裝目錄為 /usr/local/ffmpeg )

./configure --prefix=/usr/local/ffmpeg --enable-shared make sudo make install

如果使用fmpeg源碼實現H264推流時,出現配置編碼器失敗的錯誤

[vp8_v4l2m2m @ 0x56195db9f9f0] Could not find a valid device [vp8_v4l2m2m @ 0x56195db9f9f0] can't configure encoder

則configure修改如下:

./configure --prefix=/usr/local/ffmpeg --enable-shared --enable-libx264 --enable-gpl

如果需要使用avio_open(),且返回負值時,則許加入所需要 啟用指定的分析器?的類型:./configure --enable-protocol=NAME,NAME如下:

async ftp mmsh srtp cache gopher mmst subfile concat hls pipe tcp crypto http prompeg tee data httpproxy rtmp udp ffrtmphttp icecast rtmpt udplite file md5 rtp unix

為了以后方便編程,我們把/usr/local/ffmpeg/lib中的庫都復制到/usr/lib下。把/usr/local/ffmpeg/include目錄下的所有文件復制到/usr/include下

參考博文:

Linux下ffmpeg的完整安裝 - wanghetao - 博客園

ffmpeg安裝配置以及庫調用 - 窮酸秀才大艸包 - 博客園

Linux下ffmpeg的依賴庫安裝_水月醉清寒-CSDN博客_ffmpeg依賴庫

can not configure encoder

FFmepeg: avio_open()返回負值時的解決方法

總結

以上是生活随笔為你收集整理的Linu下安装ffmpeg的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。