我正在尝试将 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/