国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Linux > 正文

linux系統中ffmpeg安裝配置步驟

2024-08-27 23:59:40
字體:
來源:轉載
供稿:網友

FFmpeg是一套可以用來記錄、轉換數字音頻、視頻,并能將其轉化為流的開源計算機程序,下面我們來給各位介紹在linux系統中ffmpeg安裝配置步驟,有需要的可以和小編來看看具體步驟如下.

http://ffmpeg.org/download.html

windows版本比較容易.

Linux,安裝環境CentOS,下載tar.bz2安裝包.

  1. tar -xvf XX.tar.bz2 
  2. yasm/nasm not found or too old. Use –disable-yasm for a crippled build. 
  3. If you think configure made a mistake, make sure you are using the latest 
  4. version from Git. If the latest version fails, report the problem to the 
  5. ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net. 
  6. Include the log file “config.log” produced by configure as this will help 
  7. solve the problem. 
  8. http://yasm.tortall.net/Download.html 下載yasm 
  9. tar -zxvf yasm.tar.gz 
  10. ./configure 
  11. make 
  12. make install 

再來,ffmpeg下面 ./configure 安裝完畢,發現無法將amr轉成MP3.

  1. ./ffmpeg -i x.amr x.mp3 
  2. ./configure –enable-libmp3lame 

少這個libmp3lame:

  1. # wget http://downloads.sourceforge.net/lame/lame-3.97.tar.gz 
  2. # tar xzf lame-3.97.tar.gz 
  3. # cd lame-3.97 
  4. # ./configure 
  5. # make 
  6. # make install 
  7. ERROR: libmp3lame >= 3.98.3 not found 
  8. http://downloads.sourceforge.net/lame/去這里找最新的版本,下載一個。 
  9. 我下到的是lame-3.99.5.tar.gz 
  10. # ./configure 
  11. # make 
  12. # make install 
  13. ./ffmpeg -i x.amr x.mp3 
  14. ffmpeg: error while loading shared libraries: libmp3lame.so.0: cannot open shared object file: No such file or directory 
  15. 發生這個我們這樣弄 

編輯/etc/ld.so.conf文件加入如下內容:

/usr/local/lib

保存退出后執行ldconfig命令,大功告成,你缺少的庫,可能都在下面了,FFmpeg軟件只是個解碼編碼軟件,如果支持多種格式必須先安裝好對應的庫,下面就說下我裝的庫:

1.安裝faad2

  1. # wget http://downloads.sourceforge.net/faac/faad2-2.6.1.tar.gz 
  2. # tar xvfz faad2-2.6.1.tar.gz 
  3. # cd faad2 
  4. # ./bootstrap 
  5. # ./configure 
  6. # make 
  7. # make install 

2.安裝liba52

  1. # wget http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz 
  2. # tar xvfz a52dec-0.7.4.tar.gz 
  3. # cd a52dec-0.7.4 
  4. # ./configure 
  5. # make 
  6. # make install 

3.安裝libdirac

  1. # wget http://downloads.sourceforge.net/dirac/dirac-0.10.0.tar.gz 
  2. # tar xvfz dirac-0.10.0.tar.gz 
  3. # cd dirac-0.10.0 
  4. # ./configure 
  5. # make 
  6. # make install 

4.安裝faac2

  1. # wget http://downloads.sourceforge.net/faac/faac-1.26.tar.gz 
  2. # tar xvfz faac-1.26.tar.gz 
  3. # cd faac 
  4. # ./bootstrap 
  5. # ./configure 
  6. # make 
  7. # make install 

5.安裝libamrnb

  1. # wget http://ftp.penguin.cz/pub/users/utx/amr/amrnb-7.0.0.2.tar.bz2 
  2. # tar xvfj amrnb-7.0.0.2.tar.bz2 
  3. # cd amrnb-7.0.0.2 
  4. # ./configure 
  5. # make 
  6. # make install 

6.安裝libamrwb

  1. # wget http://ftp.penguin.cz/pub/users/utx/amr/amrwb-7.0.0.3.tar.bz2 
  2. # tar xvfj amrwb-7.0.0.3.tar.bz2 
  3. # cd amrwb-7.0.0.3 
  4. # ./configure 
  5. # make 
  6. # make install 

7.安裝libmp3lame

  1. # wget http://downloads.sourceforge.net/lame/lame-3.97.tar.gz 
  2. # tar xzf lame-3.97.tar.gz 
  3. # cd lame-3.97 
  4. # ./configure 
  5. # make 
  6. # make install 

8.安裝libx264

此軟件包需要用git來獲取,所以要先安裝git:

  1. # wget http://kernel.org/pub/software/scm/git/git-1.6.2.tar.gz (地址要確認) 
  2. # tar zxvf git-1.6.2.tar.gz 
  3. # cd git-1.6.2 
  4. # ./configure 
  5. # make 
  6. # make install 

然后安裝libx264.

  1. # /usr/local/bin/git clone git://git.videolan.org/x264.git x264 
  2. # cd x264 
  3. # ./configure –enable-pthread –enable-shared –disable-asm 
  4. # make 
  5. # make install 

