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. QVideoWidget and QMedia Player - Problem with showing video (Screen stays blank)
Forum Updated to NodeBB v4.3 + New Features

QVideoWidget and QMedia Player - Problem with showing video (Screen stays blank)

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 3 Posters 3.0k 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.
  • H Offline
    H Offline
    hrathod
    wrote on last edited by hrathod
    #1

    Using Qt5 and Running under Kubntu in Oracle VM Ware.

    Hello,

    I am trying to run and show a video in a simple example for further use.
    Have tried both showing it in QGraphics view and latest to make is simple trying to add that in Horizontal layout.

    The code runs and applicaiton output is as below:
    @
    " libGL error: pci id for fd 9: 80ee:beef, driver (null)
    libGL error: core dri or dri2 extension not found
    libGL error: failed to load driver: vboxvideo
    QMediaPlayer::PlayingState
    "
    @

    It doesn't run a video. Screen stays black/blank.

    CAN ANYONE FIGURE OUT WHAT COULD BE WRONG HERE. WHY IT IS NOT SHOWING VIDEO.
    AND ANY SUGGESTION ON TRYING OTHER SOLUTIONS WOULD BE WELCOME>

    My code is as below:

    @@@@
    #include "application.h"
    #include "ui_application.h"

    #include <QtMultimedia/QMediaPlayer>
    #include <QtMultimediaWidgets/QVideoWidget>

    #include <QDebug>

    Application::Application(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Application)
    {
    ui->setupUi(this);

    // ADD USER CODE HERE
    
    QMediaPlayer* player = new QMediaPlayer;
    QVideoWidget* vw = new QVideoWidget;
    
    ui->horizontalLayout->addWidget(vw);
    
    
    player->setVideoOutput(vw);
    player->setMedia(QUrl::fromLocalFile("/home/ccs/qt/MyProjects/VideoPlayTest/Multimedia/Shaktimanmpgvideo.mpg"));
    
    
    vw->setGeometry(0,0,800,480);
    vw->show();
    
    
    player->play();
    
    qDebug() << player->state();
    

    }

    Application::~Application()
    {
    delete ui;
    }

    @@@@

    Output Screen looks like image attached:

    0_1534950947596_Output.jpg

    SGaistS 1 Reply Last reply
    0
    • H hrathod

      Using Qt5 and Running under Kubntu in Oracle VM Ware.

      Hello,

      I am trying to run and show a video in a simple example for further use.
      Have tried both showing it in QGraphics view and latest to make is simple trying to add that in Horizontal layout.

      The code runs and applicaiton output is as below:
      @
      " libGL error: pci id for fd 9: 80ee:beef, driver (null)
      libGL error: core dri or dri2 extension not found
      libGL error: failed to load driver: vboxvideo
      QMediaPlayer::PlayingState
      "
      @

      It doesn't run a video. Screen stays black/blank.

      CAN ANYONE FIGURE OUT WHAT COULD BE WRONG HERE. WHY IT IS NOT SHOWING VIDEO.
      AND ANY SUGGESTION ON TRYING OTHER SOLUTIONS WOULD BE WELCOME>

      My code is as below:

      @@@@
      #include "application.h"
      #include "ui_application.h"

      #include <QtMultimedia/QMediaPlayer>
      #include <QtMultimediaWidgets/QVideoWidget>

      #include <QDebug>

      Application::Application(QWidget *parent) :
      QWidget(parent),
      ui(new Ui::Application)
      {
      ui->setupUi(this);

      // ADD USER CODE HERE
      
      QMediaPlayer* player = new QMediaPlayer;
      QVideoWidget* vw = new QVideoWidget;
      
      ui->horizontalLayout->addWidget(vw);
      
      
      player->setVideoOutput(vw);
      player->setMedia(QUrl::fromLocalFile("/home/ccs/qt/MyProjects/VideoPlayTest/Multimedia/Shaktimanmpgvideo.mpg"));
      
      
      vw->setGeometry(0,0,800,480);
      vw->show();
      
      
      player->play();
      
      qDebug() << player->state();
      

      }

      Application::~Application()
      {
      delete ui;
      }

      @@@@

      Output Screen looks like image attached:

      0_1534950947596_Output.jpg

      SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      VM Ware or Virtual Box ?

      If the later, did you install the Guest Additions on the machine ?
      Can you run something like glxgears successfully ?
      Did you enabled 3D acceleration ?

      @hrathod said in QVideoWidget and QMedia Player - Problem with showing video (Screen stays blank):

      CAN ANYONE FIGURE OUT WHAT COULD BE WRONG HERE. WHY IT IS NOT SHOWING VIDEO.
      AND ANY SUGGESTION ON TRYING OTHER SOLUTIONS WOULD BE WELCOME>

      Please refrain from writing such all caps sentences. In written language it's considered shouting and rude.

      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
      2
      • H Offline
        H Offline
        hrathod
        wrote on last edited by hrathod
        #3

        Hello SGaist,

        Thank you first of all for the reply and suggestions.

        It is Oracle VM Virtual Box Manager.
        3D Acceleration was not enabled. Now enabled.
        And yes there is a guest addition installed. Adding two pictures for reference.

        Wasn't knowing about all Caps things. It was just an attempt to separate a request from the code and description. Will keep in mind for future use.

        After enabling 3d acceleration, did try again running below code. Still it is blank, but now there are some list of warnings which are pasted after the code.

        @@@
        #include "application.h"
        #include "ui_application.h"

        #include <QtMultimedia/QMediaPlayer>
        #include <QtMultimediaWidgets/QVideoWidget>

        #include <QDebug>

        Application::Application(QWidget *parent) :
        QWidget(parent),
        ui(new Ui::Application)
        {
        ui->setupUi(this);

        // ADD USER CODE HERE
        
        QMediaPlayer* player = new QMediaPlayer;
        QVideoWidget* vw = new QVideoWidget;
        
        player->setVideoOutput(vw);
        player->setMedia(QUrl::fromLocalFile("/home/ccs/qt/MyProjects/VideoPlayTest/Multimedia/Shaktimanmpgvideo.mpg"));
        
        
        vw->setGeometry(0,0,800,480);
        vw->show();
        
        
        player->play();
        
        qDebug() << player->state();
        

        }

        Application::~Application()
        {
        delete ui;
        }

        @@@

        // Application output as below
        Starting /home/ccs/qt/MyProjects/build-VideoPlayTest-Virtual_Development_Qt5-Debug/VideoPlayTest...
        libGL error: pci id for fd 9: 80ee:beef, driver (null)
        OpenGL Warning: glFlushVertexArrayRangeNV not found in mesa table
        OpenGL Warning: glVertexArrayRangeNV not found in mesa table
        OpenGL Warning: glCombinerInputNV not found in mesa table
        OpenGL Warning: glCombinerOutputNV not found in mesa table
        OpenGL Warning: glCombinerParameterfNV not found in mesa table
        OpenGL Warning: glCombinerParameterfvNV not found in mesa table
        OpenGL Warning: glCombinerParameteriNV not found in mesa table
        OpenGL Warning: glCombinerParameterivNV not found in mesa table
        OpenGL Warning: glFinalCombinerInputNV not found in mesa table
        OpenGL Warning: glGetCombinerInputParameterfvNV not found in mesa table
        OpenGL Warning: glGetCombinerInputParameterivNV not found in mesa table
        OpenGL Warning: glGetCombinerOutputParameterfvNV not found in mesa table
        OpenGL Warning: glGetCombinerOutputParameterivNV not found in mesa table
        OpenGL Warning: glGetFinalCombinerInputParameterfvNV not found in mesa table
        OpenGL Warning: glGetFinalCombinerInputParameterivNV not found in mesa table
        OpenGL Warning: glDeleteFencesNV not found in mesa table
        OpenGL Warning: glFinishFenceNV not found in mesa table
        OpenGL Warning: glGenFencesNV not found in mesa table
        OpenGL Warning: glGetFenceivNV not found in mesa table
        OpenGL Warning: glIsFenceNV not found in mesa table
        OpenGL Warning: glSetFenceNV not found in mesa table
        OpenGL Warning: glTestFenceNV not found in mesa table
        libGL error: core dri or dri2 extension not found
        libGL error: failed to load driver: vboxvideo
        OpenGL Warning: XGetVisualInfo returned 0 visuals for 09612668
        OpenGL Warning: Retry with 0x8002 returned 0 visuals
        OpenGL Warning: XGetVisualInfo returned 0 visuals for 09612668
        OpenGL Warning: Retry with 0x8002 returned 0 visuals
        OpenGL Warning: glXGetFBConfigAttrib for 09612668, failed to get XVisualInfo
        OpenGL Warning: XGetVisualInfo returned 0 visuals for 09612668
        OpenGL Warning: Retry with 0x8002 returned 0 visuals
        OpenGL Warning: glXGetFBConfigAttrib for 09612668, failed to get XVisualInfo
        OpenGL Warning: XGetVisualInfo returned 0 visuals for 09612668
        OpenGL Warning: Retry with 0x8002 returned 0 visuals
        OpenGL Warning: glXGetFBConfigAttrib for 09612668, failed to get XVisualInfo
        OpenGL Warning: XGetVisualInfo returned 0 visuals for 09612668
        OpenGL Warning: Retry with 0x8002 returned 0 visuals
        OpenGL Warning: glXGetFBConfigAttrib for 09612668, failed to get XVisualInfo
        OpenGL Warning: XGetVisualInfo returned 0 visuals for 09612668
        OpenGL Warning: Retry with 0x8002 returned 0 visuals
        OpenGL Warning: glXGetFBConfigAttrib for 09612668, failed to get XVisualInfo
        OpenGL Warning: XGetVisualInfo returned 0 visuals for 09612668
        OpenGL Warning: Retry with 0x8002 returned 0 visuals
        OpenGL Warning: glXGetFBConfigAttrib for 09612668, failed to get XVisualInfo
        OpenGL Warning: XGetVisualInfo returned 0 visuals for 09612668
        OpenGL Warning: Retry with 0x8002 returned 0 visuals
        OpenGL Warning: glXGetFBConfigAttrib for 09612668, failed to get XVisualInfo
        OpenGL Warning: XGetVisualInfo returned 0 visuals for 09612668
        OpenGL Warning: Retry with 0x8002 returned 0 visuals
        OpenGL Warning: glXGetFBConfigAttrib for 09612668, failed to get XVisualInfo
        QMediaPlayer::PlayingState

        1_1534998554534_Guest Addition.jpg 0_1534998554534_3D Accn.jpg

        jsulmJ 1 Reply Last reply
        0
        • H hrathod

          Hello SGaist,

          Thank you first of all for the reply and suggestions.

          It is Oracle VM Virtual Box Manager.
          3D Acceleration was not enabled. Now enabled.
          And yes there is a guest addition installed. Adding two pictures for reference.

          Wasn't knowing about all Caps things. It was just an attempt to separate a request from the code and description. Will keep in mind for future use.

          After enabling 3d acceleration, did try again running below code. Still it is blank, but now there are some list of warnings which are pasted after the code.

          @@@
          #include "application.h"
          #include "ui_application.h"

          #include <QtMultimedia/QMediaPlayer>
          #include <QtMultimediaWidgets/QVideoWidget>

          #include <QDebug>

          Application::Application(QWidget *parent) :
          QWidget(parent),
          ui(new Ui::Application)
          {
          ui->setupUi(this);

          // ADD USER CODE HERE
          
          QMediaPlayer* player = new QMediaPlayer;
          QVideoWidget* vw = new QVideoWidget;
          
          player->setVideoOutput(vw);
          player->setMedia(QUrl::fromLocalFile("/home/ccs/qt/MyProjects/VideoPlayTest/Multimedia/Shaktimanmpgvideo.mpg"));
          
          
          vw->setGeometry(0,0,800,480);
          vw->show();
          
          
          player->play();
          
          qDebug() << player->state();
          

          }

          Application::~Application()
          {
          delete ui;
          }

          @@@

          // Application output as below
          Starting /home/ccs/qt/MyProjects/build-VideoPlayTest-Virtual_Development_Qt5-Debug/VideoPlayTest...
          libGL error: pci id for fd 9: 80ee:beef, driver (null)
          OpenGL Warning: glFlushVertexArrayRangeNV not found in mesa table
          OpenGL Warning: glVertexArrayRangeNV not found in mesa table
          OpenGL Warning: glCombinerInputNV not found in mesa table
          OpenGL Warning: glCombinerOutputNV not found in mesa table
          OpenGL Warning: glCombinerParameterfNV not found in mesa table
          OpenGL Warning: glCombinerParameterfvNV not found in mesa table
          OpenGL Warning: glCombinerParameteriNV not found in mesa table
          OpenGL Warning: glCombinerParameterivNV not found in mesa table
          OpenGL Warning: glFinalCombinerInputNV not found in mesa table
          OpenGL Warning: glGetCombinerInputParameterfvNV not found in mesa table
          OpenGL Warning: glGetCombinerInputParameterivNV not found in mesa table
          OpenGL Warning: glGetCombinerOutputParameterfvNV not found in mesa table
          OpenGL Warning: glGetCombinerOutputParameterivNV not found in mesa table
          OpenGL Warning: glGetFinalCombinerInputParameterfvNV not found in mesa table
          OpenGL Warning: glGetFinalCombinerInputParameterivNV not found in mesa table
          OpenGL Warning: glDeleteFencesNV not found in mesa table
          OpenGL Warning: glFinishFenceNV not found in mesa table
          OpenGL Warning: glGenFencesNV not found in mesa table
          OpenGL Warning: glGetFenceivNV not found in mesa table
          OpenGL Warning: glIsFenceNV not found in mesa table
          OpenGL Warning: glSetFenceNV not found in mesa table
          OpenGL Warning: glTestFenceNV not found in mesa table
          libGL error: core dri or dri2 extension not found
          libGL error: failed to load driver: vboxvideo
          OpenGL Warning: XGetVisualInfo returned 0 visuals for 09612668
          OpenGL Warning: Retry with 0x8002 returned 0 visuals
          OpenGL Warning: XGetVisualInfo returned 0 visuals for 09612668
          OpenGL Warning: Retry with 0x8002 returned 0 visuals
          OpenGL Warning: glXGetFBConfigAttrib for 09612668, failed to get XVisualInfo
          OpenGL Warning: XGetVisualInfo returned 0 visuals for 09612668
          OpenGL Warning: Retry with 0x8002 returned 0 visuals
          OpenGL Warning: glXGetFBConfigAttrib for 09612668, failed to get XVisualInfo
          OpenGL Warning: XGetVisualInfo returned 0 visuals for 09612668
          OpenGL Warning: Retry with 0x8002 returned 0 visuals
          OpenGL Warning: glXGetFBConfigAttrib for 09612668, failed to get XVisualInfo
          OpenGL Warning: XGetVisualInfo returned 0 visuals for 09612668
          OpenGL Warning: Retry with 0x8002 returned 0 visuals
          OpenGL Warning: glXGetFBConfigAttrib for 09612668, failed to get XVisualInfo
          OpenGL Warning: XGetVisualInfo returned 0 visuals for 09612668
          OpenGL Warning: Retry with 0x8002 returned 0 visuals
          OpenGL Warning: glXGetFBConfigAttrib for 09612668, failed to get XVisualInfo
          OpenGL Warning: XGetVisualInfo returned 0 visuals for 09612668
          OpenGL Warning: Retry with 0x8002 returned 0 visuals
          OpenGL Warning: glXGetFBConfigAttrib for 09612668, failed to get XVisualInfo
          OpenGL Warning: XGetVisualInfo returned 0 visuals for 09612668
          OpenGL Warning: Retry with 0x8002 returned 0 visuals
          OpenGL Warning: glXGetFBConfigAttrib for 09612668, failed to get XVisualInfo
          OpenGL Warning: XGetVisualInfo returned 0 visuals for 09612668
          OpenGL Warning: Retry with 0x8002 returned 0 visuals
          OpenGL Warning: glXGetFBConfigAttrib for 09612668, failed to get XVisualInfo
          QMediaPlayer::PlayingState

          1_1534998554534_Guest Addition.jpg 0_1534998554534_3D Accn.jpg

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @hrathod Can you play same video with a player like VLC?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          H 1 Reply Last reply
          0
          • jsulmJ jsulm

            @hrathod Can you play same video with a player like VLC?

            H Offline
            H Offline
            hrathod
            wrote on last edited by
            #5

            @jsulm
            Yes, I am able to play video in VLC in windows and also in Linux.

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

              Can you try one of Qt's OpenGL example ?

              By the way, to include code you can use three backticks before and after the code or the </> button to start adding code.

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

              H 1 Reply Last reply
              0
              • SGaistS SGaist

                Can you try one of Qt's OpenGL example ?

                By the way, to include code you can use three backticks before and after the code or the </> button to start adding code.

                H Offline
                H Offline
                hrathod
                wrote on last edited by
                #7

                @SGaist
                Hello,

                Yes even tried OpenGL example.

                I guess there are some drivers problem or missing supporting set up.
                Unable to figure that out still. Tried installing and updating some drivers.

                However, for now have done this with an alternative by converting video to GIF and running GIF in label.

                Thanks for your time on supporting this.

                **
                By the way, to include code you can use three backticks before and after the code or the </> button to start adding code.

                Noted. For next posts will keep this in mind.

                Hardik Rathod

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

                  Which version of VirtualBox are you using ?

                  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