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. QVideoWidget black window
Forum Updated to NodeBB v4.3 + New Features

QVideoWidget black window

Scheduled Pinned Locked Moved Mobile and Embedded
multimediaqt5video
3 Posts 3 Posters 1.6k 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.
  • Z Offline
    Z Offline
    Zola
    wrote on last edited by Zola
    #1

    I have added QVideoWidget as a child to QWidget, and I am trying to play local avi file, but without success. Here is the code:

    #include "widget.h"
    #include <QApplication>
    #include <QtWidgets>
    #include <QtMultimediaWidgets>
    
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
        Widget window;
        window.resize(320, 240);
        window.setWindowTitle(QApplication::translate("childwidget", "Child widget"));
        window.show();
    
        QMediaPlayer *player = new QMediaPlayer;
    
        QMediaPlaylist *playlist = new QMediaPlaylist(player);
        playlist->addMedia(QUrl::fromLocalFile("/home/designer/Desktop/drop.avi"));
    
        QVideoWidget *videoWidget = new QVideoWidget(&window);
        player->setVideoOutput(videoWidget);
    
        videoWidget->resize(320, 240);
        videoWidget->show();
        playlist->setCurrentIndex(1);
        player->play();
    
        return a.exec();
    }
    

    I included multimedia, multimediawidgets and widgets in my .pro file.

    Also gstreamer packages are installed with sudo apt-get install gstreamer* libgstreamer* and version is 0.10.

    I am running Debian Wheezy on VMWare and trying to build that code for i386 Desktop machine.

    Am I missing something important so this code won't work? Only I get is black QVideoWidget window inside parrent QWidget.

    M 1 Reply Last reply
    1
    • Z Zola

      I have added QVideoWidget as a child to QWidget, and I am trying to play local avi file, but without success. Here is the code:

      #include "widget.h"
      #include <QApplication>
      #include <QtWidgets>
      #include <QtMultimediaWidgets>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          Widget window;
          window.resize(320, 240);
          window.setWindowTitle(QApplication::translate("childwidget", "Child widget"));
          window.show();
      
          QMediaPlayer *player = new QMediaPlayer;
      
          QMediaPlaylist *playlist = new QMediaPlaylist(player);
          playlist->addMedia(QUrl::fromLocalFile("/home/designer/Desktop/drop.avi"));
      
          QVideoWidget *videoWidget = new QVideoWidget(&window);
          player->setVideoOutput(videoWidget);
      
          videoWidget->resize(320, 240);
          videoWidget->show();
          playlist->setCurrentIndex(1);
          player->play();
      
          return a.exec();
      }
      

      I included multimedia, multimediawidgets and widgets in my .pro file.

      Also gstreamer packages are installed with sudo apt-get install gstreamer* libgstreamer* and version is 0.10.

      I am running Debian Wheezy on VMWare and trying to build that code for i386 Desktop machine.

      Am I missing something important so this code won't work? Only I get is black QVideoWidget window inside parrent QWidget.

      M Offline
      M Offline
      mehmety888
      wrote on last edited by
      #2

      @Zola Have you find a solution ?

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SirMeMeME
        wrote on last edited by
        #3

        @mehmety888, this thread is over 2 years old. If they did they would of said they did find a solution. By the way you mean found not find.

        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