Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. QtonPi
  4. QMediaPlayer not showing Video on Raspberry Pi, works fine on Windows
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Unsolved QtonPi
2 Posts 2 Posters 742 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.
  • K Offline
    K Offline
    Kester
    wrote on 24 Nov 2021, 14:48 last edited by
    #1

    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
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 24 Nov 2021, 19:30 last edited by
      #2

      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
      0

      2/2

      24 Nov 2021, 19:30

      • Login

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