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. Getting error from DirectShow Renderer on MSYS MINGW64
Forum Updated to NodeBB v4.3 + New Features

Getting error from DirectShow Renderer on MSYS MINGW64

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 288 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.
  • S Offline
    S Offline
    sueyllam
    wrote on 10 Apr 2024, 19:25 last edited by
    #1

    I have a program that uses the following code to play video:

        m_player = new QMediaPlayer(this, QMediaPlayer::VideoSurface);
        QString filePath = QApplication::applicationDirPath() + "/avi/Face3.avi";
        qDebug() << filePath;
        m_surface = new VideoWidgetSurface(this);
        connect(m_surface, SIGNAL(aviImage(QImage)), this, SLOT(newAVIImage(QImage)));
        m_player->setVideoOutput(m_surface);
        m_player->setMedia(QUrl::fromLocalFile(filePath));
        qDebug() << QMediaPlayer::hasSupport("video/mp4");//avi");
        m_player->play();
    
    

    Note that the first qDebug() returns the correct absolute path for the avi file, while the second one returns 1 for both avi and mp4.

    When running the same code but using windows api instead of Qt, it runs fine.
    Also, I tried Qt on Windows instead of MSYS2 using the mingw command window and got the same problem., so it seems to be a problem for Qt on windows and not an MSYS problem.

    C 1 Reply Last reply 11 Apr 2024, 19:49
    0
    • S Offline
      S Offline
      sueyllam
      wrote on 14 Apr 2024, 19:28 last edited by
      #5

      Well, it was the newAVIImage slot the instigator of this error. It used glTexImade2D for all frames images. You should instead use glTexImage2d for the first frame, then use glTexSubImage2D for the subsequent frames. It seems like a memory problem that takes a while to reset.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sueyllam
        wrote on 10 Apr 2024, 19:51 last edited by
        #2

        I forgot to mention that the version that uses the windows API does use the vfw32 library for handling avi files.

        1 Reply Last reply
        0
        • S sueyllam
          10 Apr 2024, 19:25

          I have a program that uses the following code to play video:

              m_player = new QMediaPlayer(this, QMediaPlayer::VideoSurface);
              QString filePath = QApplication::applicationDirPath() + "/avi/Face3.avi";
              qDebug() << filePath;
              m_surface = new VideoWidgetSurface(this);
              connect(m_surface, SIGNAL(aviImage(QImage)), this, SLOT(newAVIImage(QImage)));
              m_player->setVideoOutput(m_surface);
              m_player->setMedia(QUrl::fromLocalFile(filePath));
              qDebug() << QMediaPlayer::hasSupport("video/mp4");//avi");
              m_player->play();
          
          

          Note that the first qDebug() returns the correct absolute path for the avi file, while the second one returns 1 for both avi and mp4.

          When running the same code but using windows api instead of Qt, it runs fine.
          Also, I tried Qt on Windows instead of MSYS2 using the mingw command window and got the same problem., so it seems to be a problem for Qt on windows and not an MSYS problem.

          C Offline
          C Offline
          ChrisW67
          wrote on 11 Apr 2024, 19:49 last edited by ChrisW67 4 Nov 2024, 19:57
          #3

          @sueyllam "Getting error from DirectShow Renderer on MSYS MINGW64"

          Care to share what that warning is and what actually happens?
          What Qt version?
          What is VideoWidgetSurface?

          When running the same code but using windows api instead of Qt, it runs fine.

          So, not the same code then.

          S 1 Reply Last reply 12 Apr 2024, 12:49
          0
          • C ChrisW67
            11 Apr 2024, 19:49

            @sueyllam "Getting error from DirectShow Renderer on MSYS MINGW64"

            Care to share what that warning is and what actually happens?
            What Qt version?
            What is VideoWidgetSurface?

            When running the same code but using windows api instead of Qt, it runs fine.

            So, not the same code then.

            S Offline
            S Offline
            sueyllam
            wrote on 12 Apr 2024, 12:49 last edited by
            #4

            @ChrisW67 Well it seems the error has to do with the settings of the environment. I am using Qt5.15 and I tried the examples supplied with the Qt opensource distribution and the same thing happens with a different surface. however after a day and a half of trials and rebooting things seem to work fine. then a little bit after some work the error seems to resurface. try the videowidget and videographicsitem examples that came with qt to make sure it is not your code but somehow something triggers the environment to produce this error. It seems DirectShow is flaky. MS is planning to replace it gradually.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              sueyllam
              wrote on 14 Apr 2024, 19:28 last edited by
              #5

              Well, it was the newAVIImage slot the instigator of this error. It used glTexImade2D for all frames images. You should instead use glTexImage2d for the first frame, then use glTexSubImage2D for the subsequent frames. It seems like a memory problem that takes a while to reset.

              1 Reply Last reply
              0
              • S sueyllam has marked this topic as solved on 14 Apr 2024, 19:28

              1/5

              10 Apr 2024, 19:25

              • Login

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