环境准备
操作系统 ubuntu20.04 版本 VLC4.0.0 dev版本
工具准备
sudo apt-get install git build-essential pkg-config libtool automake autopoint gettext unzip
安装第三方依赖库
下面的库只能多不能少,否则会出现各种错误
sudo apt-get install libxcb-shm0-dev libxcb-xv0-dev
sudo apt-get install libxcb-keysyms1-dev libxcb-randr0-dev
sudo apt-get install libxcb-composite0-dev
sudo apt-get install libavformat-dev
sudo apt install libswscale-dev
sudo apt install liba52-0.7.4-dev
sudo apt install libxcb-shm0-dev
sudo apt install libxcb-composite0-dev
sudo apt install libxcb-xv0-dev
sudo apt install libasound2-dev
sudo apt install libarchive-dev
sudo apt install liblivemedia-dev
sudo apt install libva-dev
sudo apt install lua5.2 liblua5.2-dev
sudo apt install libmpg123-dev
udo apt install libgstreamer-plugins-base1.0-dev
sudo apt install libavcodec-dev
编译
1. 切换到vlc的源码目录,执行
sudo chmod 777 bootstrap
./bootstrap
2. 执行configure
./configure --enable-realrtsp --enable-live555 --prefix="/home/lanmo/Documents/vlc4libs"
在这个过程可能会一下问题,下面的错误描述和解决方案都有
错误 1:
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.
解决 1:
sudo apt install lua5.2 liblua5.2-dev
错误 2:
configure: WARNING: Library libmpg123 needed for mpg123 was not found
解决 2:
sudo apt install libmpg123-dev
错误 3:
configure: WARNING: No package 'gstreamer-app-1.0' found. GStreamer modules will not be built.
解决 3:
sudo apt install libgstreamer-plugins-base1.0-dev
错误 4:
configure: error: Missing libav or FFmpeg. Pass --disable-avcodec to ignore this error.
解决 4:
sudo apt install libavcodec-dev
错误 5:
configure: error: No package 'libavformat' found. Pass --disable-avformat to ignore this error.
解决 5:
sudo apt install libavformat-dev
错误 6:
configure: error: No package 'libswscale' found. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.
解决 6:
sudo apt install libswscale-dev
错误 7:
configure: error: Could not find liba52 on your system: you may get it from weblink. Alternatively you can use --disable-a52 to disable the a52 plugin.
解决 7:
sudo apt install liba52-0.7.4-dev
错误 8:
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.
解决 8:
sudo apt install libxcb-shm0-dev
错误 9:
configure: error: Package requirements (xcb-composite) were not met: No package 'xcb-composite' 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_COMPOSITE_CFLAGS and XCB_COMPOSITE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details
解决 9:
sudo apt install libxcb-composite0-dev
错误 10:
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.
解决 10:
sudo apt install libxcb-xv0-dev
错误 11:
configure: error: No package 'alsa' found. alsa-lib 1.0.24 or later required. Pass --disable-alsa to ignore this error.
解决 11:
sudo apt install libasound2-dev
错误 12:
vlc: error while loading shared libraries: libvlc.so.5: cannot open shared object file: No such file or directory
解决 12:
sudo apt install libvlc5
错误 13:
xcb_window window error: X11 key press support not compiled-in
解决 13:
sudo apt install libxml2-dev
错误 14:
configure: WARNING: Library libarchive >= 3.1.0 needed for archive was not found
解决 14:
sudo apt install libarchive-dev
错误 15:
configure: WARNING: No package 'live555' found.
解决 15:
sudo apt install liblivemedia-dev
错误 16:
configure: WARNING: Library libebml >= 1.3.6 libmatroska needed for matroska was not found
解决 16:
sudo apt install libebml-dev libmatroska-dev
错误 17:
configure: WARNING: No package 'libva' found.
解决 17:
sudo apt install libva-dev
错误 18:
configure: WARNING: Library libchromaprint >= 0.6.0 needed for chromaprint was not found
解决 18:
sudo apt install libchromaprint-dev
执行make
auto make
可能出现以下编译错误
- 出现找不到
revision.txt
头文件情况
需要在src目录下新建
revision.txt
文件在里面添加一行如下
4.0.0-g41878ff4f2
- SSIZE_MAX未定义
//使用gedit或者其他编辑器打开libmp4.c文件,在开头加入如下代码
#ifndef SSIZE_MAX
# define SSIZE_MAX 32767
#endif
- make-alias 执行失败
sudo chmod 777 make-alias
编译结果
编译安装
相关成果
已编译成果已经发布到面包多
https://mianbaoduo.com/o/bread/Y5qXkpZr