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. How to display Gstreamer video using vaapisink inside QVideoWidget by QMediaPlayer?
Qt 6.11 is out! See what's new in the release blog

How to display Gstreamer video using vaapisink inside QVideoWidget by QMediaPlayer?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.1k 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.
  • T Offline
    T Offline
    tungnh
    wrote on last edited by
    #1

    I'm using Qt5.12 and gcc+-8 on Debian 11, desktop is Weston compositor. Gstreamer version is 1.0. I want to display a video by Gstreamer with vaapisink renderer on a QVideoWidget by QMediaPlayer on my application.

    There is an example on this site QMediaPlayer example

    player = new QMediaPlayer;
    videoWidget = new QVideoWidget;
    videoWidget->show();
    player->setVideoOutput(videoWidget);
    player->setMedia(QUrl("gst-pipeline: videotestsrc ! xvimagesink name=\"qtvideosink\""));
    player->play();
    

    I've tried this and video can run ok inside QVideoWidget. But when I tried with my video from Jellyfish and with vaapisink filter, video is displayed outside the QVideoWidget. The QVideoWidget only shows black. My code is like:

    player = new QMediaPlayer;
    videoWidget = new QVideoWidget;
    videoWidget->show();
    player->setVideoOutput(videoWidget);
    player->setMedia(QUrl("gst-pipeline: filesrc location=jellyfish-10-mbps-hd-h264.mkv ! matroskademux ! h264parse ! vaapih264dec ! vaapisink name=\"qtvideosink\"));
    player->play();
    

    Do you know this problem and how to fix this?

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

      Hi and welcome to devnet,

      Probably related to QTBUG-91677.

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

      T 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Probably related to QTBUG-91677.

        T Offline
        T Offline
        tungnh
        wrote on last edited by
        #3

        @SGaist Thanks for your support. I've seen the link you sent. Actually, my problem is more related to how to use GStreamer pipeline through setMedia method of QMediaPlayer.

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

          The common point between the two is the use of the vaapisink hence my suggestion.

          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