<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Split-view of cam feeds QML]]></title><description><![CDATA[<p dir="auto">Re: <a href="/topic/112820/multiple-cameras-qml">Multiple cameras QML</a></p>
<p dir="auto">I want to see two camera feeds, or rather, multiple camera feeds, like a CCTV hub, on a single screen. I used the codes given in the Qt forum query titled: Multiple cameras QML. The code runs error-free but I'm not getting the feeds in split form instead they are getting overlapped. I am using Qt 5.15 on a Windows 10 64-bit machine and I have tried building using both minGW and MSVC2015 getting the same results.<br />
The two codes are below:<br />
CamCam.qml</p>
<pre><code>import QtQuick 2.14
import QtMultimedia 5.12

Item{
    id:cameraWindow
    anchors.fill: parent
    signal closed
    property alias theID: camera.deviceId
    property alias backgroundColor: background.color
    property alias orientation: vo.orientation

    Rectangle{
        id: background
        anchors.fill: parent
        color: "blue"
    }

    Camera{
        id:camera
    }

    VideoOutput{
        id: vo
        z:99
        source: camera
        anchors.fill: parent
    }

}
</code></pre>
<p dir="auto">main.qml</p>
<pre><code>import QtQuick 2.12
import QtMultimedia 5.12
import QtQuick.Window 2.12
import QtQuick.Controls 2.15

Window {
visible: true
width: 1900
height: 1080
title: qsTr("CamHub")

Item{
        id: cameraLeft
        anchors.left: parent.left
        anchors.top: parent.top
        anchors.right: cameraRight.left
        anchors.bottom: parent.bottom
        clip: true
                CamCam{
                    theID: QtMultimedia.availableCameras[0].deviceId
                    backgroundColor: "red"
                }
        }

Item{
        id: cameraRight
        anchors.right: parent.right
        anchors.top: parent.top
        anchors.left: cameraLeft.right
        anchors.bottom: parent.bottom
        CamCam{
            theID: QtMultimedia.availableCameras[1].deviceId
            backgroundColor: "blue"

        }
    }
}

</code></pre>
<p dir="auto">How I knew they are overlapping?<br />
There are 2 images below. The first image is when I normally run it. The 2nd image is when I made a mistake in the 2nd half of the code (the one with blue background). Since the red background comes 1st in order hence it is always coming below the blue background. I might be wrong and hence any help would be great.<br />
<img src="https://ddgobkiprc33d.cloudfront.net/ed94ee7a-256e-470a-b59c-9328f6e674cd.png" alt="182fef30-e2ad-4ceb-ba57-629c4f7b50c1-image.png" class=" img-fluid img-markdown" /><br />
<img src="https://ddgobkiprc33d.cloudfront.net/3d277b69-0169-4f65-a863-e92d9eb19f45.png" alt="f25faed6-7535-47f5-8815-7a45ec4492d8-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">(I know there is no cam feed on the red background but trust me even when i connected the camera the same thing happens)</p>
<p dir="auto">Thank you!</p>
]]></description><link>https://forum.qt.io/topic/148176/split-view-of-cam-feeds-qml</link><generator>RSS for Node</generator><lastBuildDate>Tue, 22 Sep 2026 00:45:43 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/148176.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 19 Aug 2023 10:43:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Split-view of cam feeds QML on Sat, 26 Aug 2023 19:10:21 GMT]]></title><description><![CDATA[<p dir="auto">It's the other way around. You declare the output and then set it on the camera.</p>
<p dir="auto">See the <a href="https://doc.qt.io/qt-6/qml-qtmultimedia-camera.html" target="_blank" rel="noopener noreferrer nofollow ugc">Camera QML type documentation</a>.</p>
]]></description><link>https://forum.qt.io/post/770312</link><guid isPermaLink="true">https://forum.qt.io/post/770312</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Sat, 26 Aug 2023 19:10:21 GMT</pubDate></item><item><title><![CDATA[Reply to Split-view of cam feeds QML on Sat, 26 Aug 2023 12:00:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> Okay will do that thanks.<br />
I also wanted to know if this can be done on Qt6. I tried but the problem I faced was the VideoOutput method in Qt6 didn't have a member called source, which was there in Qt5.15. So is there any way to do this split thing in Qt6?</p>
]]></description><link>https://forum.qt.io/post/770284</link><guid isPermaLink="true">https://forum.qt.io/post/770284</guid><dc:creator><![CDATA[Animesh452]]></dc:creator><pubDate>Sat, 26 Aug 2023 12:00:01 GMT</pubDate></item><item><title><![CDATA[Reply to Split-view of cam feeds QML on Tue, 22 Aug 2023 20:37:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/animesh452">@<bdi>Animesh452</bdi></a> you have to read the camera documentation.</p>
]]></description><link>https://forum.qt.io/post/769758</link><guid isPermaLink="true">https://forum.qt.io/post/769758</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Tue, 22 Aug 2023 20:37:15 GMT</pubDate></item><item><title><![CDATA[Reply to Split-view of cam feeds QML on Tue, 22 Aug 2023 12:21:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> Hello. How would I know if my camera has multiple formats I can select from? If you could mention the related functions and how they are used, that would be great.</p>
<p dir="auto">Thanks!!</p>
]]></description><link>https://forum.qt.io/post/769713</link><guid isPermaLink="true">https://forum.qt.io/post/769713</guid><dc:creator><![CDATA[Animesh452]]></dc:creator><pubDate>Tue, 22 Aug 2023 12:21:29 GMT</pubDate></item><item><title><![CDATA[Reply to Split-view of cam feeds QML on Mon, 21 Aug 2023 17:35:07 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">The image aspect ratio usually depends on the camera you use. Some are 4:3 others 16:9. Some may even have several formats from which you can select one.</p>
]]></description><link>https://forum.qt.io/post/769621</link><guid isPermaLink="true">https://forum.qt.io/post/769621</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Mon, 21 Aug 2023 17:35:07 GMT</pubDate></item><item><title><![CDATA[Reply to Split-view of cam feeds QML on Mon, 21 Aug 2023 10:04:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/johngod">@<bdi>johngod</bdi></a> A huge thanks buddy its works. I tried it with a USB cam and it works as intended.<br />
<img src="https://ddgobkiprc33d.cloudfront.net/c6b07ca0-3b5c-4c18-8ba7-45f291d88214.png" alt="Screenshot (33).png" class=" img-fluid img-markdown" /><br />
Here is a ss after I connected another camera.<br />
Thanks a lot man!!!!</p>
<p dir="auto">I had another doubt like they aren't of the same size. So, can I resize the feeds using width and height or it depends on the camera I am using? Currently, one is an integrated laptop webcam while the other is a USB cam.</p>
]]></description><link>https://forum.qt.io/post/769595</link><guid isPermaLink="true">https://forum.qt.io/post/769595</guid><dc:creator><![CDATA[Animesh452]]></dc:creator><pubDate>Mon, 21 Aug 2023 10:04:21 GMT</pubDate></item><item><title><![CDATA[Reply to Split-view of cam feeds QML on Sun, 20 Aug 2023 10:06:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/animesh452">@<bdi>Animesh452</bdi></a> Hi</p>
<p dir="auto">Like this should work, I got the red and blue rectangle properly aligned</p>
<pre><code>Window {
    visible: true
    width: 1900
    height: 1080
    title: qsTr("CamHub")

    Item{
        id: cameraLeft
        width: parent.width * 0.5
        height: parent.height
        anchors.left: parent.left
        clip: true
        CamCam{
            //  theID: QtMultimedia.availableCameras[0].deviceId    
            backgroundColor: "red"
            
        }
    }

    Item{
        id: cameraRight
        width: parent.width * 0.5
        height: parent.height
        anchors.right: parent.right
        CamCam{
            backgroundColor: "blue"

        }   
    }
}
</code></pre>
]]></description><link>https://forum.qt.io/post/769516</link><guid isPermaLink="true">https://forum.qt.io/post/769516</guid><dc:creator><![CDATA[johngod]]></dc:creator><pubDate>Sun, 20 Aug 2023 10:06:36 GMT</pubDate></item><item><title><![CDATA[Reply to Split-view of cam feeds QML on Sun, 20 Aug 2023 07:07:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/johngod">@<bdi>johngod</bdi></a> Hi mate Thanks for the reply.<br />
I tried adding your snippet both inside and outside the CamCam class in main.qml but still got the same results. If I did anything wrong, please correct me. I am a beginner in Qt.</p>
<p dir="auto">Thanks!</p>
]]></description><link>https://forum.qt.io/post/769505</link><guid isPermaLink="true">https://forum.qt.io/post/769505</guid><dc:creator><![CDATA[Animesh452]]></dc:creator><pubDate>Sun, 20 Aug 2023 07:07:40 GMT</pubDate></item><item><title><![CDATA[Reply to Split-view of cam feeds QML on Sat, 19 Aug 2023 17:17:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/animesh452">@<bdi>Animesh452</bdi></a> Hi</p>
<p dir="auto">Try adding a width and height to both cameras</p>
<pre><code>width: parent.width * 0.5
height: parent.height
</code></pre>
]]></description><link>https://forum.qt.io/post/769467</link><guid isPermaLink="true">https://forum.qt.io/post/769467</guid><dc:creator><![CDATA[johngod]]></dc:creator><pubDate>Sat, 19 Aug 2023 17:17:55 GMT</pubDate></item></channel></rss>