Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Create 2 gst-pipeline on qml
Forum Updated to NodeBB v4.3 + New Features

Create 2 gst-pipeline on qml

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 165 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    iodev
    wrote on last edited by iodev
    #1

    Hi everyone,

    I would like to create 2 gst-pipelines with diferent items to play 2 different videos using the same structure shown on reference:

    [https://doc.qt.io/qt-5/qml-qtmultimedia-mediaplayer.html]

    Item {
    MediaPlayer {
        id: mediaplayer
        source: "gst-pipeline: videotestsrc ! qtvideosink"
    }
    
    VideoOutput {
        anchors.fill: parent
        source: mediaplayer
    }
    
    MouseArea {
        id: playArea
        anchors.fill: parent
        onPressed: mediaplayer.play();
    }}
    

    /* My code is:*/

    ColumnLayout {
        id: columnLayout
        anchors.fill: parent
        spacing: 0
        Item {
            id: item1
            Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
            width: 220
            height: 220
            Layout.fillWidth: true
            Layout.fillHeight: true
            VideoPlayer {
                width: parent.width
                height: parent.height
                color: backgroundColor
                source: "gst-pipeline: rtspsrc location= " + video1Url + " latency=0 protocols=tcp ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! qtvideosink"
                title: video1Name
                inverted: video1Inverted
                MouseArea {
                    anchors.fill: parent
    
                    }
    
                }
    
            }
        }
    
        RowLayout {
    
            spacing: 0
    
            Item {
                id: item2
                Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
                height: 70
                Layout.fillWidth: true
                Layout.fillHeight: true
                VideoPlayer {
                    width: parent.width
                    height: parent.height
                    color: backgroundColor
                    source: "gst-pipeline: rtspsrc location= " + video2Url + " latency=0 protocols=tcp ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! qtvideosink"
                    title: video2Name
                    inverted: video2Inverted
                    MouseArea {
                        anchors.fill: parent
    
                }
            }
            }
    

    With this code I just can get 1 one of them working. I would like to create a gst-pipeline for each video. Any idea about what changes what I have to do please? Thanks

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved