Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved QMediaPlayer not showing Video on Raspberry Pi, works fine on Windows

    QtonPi
    2
    2
    258
    Loading More Posts
    • 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.
    • K
      Kester last edited by

      Hello,
      I'm trying to play a video in a qt application, running on a raspberry pi 4. The application compiles and I can run it, but the window is blanc. Also no errors.

      When I compile and run the same project on Windows on the other hand, the video plays.

      My code inside of the MainWindow-Constructor is:

          ui->setupUi(this);
      
          QMediaPlayer *player = new QMediaPlayer;
      
          player->setMedia(QUrl("qrc:/videos/small.mp4"));
      
          QVideoWidget *videoWidget = new QVideoWidget;
          setCentralWidget(videoWidget);
          player->setVideoOutput(videoWidget);
          player->play();
      

      The video file is in the project folder, but also on the pi, in the same directory as the executable. Am I missing some linux Packages on the Pi?

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi and welcome to devnet,

        Can you play that file with GStreamer on your Pi ?
        Which version of Qt are you using ?
        Are you cross-compiling ?

        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 Reply Quote 0
        • First post
          Last post