在 Windows 上以 QML 播放 RTSP 视频 [英] Playing RTSP Video in QML on Windows

查看:152
本文介绍了在 Windows 上以 QML 播放 RTSP 视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am trying to play a RTSP stream in QML into a Video tag as following:

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 个视频屏幕,但我收到错误:

This should display 8 videoScreens, but I am getting the error:

DirectShowPlayerService::doSetUrlSource:未解决的错误代码 800c000d

DirectShowPlayerService::doSetUrlSource: Unresolved error code 800c000d

网址:

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

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

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

Does QML support RTSP? If so, What I am doing wrong? If not, How could I get this working?

PS.:我也尝试将 MediaPlayer 与 VideoOutput 一起使用,但出现了同样的错误.

PS.: I've also tried to use MediaPlayer together with VideoOutput, but I was given the same error.

提前致谢

推荐答案

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

Qt in itself does not support RTSP. Try using third party library such as OpenCV or FFMPEG. I used OpenCV then created a plugin from my backend C++ code to create an OpenCV camera element then displayed the RTSP feeds in QML.

这篇关于在 Windows 上以 QML 播放 RTSP 视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