gstreamer编译错误处理记录

server certificate verification failed

e0005055@ibudev20:~/wk/gst_scr$ git clone https://gitlab.freedesktop.org/gstreamer/gst-plugins-base.git
Cloning into 'gst-plugins-base'...
fatal: unable to access 'https://gitlab.freedesktop.org/gstreamer/gst-plugins-base.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

ca证书校验失败。因为是自签名证书,因此需要关闭http ssl校验:

 git config --global http.sslverify false

编译语法报错

$git clone  https://gitlab.freedesktop.org/gstreamer/gst-build.git
$cd gst-build
$meson builddir
The Meson build system
Version: 0.45.1
Source dir: /home/e0005055/wk/gst_scr/gst-build
Build dir: /home/e0005055/wk/gst_scr/gst-build/builddir
Build type: native build

meson.build:87:15: ERROR: lexer
  ['gstreamer', {'build-hotdoc': true}],
               ^
A full log can be found at /home/e0005055/wk/gst_scr/gst-build/builddir/meson-logs/meson-log.txt

从位置看不出问题在哪里。

尝试直接编译源码

$git clone  https://gitlab.freedesktop.org/gstreamer/gstreamer.git
... ...
$cd gstreamer
$meson build
Build dir: /home/e0005055/wk/gst_scr/gstreamer/build
Build type: native build
meson.build:636:9: ERROR: lexer
  summary({'Plugins':plugin_names}, list_sep: ', ')
         ^
A full log can be found at /home/e0005055/wk/gst_scr/gstreamer/build/meson-logs/meson-log.txt

一样有语法错误。重置meson

pip3 install --user meson

结果一样。

尝试从pip3重新安装

$sudo apt remove meson
Reading package lists... Done
$ meson builddir
bash: /usr/bin/meson: No such file or directory
$pip3 install meson
Requirement already satisfied: meson in /usr/local/lib/python3.6/dist-packages
$pip3 uninstall meson
 ...
$pip3 install meson
Collecting meson
 ...

再次运行:

$meson builddir
bash: /usr/bin/meson: No such file or directory

找不到文件,查看安装位置

$whereis meson
meson: /usr/local/bin/meson

直接创建软连接到 /usr/bin/meson:

$ln -s /usr/local/bin/meson /usr/bin/meson
$meson --version
0.59.2

再次运行成功,开始下载编译了。

$meson builddir
The Meson build system
...

有的环境下同时存在两个版本的meson,默认是高版本,但是编译时使用的还是低版本,因此需要将低版本的直接卸载:

$ meson --version
0.59.2
$ whereis meson
meson: /usr/share/meson /home/e0005055/.local/bin/meson /home/e0005055/usr_env/meson.build
$ /usr/bin/meson --version
0.45.1
$ sudo apt remove meson
...

git 代码下载报错

Cloning into 'gstreamer'...
remote: Enumerating objects: 789223, done.
remote: Counting objects: 100% (48109/48109), done.
remote: Compressing objects: 100% (13188/13188), done.
error: RPC failed; curl 56 GnuTLS recv error (-54): Error in the pull function.
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

meson.build:134:4: ERROR: Git command failed: ['/usr/bin/git', 'clone', 'https://gitlab.freedesktop.org/gstreamer/gstreamer.git', 'gstreamer']

修改cache大小:

$ git config --global http.postBuffer 524288000
$ git config --global core.compression -1   
$ git config --global http.maxRequestBuffer 100M
$ vim ~/.bashrc
export GIT_TRACE_PACKET=1
export GIT_TRACE=1
export GIT_CURL_VERBOSE=1

不行,再尝试:

$ git config --global http.postBuffer 524288000
$ git config --global core.compression -1   
$ git config --global http.maxRequestBuffer 100M
$ git config --global http.lowSpeedLimit 0
$ git config --global http.lowSpeedTime 999999

切换版本运行,出现找不到函数符号的警告

将代码版本切换到1.18.5,编译后,程序运行,出现找不到gst_type_mark_as_plugin_api、gst_aggregator_update_segment等函数的警告。

检查对应源文件的更新

第一怀疑时该函数在近期的版本上api有改动,造成引起失败。
git diff对应版本,未发现api层级的改动。

查看函数定义和编译

查看源码,函数有被定义,并且正常编译到该部分代码。

查看对应so文件是否包含该对象

读取elf内容,so文件中有对应函数定义

	Line 4817:   2286: 00000000000cc1e0    56 FUNC    GLOBAL DEFAULT   12 gst_type_mark_as_plugin_a
	Line 9647:   4763: 00000000000cc1e0    56 FUNC    GLOBAL DEFAULT   12 gst_type_mark_as_plugin_a

设置运行库路径

 1928  export LD_LIBRARY_PATH=/wk/gst-build/gst185_xz/gst-build/build_esw/out/lib/x86_64-linux-gnu/gstreamer-1.0/

没有效果

移动库文件路径

将所有库放入gstreamer-1.0/文件夹

mv out/lib/x86_64-linux-gnu/libgst* out/lib/x86_64-linux-gnu/gstreamer-1.0/

无效

对比配置差异

怀疑是部分模某些配置项差异导致的。逐步比对各个模组的配置文件与最新版配置文件的差异,并做同步。编译后问题依旧存在。

分析环境差异

重新在虚拟机编译运行1.18.5版本,没有问题。确认为电脑环境差异,部分应用和库文件发生交叉。
重新在服务器搜索gst_type_mark_as_plugin_api等对应库,发现多条记录。
删除对应记录后,出现找不到库文件的报错。确认为库文件交叉引用引起。
重新将LD_LIBRARY_PATH路径导出后,警告消失。

生成发布文件

重新编译并生成发布文件成功:
在这里插入图片描述

总结

  • 注意meson和python、pip3等软件版本,必须满足要求
  • 编译环境不要提前安装gstreamer,避免环境交叉
  • 不同版本编译严格按照meson的源外编译,避免环境交叉
  • 创建新环境重新处理,排除环境干扰,也能提前了解发布后可能遇到的问题
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值