error: XDG_RUNTIME_DIR not set in the environment

error: XDG_RUNTIME_DIR not set in the environment

我运行 GStreamer 管道从 rtsp 服务器获取数据。

然后我得到错误:错误:XDG_RUNTIME_DIR not set in the environment.

我已将一些配置添加到 visudo 中:sudo visudo

Defaults env_keep += "DISPLAY XAUTHORITY"
Defaults env_keep += "https_proxy"

还是不行。但它 运行 在 Ubuntu 16.04

中很好

我的环境是“5.0.0-29-generic #31~18.04.1-Ubuntu SMP Thu Sep 12 18:29:21 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux".

如果您有任何解决方案,请告诉我。非常感谢

我已经解决了我的问题。我的经验是再次检查我们的源代码或环境。我也尝试了“https://askubuntu.com/questions/456689/error-xdg-runtime-dir-not-set-in-the-environment-when-attempting-to-run-naut”,但它对我的情况没有帮助。

我也在userroot下输入“$printenv”,我看到用户的环境对[=29有很多设置=].所以,我尝试 运行 我的应用在用户下:./app。结果一样。

然后,我再次检查了我的源代码(export GST_DEBUG=2)。我看到我的源代码使用插件 autovideoconvert 将 BGR 转换为 I420,但它出错了。因此,我将 autovideoconvert 更改为 videoconvert,然后错误得到修复。 谢谢