Ubuntu18.04編譯vlc-3.0.10

最近要整一些視頻操作,選擇了vlc-qt。奈何使用vlc-qt需要先編譯vlc。

1、首先下載vlc

訪問官網https://www.videolan.org/vlc/ 選擇要下載的版本 ,當然也可以直接下載http://get.videolan.org/vlc/3.0.10/vlc-3.0.10.tar.xz

將源碼下載到本地後,開始嘗試着編譯,爲什麼說是嘗試,因爲會遇到各種各樣的報錯。


2、嘗試配置

cd到源碼的主目錄,執行命令

./bootstrap

./configure

出現報錯:configure: error: Could not find lua. Lua is needed for some interfaces (rc, telnet, http) as well as many other custom scripts. Use --disable-lua to ignore this error.

解決方案:根據./configure命令提示,下載對應的lua,我這裏以下執行命令:

sudo apt install lua5.2

sudo apt install lua5.2-dev

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

再次執行./configure

出現報錯:configure: error: Missing libav or FFmpeg. Pass --disable-avcodec to ignore this error.

解決方案:這裏有兩種解決方案。

方案(1)  執行命令: ./configure --prefix=/usr/local/vlc  --disable-avcodec  .讓其直接忽略這個錯誤即可。

方案(2)執行命令:sudo apt install  libavcodec-dev   。

我是採用第二種方案。

 

再次執行./configure

出現報錯:configure: error: No package 'libswscale' found. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.

解決方案:這裏有兩種解決方案。

方案(1)  執行命令: ./configure --prefix=/usr/local/vlc  --disable-avcodec --disable-swscale  .讓其直接忽略這個錯誤即可。

方案(2)執行命令:sudo apt install  libswscale-dev  。

我是採用第二種方案。

 

再次執行./configure

出現報錯:configure: error: No package 'liba52' found. Pass --disable-a52 ........(此處省略好多字母)

解決方案:這裏有兩種解決方案。

方案(1)  執行命令: ./configure --prefix=/usr/local/vlc  --disable-avcodec --disable-swscale --disable-a52 .讓其直接忽略這個錯誤即可。

方案(2)執行命令:sudo apt install  liba52-dev 

我是採用第二種方案。

 

再次執行./configure

出現報錯:configure: error: No package 'libpostproc' found. Pass  ........(此處省略好多字母)

解決方案:

執行命令:sudo apt install  libpostproc-dev 

 

再次執行./configure

出現報錯:configure: error: Package requirements (xcb-shm) were not met:No package 'xcb-shm' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables XCB_SHM_CFLAGS and XCB_SHM_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.

解決方案:

sudo apt install pkg-config

sudo apt install autoconf

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------

執行./bootstrap

出現報錯:

NOTE: autopoint (GNU gettext-tools) appears to be missing or out-of-date.
Please install or update GNU gettext tools.
Otherwise, you will not be able to build a source tarball.
==========================================================================

autoreconf: Entering directory `.'
autoreconf: running: true --force
autoreconf: running: aclocal -I m4 -I m4 --output=aclocal.m4t
Can't exec "aclocal": No such file or directory at /usr/share/autoconf/Autom4te/FileUtils.pm line 326.
autoreconf: failed to run aclocal: No such file or directory

解決方案:sudo apt install automake

 

再次執行./bootstrap

出現報錯:

NOTE: autopoint (GNU gettext-tools) appears to be missing or out-of-date.
Please install or update GNU gettext tools.
Otherwise, you will not be able to build a source tarball.
==========================================================================

autoreconf: Entering directory `.'
autoreconf: running: true --force
autoreconf: running: aclocal -I m4 --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
Can't exec "libtoolize": No such file or directory at /usr/share/autoconf/Autom4te/FileUtils.pm line 345, <GEN3> line 6.
autoreconf: failed to run libtoolize: No such file or directory
autoreconf: libtoolize is needed because this package uses Libtool

解決方案:sudo apt install libtool

 

重新執行./bootstrap,則可以成功通過

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------

重新執行命令:./configure --prefix=/usr/local/vlc

出現報錯:

configure: error: Package requirements (xcb-shm) were not met:

No package 'xcb-shm' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables XCB_SHM_CFLAGS
and XCB_SHM_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

解決方案:sudo apt install libxcb-shm0-dev

 

重新執行命令:./configure --prefix=/usr/local/vlc 

出現報錯:

configure: error: Package requirements (xcb-xv >= 1.1.90.1) were not met:

No package 'xcb-xv' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables XCB_XV_CFLAGS
and XCB_XV_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

解決方案:sudo apt install libxcb-xv0-dev

 

重新執行命令:./configure --prefix=/usr/local/vlc 

出現報錯:configure: error: No package 'alsa' found. alsa-lib 1.0.24 or later required. Pass --disable-alsa to ignore this error.

解決方案:sudo apt install libalsa-ocaml-dev

 

再次執行命令./configure --prefix=/usr/local/vlc,配置成功


執行命令:

make -j4

sudo make install

vlc就編譯安裝完成了!!!!

 

 

 

 

 

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章