qt - 在 Windows 上的 QML 中播放 RTSP 视频

标签 qt video stream qml rtsp

我正在尝试将 QML 中的 RTSP 流播放到视频标签中,如下所示:

Repeater {
    model: 8

    Video {
        Layout.fillWidth: true
        Layout.fillHeight: true

        fillMode: VideoOutput.Stretch

        source: Controller.urlCanal(index + 1)
        autoPlay: true
        autoLoad: true

        CustomBorder {
            commonBorder: true
            color: "#228e14"
            commonBorderWidth: 3
        }
    }
}

这应该显示 8 个视频屏幕,但出现错误:

DirectShowPlayerService::doSetUrlSource: Unresolved error code 800c000d

网址:

rtsp://192.168.50.10:8082/user=admin&password=admin&channel=7&stream=0.sdp?real_stream

QML 是否支持 RTSP?如果是这样,我做错了什么? 如果没有,我怎么能让它工作?

PS.: 我也尝试过将 MediaPlayer 与 VideoOutput 一起使用,但我得到了同样的错误。

提前致谢

最佳答案

Qt本身不支持RTSP。尝试使用第三方库,例如 OpenCV 或 FFMPEG。我使用 OpenCV 然后从我的后端 C++ 代码创建一个插件来创建一个 OpenCV 相机元素然后在 QML 中显示 RTSP 提要。

关于qt - 在 Windows 上的 QML 中播放 RTSP 视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26098203/

相关文章:

python - 使用 itemChange() 限制 QGraphicsItem

c++ - 析构函数上的段错误

c++ - Qt 国际化 : QT_TR_NOOP in c++ qstr() in qml

html - 当时间更改或结束时,Firefox 在视频上触发 'pause' 事件

c# - 在现有视频上加水印

delphi - 非大小限制流函数的术语是什么?

c++ - QWaitCondition : Destroyed while threads are still waiting

image - 如何通过使用ffmpeg从目录循环到图像来转换视频?

pdf - 尝试理解 PDF 中交叉引用 (XRef) 流中的数据

delphi - 将字符串写入 TMemoryStream