python - Gstreamer 不在 Ubuntu 18.04 VM 上发送“准备窗口句柄”消息
问题描述
我正在尝试开发 python 应用程序,它显示接收到的 UDP 流 insige QWidget 窗口。我使用 gstreamer 和 Pyside (Qt)。为此,我需要使用我的 QWidget 的 winId 设置窗口句柄,我这样做了。下面的代码示例:
def _on_any_bus_message(self, bus, message):
structure = message.get_structure()
if structure is not None:
print(structure.get_name())
if structure.get_name() == "prepare-window-handle":
message.src.set_window_handle(self.videoWidget.winId())
return Gst.BusSyncReply.PASS
videoWidget
是类型QWidget
。
当我在 Ubuntu 18.04 VM 中运行我的应用程序并尝试接收流时,它会在新的 OpenGL 渲染器窗口而不是预期的窗口中打开。我在上面的代码中打印了传入的消息,并注意到"prepare-window-handle"
从未收到消息。
我做了另一项测试——我在 Docker 容器中使用 Ubuntu 16.04 运行相同的应用程序并"prepare-window-handle"
收到了消息——它在终端中打印并由应用程序处理。
两台 linux 机器都安装了 gstreamer1.0 和相同的插件集。在 Linux VM 上未收到此消息的原因可能是什么?它与图形驱动程序或某些加速问题有关吗?
解决方案
感谢弗洛里安的问题,我将我的调查引向了一个好的方向,并找到了我的问题的解决方案 - gstreamer 接收管道需要autovideosink
更改为ximagesink
. 完整的工作管道发布在下面:
udpsrc port=4000 ! application/x-rtp,encoding-name=H264,payload=96 ! rtpjitterbuffer ! rtph264depay ! decodebin ! videoconvert ! ximagesink sync=FALSE
推荐阅读
- javascript - 检查多个选项并在 vuex 中过滤
- matlab - 在 MATLAB 中估计 AR 模型系数时的不一致
- javascript - 在 dom-if 元素上添加观察者动态
- python - 组合表单和 inline_formset 的编辑视图
- javascript - 无法让 javascript、JQuery 与我的 PHP 一起使用
- c# - 使用 autofac 依赖注入检测到循环组件依赖的存储库模式
- mongodb - mongodb ObjectId 的问题
- ios - 更新 UICollectionViewCells 的动态高度
- javascript - v-for: _vm.property 为空
- javascript - 如何通过nodejs脚本运行命令