Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved][QML + Qt5]Video
Forum Updated to NodeBB v4.3 + New Features

[Solved][QML + Qt5]Video

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 3.5k Views 1 Watching
  • 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.
  • A Offline
    A Offline
    AquilaDev
    wrote on last edited by
    #1

    Hello!
    I'm on Linux, and i've some troubles with QML and Multimedia module:
    I want to use a video as background in a QQuickView.

    @import QtQuick 2.0
    import QtMultimedia 5.0

    Rectangle {
    width: 300
    height: 300
    color: "black"

     MediaPlayer {
         id: mediaPlayer
         source: "movie.avi"
         autoPlay: true
     }
    
     VideoOutput {
         id: video
         anchors.fill: parent
         source: mediaPlayer
     }
    

    }@

    And this is what i saw in Qt doc, but i get this error:
    @GStreamer; Unable to play - ""
    Error: "No URI set" @

    I also try the qml video example (which looks similar) but i didn't get any error with it.
    ( http://qt-project.org/doc/qt-5.1/qtmultimedia/video-qmlvideo.html )

    Hope someone could help me..
    (In 2011 someone report this error as a bug in Qt: http://lists.qt.nokia.com/public/qt-mobility-feedback/2011-March/000977.html)

    1 Reply Last reply
    0
    • A Offline
      A Offline
      AquilaDev
      wrote on last edited by
      #2

      No idea ?

      1 Reply Last reply
      0
      • mranger90M Offline
        mranger90M Offline
        mranger90
        wrote on last edited by
        #3

        I was able to run this code on Ubuntu 12.04 with gstreamer 0.10.22 and Qt 5.1.
        Created project as both a QtQuick 2 application and as a QtQuick 2 UI application.
        When I moved the avi file out, application directory, I got the corect diagnostic - "GStreamer; Unable to play -" and the path to the avi file.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          AquilaDev
          wrote on last edited by
          #4

          Ok. That's only when i import a qml file from a qrc.. but when i'm using QUrl::fromLocalFile() it works...

          1 Reply Last reply
          0
          • H Offline
            H Offline
            houmingc
            wrote on last edited by
            #5

            I had the same problem, could you advice on the solution?
            my code work in Qt Quick UI but not in Qt Quick Application.

            I could run MediaPlayer source, exact duplicate to your code
            on Qt Quick UI but on Qt Quick Application.

            int main(int argc, char *argv[ ])
            {

            QGuiApplication app(argc,argv);
            
            QQmlApplicationEngine engine;
            engine.load(Qurl(QStringLiteral("qrc:///main.qml")));
            return app.exec();
            

            }

            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