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. Unable to play videos on QML Qt6.4 on embedded platform
QtWS25 Last Chance

Unable to play videos on QML Qt6.4 on embedded platform

Scheduled Pinned Locked Moved Solved QML and Qt Quick
12 Posts 2 Posters 1.8k 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 imahgin

    Hi,

    I've developed a QML app on an embedded platform (Yocto + Qt6.4) and I'm experiencing an issue when trying to play videos.
    Whether I use MediaPlayer + VideoOutput or Video components, I'm not able to view anything on the screen. Audio plays ok though

    This is a snippet of my code, but video QML examples also doesn't work.

        Video {
            id: video
            anchors.fill: parent
            source: "file:///home/root/turning_pages.avi"
            fillMode: Image.Stretch
            muted: false
    
            Component.onCompleted: play()
    
            onErrorOccurred: error => console.log('Error occurred:', errorString, error)
            onPlaying: console.log('playing stream', source)
            onStopped: console.log('stream stopped')
            onBufferProgressChanged: console.log('buffering:', bufferProgress)
        }
    

    And this is the console output -no warnings nor errors-

    ====== AIUR: 4.7.3 build on Feb  3 2023 05:14:46. ======
    	Core: AVI_PARSER_03.06.08  build on Sep 26 2022 08:17:20
     file: /usr/lib/imx-mm/parser/lib_avi_parser_arm_elinux.so.3.1
    ------------------------
        Track 00 [video_0] Enabled
    	Duration: 0:00:15.533178000
    	Language: und
        Mime:
    	image/jpeg, width=(int)160, height=(int)120, framerate=(fraction)500000/33333 
    ------------------------
    ------------------------
        Track 01 [audio_0] Enabled
    	Duration: 0:00:15.533381000
    	Language: und
        Mime:
    	audio/x-raw, format=(string)U8, channels=(int)1, layout=(string)interleaved, rate=(int)11024, bitrate=(int)88192 
    

    I'm able to play the video using gst-launch

    gst-launch-1.0 playbin uri=file:///home/root/turning_pages.avi video-sink="waylandsink sync=false"
    

    So it seems it's not a codec related issue.

    Running Qt widgets examples does works and both video and audio works fin, so it seems only related to the QML side

    When building Yocto I added the following lines:

    IMAGE_INSTALL:append = " qtmultimedia qtmultimedia-plugins qtmultimedia-qmlplugins"
    
    PACKAGECONFIG:append_pn-qtmultimedia = " gstreamer gstreamer010"
    "
    

    Solutions like propossed here doesn't work either.

    Thks in advance

    JoeCFDJ Offline
    JoeCFDJ Offline
    JoeCFD
    wrote on last edited by JoeCFD
    #2

    @imahgin Try to install gstreamer1.0-qt6 to see if it helps. I guess qml sink of qt6 may not be available in your case.

    I 1 Reply Last reply
    0
    • JoeCFDJ JoeCFD

      @imahgin Try to install gstreamer1.0-qt6 to see if it helps. I guess qml sink of qt6 may not be available in your case.

      I Offline
      I Offline
      imahgin
      wrote on last edited by
      #3

      @JoeCFD said in Unable to play videos on QML Qt6.4 on embedded platform:

      gstreamer1.0-qt6

      Thks.
      According to this it seems that qmlgsink plugin in upstream gst-plugin doesn't support qt6 yet

      JoeCFDJ 1 Reply Last reply
      0
      • I imahgin

        @JoeCFD said in Unable to play videos on QML Qt6.4 on embedded platform:

        gstreamer1.0-qt6

        Thks.
        According to this it seems that qmlgsink plugin in upstream gst-plugin doesn't support qt6 yet

        JoeCFDJ Offline
        JoeCFDJ Offline
        JoeCFD
        wrote on last edited by JoeCFD
        #4

        @imahgin which gstreamer version? check it out
        gst-launch-1.0 --version

        qml6 sink is available in the later versions of gstreamer. You can build it as well.
        Take a look at qgroundcontrol source code. For Android, qml5sink is built from gstreamer source code. You can do the same thing for qml6sink.

        I 1 Reply Last reply
        0
        • JoeCFDJ JoeCFD

          @imahgin which gstreamer version? check it out
          gst-launch-1.0 --version

          qml6 sink is available in the later versions of gstreamer. You can build it as well.
          Take a look at qgroundcontrol source code. For Android, qml5sink is built from gstreamer source code. You can do the same thing for qml6sink.

          I Offline
          I Offline
          imahgin
          wrote on last edited by
          #5

          @JoeCFD Thks Joe.
          I've been busy these days and haven't tried your suggestion yet.
          I'll do it next week.
          By the moment, I got it to work runinng Yocto Dunfell distribution out of the box -no additional codecs or components added-

          I 1 Reply Last reply
          0
          • I imahgin

            @JoeCFD Thks Joe.
            I've been busy these days and haven't tried your suggestion yet.
            I'll do it next week.
            By the moment, I got it to work runinng Yocto Dunfell distribution out of the box -no additional codecs or components added-

            I Offline
            I Offline
            imahgin
            wrote on last edited by imahgin
            #6

            According to this information seems that Qt6 support for rendering video inside a QML scene is available only from version 1.22.0, and according to this NXP document (I'm using this MPU) this version is included in Rev. LF6.1.36_2.1.0 (page 9)

            My distribution is previous to that revision and gstreamer version is 1.20.3.
            As I'm not an experienced user in Yocto, I'll try to get some assistance to see if there is an 'easy' way to include this -or latest version- on my current Yocto compilation, without breaking other packages.

            JoeCFDJ 1 Reply Last reply
            0
            • I imahgin

              According to this information seems that Qt6 support for rendering video inside a QML scene is available only from version 1.22.0, and according to this NXP document (I'm using this MPU) this version is included in Rev. LF6.1.36_2.1.0 (page 9)

              My distribution is previous to that revision and gstreamer version is 1.20.3.
              As I'm not an experienced user in Yocto, I'll try to get some assistance to see if there is an 'easy' way to include this -or latest version- on my current Yocto compilation, without breaking other packages.

              JoeCFDJ Offline
              JoeCFDJ Offline
              JoeCFD
              wrote on last edited by JoeCFD
              #7

              @imahgin This is what I posted in gstreamer forum before. The latest gstreamer version is 1.22.6. Make sure that your video card is not too old if you use the latest gstreamer.

              Get Source
              
                  get source: git clone ​https://gitlab.freedesktop.org/gstreamer/gstreamer.git
                  git tag -l <==== to list all tags
                  git checkout tags/1.22.5 <==== for example 
              
              Build and install
              
                  cd gstreamer
                  meson setup --prefix=/opt/thirdParties/gstreamer1-22-5 -Dlibdir=lib builddir
                  ninja -C builddir
                  sudo ninja install -C builddir 
              

              Do not install it in the default dir or under /usr/... because your new installation may mess up with the old installation. And it is hard for you to clean it up. If you purge the old installation, some of video tools installed may not work anymore. Set the proper paths for bin, libs and drivers of the newly installed gstreamer.
              meson version may not match. Get the latest meson source and build it.

              I 1 Reply Last reply
              0
              • JoeCFDJ JoeCFD

                @imahgin This is what I posted in gstreamer forum before. The latest gstreamer version is 1.22.6. Make sure that your video card is not too old if you use the latest gstreamer.

                Get Source
                
                    get source: git clone ​https://gitlab.freedesktop.org/gstreamer/gstreamer.git
                    git tag -l <==== to list all tags
                    git checkout tags/1.22.5 <==== for example 
                
                Build and install
                
                    cd gstreamer
                    meson setup --prefix=/opt/thirdParties/gstreamer1-22-5 -Dlibdir=lib builddir
                    ninja -C builddir
                    sudo ninja install -C builddir 
                

                Do not install it in the default dir or under /usr/... because your new installation may mess up with the old installation. And it is hard for you to clean it up. If you purge the old installation, some of video tools installed may not work anymore. Set the proper paths for bin, libs and drivers of the newly installed gstreamer.
                meson version may not match. Get the latest meson source and build it.

                I Offline
                I Offline
                imahgin
                wrote on last edited by
                #8

                @JoeCFD Thks,
                Varisice has unveiledd a new Yocto distribution with Qt 6.5 that upgrades gstreamer to version 1.22.0
                I'll build again Yocto and try to run the video on QML with this new version.

                I 1 Reply Last reply
                0
                • I imahgin

                  @JoeCFD Thks,
                  Varisice has unveiledd a new Yocto distribution with Qt 6.5 that upgrades gstreamer to version 1.22.0
                  I'll build again Yocto and try to run the video on QML with this new version.

                  I Offline
                  I Offline
                  imahgin
                  wrote on last edited by
                  #9

                  Today I've successfully built a Yocto image with Qt 6.5 and gstreamer 1.22.0 but the problem remains :-(
                  Audio works fine, but I get blank image when playing videos on QML..
                  No errors are displayed and running gstreamer from CLI can play videos without issues.
                  Tried with both 'Video' and 'MediaPlayer' QML components with the same result.

                  JoeCFDJ 1 Reply Last reply
                  0
                  • I imahgin

                    Today I've successfully built a Yocto image with Qt 6.5 and gstreamer 1.22.0 but the problem remains :-(
                    Audio works fine, but I get blank image when playing videos on QML..
                    No errors are displayed and running gstreamer from CLI can play videos without issues.
                    Tried with both 'Video' and 'MediaPlayer' QML components with the same result.

                    JoeCFDJ Offline
                    JoeCFDJ Offline
                    JoeCFD
                    wrote on last edited by JoeCFD
                    #10

                    @imahgin make sure qml6sink in gstreamer is built and available. if your default Qt is 5, gstreamer build may not include qml6sink. Check the configure info to see if Qt6 is applied to gstreamer build.

                    FFMpeg is the backend in Qt6. I am not familiar with FFMpeg and do not know if you need qml6 sink in qml when you use Qt multimedia module.

                    I 1 Reply Last reply
                    0
                    • JoeCFDJ JoeCFD

                      @imahgin make sure qml6sink in gstreamer is built and available. if your default Qt is 5, gstreamer build may not include qml6sink. Check the configure info to see if Qt6 is applied to gstreamer build.

                      FFMpeg is the backend in Qt6. I am not familiar with FFMpeg and do not know if you need qml6 sink in qml when you use Qt multimedia module.

                      I Offline
                      I Offline
                      imahgin
                      wrote on last edited by
                      #11

                      @JoeCFD I'm using gstreamer as a backend

                      qputenv("QT_MEDIA_BACKEND", "gstreamer");
                      

                      I don't see any qml6sink when compiling Yocto so I need to figure out how to include it.

                      I 1 Reply Last reply
                      0
                      • I imahgin

                        @JoeCFD I'm using gstreamer as a backend

                        qputenv("QT_MEDIA_BACKEND", "gstreamer");
                        

                        I don't see any qml6sink when compiling Yocto so I need to figure out how to include it.

                        I Offline
                        I Offline
                        imahgin
                        wrote on last edited by
                        #12

                        @imahgin According to info provided from NXP -I'm currently using an i.MX93 MCU- the problem is related to the MCU version and some problems with Qt libraries.
                        I can confirm that with the latest SOC and BSP everything runs normal

                        1 Reply Last reply
                        0
                        • I imahgin has marked this topic as solved on

                        • Login

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