libVLC-3.0.8 ubuntu18.04交叉编译

本文详细记录了在Ubuntu 18.04上交叉编译libvlc-3.0.8的过程,包括环境设置、源码获取、编译环境配置、解决第三方库获取问题、编译和打包过程中的各种错误及解决方案。最终编译的库已修复RTSP流断流导致内存暴涨的bug,并提供了编译好的库链接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

libvlc-3.0.8 的交叉编译是去年做的,因为太忙,所以今天才把它记录下来。编译花了一周时间才完成,主要原因是第三方库获取方式不对,开始不知道,编译的时候一直报错,怎么都查不出原因。后来才知道对于vlc3.x版本,vlc-contrib-x86_64-w64-mingw32-latest.tar.bz2 不能使用手动下载的,要make fetch,需要VPN,如果没有VPN,不要紧,这里有https://blog.youkuaiyun.com/qq_18286031/article/details/85993485 提供的make fetch 下来的x86_64-w64-mingw32 包,可以直接使用。使用时注意,不需要编译了。我会把编译好的libvlc-3.0.8库上传到资源。编译好的库已加上录像接口,并且解决了播放RTSP流时,如果断流会内存暴涨导致软件崩溃的问题。
好,我们开始吧!

  1. 所需环境
 ubuntu18.04系统 可以使用虚拟机 确保联网
  1. vlc-3.0.8源码获取
https://codeload.github.com/videolan/vlc-3.0/zip/3.0.8
  1. 在/home 目录下新建文件夹 harray,将vlc源码解压到harray目录下,改名为vlc-3.0
/home/harray/vlc-3.0
  1. 更新编译环境
sudo apt-get update
sudo apt-get upgrade
  1. 安装必要的软件
sudo apt-get install lua5.2 libtool automake autoconf autopoint make gettext pkg-config
sudo apt-get install qt4-dev-tools qt5-default git subversion cmake cvs 
sudo apt-get install wine64-development-tools zip p7zip nsis bzip2
sudo apt-get install yasm ragel ant default-jdk protobuf-compiler dos2unix
sudo apt-get install gperf flex bison
  1. 配置contrib (有VPN的可以fetch)
将x86_64-w64-mingw32 包解压到/home/harray/vlc-3.0/contrib/
  1. 退到主目录
cd home/harray/vlc-3.0
mkdir x86_64 && cd x86_64
../bootstrap
  1. 配置环境变量
gedit /etc/profile
将 /home/harray/vlc-3.0/contrib/x86_64-w64-mingw32/lib/pkgconfig 配置进去
export PATH=$PATH:/home/harray/vlc-3.0/contrib/x86_64-w64-mingw32/lib/pkgconfig
  1. 编译
make
  1. 打包
make package-win-common  
wine ./vlc-3.0.8/vlc.exe  
make package-win32-7zip  

遇到的一些问题和解决方法

  1. You need 32-bits luac when using lua from contrib:
apt-get install lua5.2:i386
  1. 打包时遇到 cannot stat ‘…/share/hrtfs’: No such file or directory
cd vlc-3.0.8/share
touch hrtfs
手动建了这个vlc-3.0.8/share/hrtfs(空文件),打包成功
  1. 运行时找不到 libssp-0.dll
将 libssp-0.dll 加入到最后打包的根目录中
  1. 安装 protoc 过程中./autogen.sh 报错
运行./autogen.sh 时,由于“你懂的”的原因,autogen无法curl下载到gmock的源代码包,所以把gmock的包放到protoc目录下,让直接使用gmock。具体做法是:
1、解压gmock,这里我会提供gmock-1.7.0.zip,也可以网上下载。
2、把gmock解压出来的目录拷贝到protobuf目录下,改名为gmock
     mv gmock-1.7.0  gmock
3、vim aotogen.sh将如下代码注释 
if test ! -e gmock; then
   echo "Google Mock not present.  Fetching gmock-1.7.0 from the web..."
   curl -O https://googlemock.googlecode.com/files/gmock-1.7.0.zip
   unzip -q gmock-1.7.0.zip
   rm gmock-1.7.0.zip
   mv gmock-1.7.0 gmock
 fi
 4、保存,然后开始编译 protoc 3.1.0
  1. 编译好的vlc库
https://download.csdn.net/download/z373248439/14144141

编译参考:
https://blog.youkuaiyun.com/yibu_refresh/article/details/84633439
https://blog.youkuaiyun.com/qq_18286031/article/details/85993485

评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

水笙赵

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值