Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Render multiple videos on seperated threads on QML



  • I want to show live video of multiple video surveillance cameras in a QML project. I have access to MJPEG video streams of each camera. How ever, I have problems with playing MJPEG video stream from a url in QML.

    I currently use Video. This is the code I currently use:

    Video
    {
    id : myVideo
    width: parent.width
    height: parent.height
    anchors.centerIn: parent
    source : cameraPath
    autoPlay: true
    }

    But when I play one video, it has lags and glitches, some times even it makes my program to freeze. And when I play two videos, my program will definitely freeze and I have to force exit.

    I used Image instead of Video, but it didn't work. I also used Mediaplayer, but it is exactly the same as Video.

    I think the problem is that QML can't render multiple vidoes at once. And because I have some timers in my code, my main thread will be blocked. Is there any way in QML so that I can render each video separately in another thread? Does QML Video have problems with MJPEG? Is there any other component that I can work with?


Log in to reply