Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QMediaPlayer playing very slow or low frame rate.

QMediaPlayer playing very slow or low frame rate.

Scheduled Pinned Locked Moved Solved Mobile and Embedded
3 Posts 2 Posters 461 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.
  • B Offline
    B Offline
    Bonty
    wrote on last edited by
    #1

    Qt Version = Qt 5.15
    Development = Linux OS on SOC.

    VideoPlayerForm::VideoPlayerForm(QWidget *parent)
        : QDialog(parent)
        , ui(new Ui::VideoPlayerForm)
    {
        ui->setupUi(this);
        ui->videoPlayerWidget->setAspectRatioMode(Qt::IgnoreAspectRatio);
        qDebug() << "playing video";
        player = new QMediaPlayer(this);
        player->setVideoOutput(ui->videoPlayerWidget);
        //player->setMedia(QUrl("gst-pipeline: gst-launch-1.0 playbin uri=file:/home/root/video.mkv"));
        player->setMedia(QUrl::fromLocalFile("/home/root/video.mkv"));
        player->play();
    
    }
    

    When using " player->setMedia(QUrl::fromLocalFile("/home/root/video.mkv"));" its running very slow.

    And when I use "player->setMedia(QUrl("gst-pipeline: gst-launch-1.0 playbin uri=file:/home/root/video.mkv"));"
    video plays fine but its open in another window rather than the video widget.

    Please help!!

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

      Hi,

      If you want to use a custom pipeline like that, you need to set a sink like shown in the setMedia documentation.

      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
      • B Offline
        B Offline
        Bonty
        wrote on last edited by
        #3

        Thanks @SGaist

        qtvideosink solved my problem.

        1 Reply Last reply
        0
        • B Bonty 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