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. How to play a video using QML ?

How to play a video using QML ?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 2 Posters 1.1k 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.
  • V Offline
    V Offline
    vishu_fcb
    wrote on last edited by
    #1

    I want to run a sample video using QML .
    When i am runnimng the following code :

    import QtQuick 2.7
    import QtQuick.Window 2.2
    import QtMultimedia 5.5

    Window {
    visible: true
    width: 800
    height:600
    title: qsTr("Hello World")
    Rectangle{

    anchors.fill:parent
    width:800
    height:600
    color:"black"
    MouseArea{

     anchors.fill:parent
    

    }

     MediaPlayer {
         id: player
         source: "/video/VID_20170428_155730057.mp4"
         autoPlay: true
     }
    
     VideoOutput {
         id: videoOutput
         source: player
         anchors.fill: parent
     }
    

    }
    }

    It is displaying an error which shows:
    virtual memory exhausted: Cannot allocate memory
    make: *** [qrc_video.o] Error 1
    11:24:33: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project Video_QML (kit: Desktop Qt 5.7.0 GCC 64bit)
    When executing step "Make"
    11:24:34: Elapsed time: 00:47.
    Can anyone help me how to get rid of this issue

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Did you put that video in a .qrc file ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      V 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Did you put that video in a .qrc file ?

        V Offline
        V Offline
        vishu_fcb
        wrote on last edited by
        #3

        @SGaist yes !! i made a resource file and kept the video inside that in a file called videos.qrc

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Which size is that file ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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