QML Невозможно воспроизвести IP-камеру через ссылку RTSP - PullRequest
0 голосов
/ 10 апреля 2020

Моя цель - поймать прямую трансляцию моей IP-камеры. Когда я тестирую свой код по ссылке

rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov

, он работает хорошо. Однако, когда дело доходит до ссылки rtsp моей камеры, поток не появляется на моем экране.

rtsp://192.168.1.100/z3-1.sdp

main.qml

import QtQuick 2.4
import QtQuick.Controls 2.4
import QtQuick.Layouts 1.0
import QtMultimedia 5.4

ApplicationWindow {
    visible: true
    visibility: "Maximized"
    //visibility: "FullScreen"
    title: qsTr("B2Open - RTSP e Streaming Video com Qt5 QML")

    SwipeView {
        id: swipeView
        anchors.fill: parent
        currentIndex: tabBar.currentIndex


        Page {
            MediaPlayer {
                id: mediaplayer1
                source: "rtsp://192.168.1.100/z3-1.sdp"
                //source: "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov"
            }

            VideoOutput {
                anchors.fill: parent
                source: mediaplayer1
            }

            Text {
                id: msgPage1
                anchors.centerIn: parent
                font.pointSize: 32
                text: qsTr("Toque para iniciar")
            }

            MouseArea {
                id: playArea
                anchors.fill: parent
                onClicked: {
                    if (msgPage1.visible)
                    {
                        print("Iniciando streaming - 1")
                        msgPage1.visible = false
                        mediaplayer1.play()
                    }
                    else {
                        print("Parando streaming - 1")
                        mediaplayer1.stop()
                        msgPage1.visible = true
                    }
                }
            }
        }

    }

    footer: TabBar {
        id: tabBar
        currentIndex: swipeView.currentIndex
        TabButton {
            text: qsTr("IPCAM1")
        }
        TabButton {
            text: qsTr("IPCAM2")
        }
    }
}

Я видел, что люди в основном использовали плагин gstreamer но я не смог найти ни одного классного урока для этого. Я новичок в Qt и мне нужна помощь по этому вопросу.

...