VLC二次開發環境搭建
本次安裝平臺:ubuntu10.04 vlc1.1.7
1、 下載原始碼(放到指定的資料夾)
2、 編譯安裝live555
tar zxvf live555-latest.tar.gz
cd live
./genMakefiles linux
make
sudo cp –r live /usr/lib(切換到上一級目錄)
3、 編譯安裝VLC需要的元件
sudo apt-get build-dep vlc
4、 編譯安裝vlc
tar jxvf vlc-1.1.7.tar.bz2
cd vlc-1.1.7
./bootstrap
問題:./bootstrap: 1: autoreconf: not found
sudo apt-get install autoconf automake libtool
配置:./configure (在root使用者下)
./configure --enable-run-as-root --enable-ffmpeg --prefix=/home/tirvideo/workspace/vlc
問題
(1) configure: error: Could not find the LUA byte compiler.
sudo apt-get install liblua5.1-0-dev liblua50-dev liblualib50-dev
(2) No package 'xcb-shm' found
sudo apt-get install libx11-xcb-dev libxcb-shm0-dev libxcb-xv0
(3) No package ‘xcb-xv’ found
sudo apt-get install libxcb-xv0-dev
(4) 在進行配置環境時,進行如下檢查(檢測配置時,最好是分開進行)。
./configure --enable-x11 --enable-xvideo --disable-gtk --enable-sdl --enable-avcodec --enable-avformat --enable-swscale --enable-mad --enable-libdvbpsi --enable-a52 --enable-libmpeg2 --enable-dvdnav --enable-faad --enable-vorbis --enable-ogg --enable-theora --enable-faac --enable-mkv --enable-freetype --enable-fribidi --enable-speex --enable-flac --enable-live555 --with-live555-tree=/usr/lib/live --enable-caca --enable-skins --enable-skins2 --enable-alsa --disable-kde --enable-qt4 --enable-ncurses --enable-release
均通過後,再重複最開始的配置,來檢查
./configure --enable-run-as-root --enable-ffmpeg --prefix=/home/tirvideo/workspace/vlc
補充解釋:配置資訊為如下的原因:
./configure --enable-run-as-root --enable-ffmpeg --prefix=/home/tirvideo/workspace/vlc
問題1:當執行./vlc不能開啟vlc軟體時,出現"VLC is not supposed to be run as root. Sorry. If you need to use real-time priorities and/or privileged TCP ports you can use vlc-wrapper (make sure it is Set-UID root and cannot be run by non-trusted users first).,是因為在配置VLC的環境是存在一定的錯誤。
配置方式如下:./configure –enable-run-as-root
問題2:當在執行時,出現xcb_xv generic error:no available XVideo adaptor錯誤時,防止出現此錯誤,可以執行時輸入如下的命令:
./vlc /mnt/share/kxbsn.mp4 –vout x11或者./vlc /mnt/share/kxbsn.mp4 –vout sdl即可。
配置資訊中的—prefix後面跟的是在make install時軟體要安裝的位置。
編譯
make
問題: (1) make[2]: *** [lua/extensions/allocine-fr.luac] Error 1
解決方法:sudo apt-get install lua5.1 然後在make,make通過後即可安裝。
安裝
make install
執行:
./vlc即可。
總結:
1、在安裝軟體時,如果不知道版本號,則可以通過輸入軟體名,不輸入版本,然後按鍵盤上的Tab鍵,就能檢視自己的ubuntu版本適合的軟體版本。
2、Linux安裝軟體採用原始碼安裝靈活自由,適用於不同的平臺,維護也十分方便
原始碼安裝一般由3個步驟組成:
配置(configure)
編譯(make)
安裝(make install)
3、下面簡要介紹一下配置(configure)的prefix選項的作用:
./configure –prefix=/home/tirvideo/workspace/vlc
執行成功後再編譯、安裝(make,make install),安裝完成後將自動生成目錄vlc,而且該軟體任何文件都被複制到這個目錄。指定這個目錄的作用如下:
1、為了以後維護的方便,假如沒有用這個選項,安裝過程結束後,該軟體所需的軟體都被複制到不同的系統目錄下,很難弄清楚到底複製了那些文件、都複製到哪裡去了;
2、另一個好處是解除安裝軟體或者移植軟體。當某個安裝的軟體不再需要時,只須簡單的刪除該安裝目錄,就能夠把軟體解除安裝的乾乾淨淨;移植軟體只需拷貝整個目錄到另外一個機器上即可(相同的作業系統)。