问题
I have a question about the RTSP Stream. How can I display a RTSP Stream from a netwok camera in qml?
the settings:
- Qt5.10
- Camera: LunaIP L-DA-5203-V2
- OS: Windows 7
Things I have tested:
QML: Camera, MediaPlayer, VideoOutput
Until now I didn't found any things how I can solve it in QML?
回答1:
There are 2 ways, which worked for me:
1.) In my form.ui.qml
I'm using the MediaPlayer
and the VideoOutput
components
MediaPlayer {
id: videoPlayer
source: "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov"
muted: true
autoPlay: true
}
VideoOutput {
id: camera1
width: 100
height: 100
anchors.horizontalCenter: parent.horizontalCenter
source: videoPlayer
}
2.) OR I'm using the Video
compoennt in my form.ui.qml
as follow
Video {
id: cam1Stream
x: 49
y: 91
width: 505
height: 336
source: "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov"
autoPlay: true
opacity: 1.0
fillMode: Image.Stretch
muted: false
}
来源:https://stackoverflow.com/questions/48438976/qml-rtsp-stream-from-a-network-camera