8.安裝libnut,該軟件需要用svn獲取源代碼,svn可以直接用yum install svn來裝,先下載:

# svn co svn://svn.mplayerhq.hu/nut/src/trunk libnut

下載后代碼保存在新建立的libnut目錄下,對于64位Linux需要修改配置文件:

  1. # cd libnut 
  2. # vi config.mak 

在最后一個CFLAGS下一行增加:CFLAGS += -fPIC 然后編譯安裝:

  1. # make 
  2. # make install 

9.安裝libogg

  1. # wget http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz 
  2. # tar xvf libogg-1.1.3.tar.gz 
  3. # cd libogg-1.1.3 
  4. # ./configure 
  5. # make 
  6. # make install 

10.安裝libtheora(svn獲取)

  1. # svn co http://svn.xiph.org/trunk/theora theora 
  2. # cd theora 
  3. # ./autogen.sh 
  4. # ./configure 
  5. # make 
  6. # make install 

11.安裝libvorbis

  1. # wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.0.tar.gz 
  2. # tar xvfz libvorbis-1.2.0.tar.gz 
  3. # cd libvorbis-1.2.0 
  4. # ./configure 
  5. # make 
  6. # make install 

12.安裝libxvid

  1. # wget http://downloads.xvid.org/downloads/xvidcore-1.2.1.tar.gz 
  2. # tar xvf xvidcore-1.2.1.tar.gz 
  3. # cd xvidcore-1.2.1/build/generic 
  4. # ./bootstrap.sh  --Vevb.com 
  5. # ./configure –disable-assembly 
  6. # make 
  7. # make install 

上面的媒體支持庫安裝完后,可以設置下環境準備編譯FFmpeg了.

13.修改環境變量

# vi /etc/ld.so.conf

在文件末增加一行:/usr/local/lib

然后生效之:# ldconfig

14.安裝FFmpeg

可以通過svn獲取,不過文件比較大,所以特別慢:

  1. # svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg 
  2. # cd ffmpeg 
  3. //也可以自己下載: 
  4. # http://www.ffmpeg.org/releases/ffmpeg-0.5.tar.bz2 
  5. # bzip2 -d ffmpeg-0.5.tar.bz2 
  6. # tar -xf ffmpeg-0.5.tar 
  7. # cd ffmpeg-0.5 

編譯(64位系統需要設置PKG_CONFIG_PATH參數):

  1. # export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig CFLAGS=”-fPIC -m64″ 
  2. # ./configure –enable-shared / 
  3. –enable-gpl / 
  4. –enable-nonfree / 
  5. –enable-postproc / 
  6. –enable-avfilter / 
  7. –enable-avfilter-lavf / 
  8. –enable-pthreads / 
  9. –enable-libamr-nb / 
  10. –enable-libamr-wb / 
  11. –enable-libdirac / 
  12. –enable-libfaac / 
  13. –enable-libfaad / 
  14. –enable-libfaadbin / 
  15. –enable-libmp3lame / 
  16. –enable-libnut / 
  17. –enable-libtheora / 
  18. –enable-libvorbis / 
  19. –enable-libx264 / 
  20. –enable-libxvid / 
  21. –enable-decoder=libx264 / 
  22. –enable-encoder=libx264 
  23. # make 
  24. # make install 

14.可能出現的錯誤:

  1. /usr/include/linux/videodev.h:56: error: syntax error before “ulong” 
  2. /usr/include/linux/videodev.h:72: error: syntax error before ‘}’ token 
  3. libavdevice/v4l.c: In function `grab_read_header’: 
  4. libavdevice/v4l.c:75: error: storage size of ‘tuner’ isn’t known 
  5. libavdevice/v4l.c:133: error: invalid application of `sizeof’ to incomplete type `video_tuner’ 
  6. libavdevice/v4l.c:140: error: invalid application of `sizeof’ to incomplete type `video_tuner’ 
  7. libavdevice/v4l.c:75: warning: unused variable `tuner’ 

這可能是源代碼videodev.h不是針對次版本Linux寫的,標準C沒有ulong類型,所以要改成unsigned long.

15.運行ffmpeg -formats,可能出的錯誤:

  1. ffmpeg: error while loading shared libraries:libavfilter.so.0: cannot open shared object file: No such file or directory 

這事沒有設置環境路徑造成了,增加一個ffmpeg.conf配置文件:

  1. # cd /etc/ld.so.conf.d 
  2. # vi ffmpeg.conf 
  3. //在文件內寫上: 
  4. /usr/local/lib 
  5. //然后確認生效: 
  6. # ldconfig

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 洪雅县| 白河县| 青田县| 龙胜| 洛隆县| 尼勒克县| 左权县| 卢湾区| 宣汉县| 益阳市| 安新县| 榆中县| 洛隆县| 云龙县| 游戏| 阿坝县| 上犹县| 威远县| 平顶山市| 香港| 德州市| 余干县| 柳河县| 元谋县| 台湾省| 安远县| 林芝县| 永济市| 平顺县| 新宁县| 永兴县| 舞阳县| 从江县| 保山市| 东平县| 昌黎县| 楚雄市| 嘉义市| 大丰市| 弥勒县| 深水埗区|