QML RTSP Stream from a network camera

家住魔仙堡 提交于 2020-02-25 13:29:13

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!