ubuntu12.04上live555+v4l2+ffmpeg+x264開發環境的搭建

來源:互聯網
上載者:User

ubuntu12.04上live555+v4l2+ffmpeg+x264開發環境的搭建

我把可能會用到的主要資源上傳到度盤: http://pan.baidu.com/s/1i38AleP

ubuntu上安裝主要步驟就是解壓、configure、make、sudo make install

live555的安裝可以看這裡: http://www.live555.com/liveMedia/#config-unix

libx264的安裝則是直接解壓、然後configure、make和sudo make install,configure命令如下

./configure --disable-asm --enable-static --enable-shared

 

關鍵就是ffmpeg,可以看這裡:https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu

這裡面有一些庫如果你覺得不是很必要或者實在覺得裝不上也可以不裝(畢竟主要用的是x264),比如我編譯安裝的時候就沒有--enable-libvpx

裡面把ffmpeg的相關庫都放到一起了,其實不指定prefix什麼的也是可以的,看你自己喜好,預設安裝到/usr/local/lib

我最後的configure語句是:

./configure --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-x11grab --enable-shared

這樣還沒完,你編譯運行你自己寫的時候可能還會報錯

 

/usr/local/include/libavutil/common.h:30:2: error: #error missing -D__STDC_CONSTANT_MACROS / #define __STDC_CONSTANT_MACROS
/usr/local/include/libavutil/common.h:192:47: error: ‘UINT64_C’ was not declared in this scope

 

fix方法是直接在common.h的最前面加上:

 

#ifdef __cplusplus#define __STDC_CONSTANT_MACROS#ifdef _STDINT_H#undef _STDINT_H#endif# include <stdint.h>#endif

#ifndef   UINT64_C#define   UINT64_C(value)__CONCAT(value,ULL)#endif

如果還出現找不到庫的情況:

 

error while loading shared libraries: libavdevice.so.55: cannot open shared object file: No such file or directory

首先確認在安裝路徑下這些庫存在,如果存在,則編輯 /etc/ld.so.conf檔案,把安裝路徑加上,比如我的安裝路徑是/usr/local/lib,修改後整個檔案就是

include /etc/ld.so.conf.d/*.conf
/usr/local/lib

完

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.