Important: Please read the Qt Code of Conduct -

QAbstractVideoSurface and QVideoProbe issues

  • Hello.
    I have a problem with getting frames from QMediaPlayer. I try to connect it with QVideoProbe object, or with an object of class derived from QAbstractVideoSurface. If I connect media player with QVideoWidget object, it plays the video correctly, so the problem is not concerned with codecs.

    If I connect media player with cVideoSurface (class derived from QAbstractVideoSurface), function present() is never called. When I test my program in debug mode, breakpoint in this function is never reached.

    If I connect media player with QVideoProbe, it never emits the signal videoFrameProbed(). I connect the signal with slot in my MainWindow class, the breakpoint is never reached too.

    This problem hinders me to finish my project, this is a final step, and I've tried many options, but without success. I've created a simple test project, which shows similar behaviour of classes listed above. It can be downloaded here:

    The archive contains MP4 video to play in the project. You can choose three options:

    • QVideoProbe as output;
    • cVideoSurface as output;
    • QVideoWidget as output;
      One option at the time, others are commented. The code is careless, because it's a test.

    I work in Windows XP and use Qt Creator 3.3 (MinGW 32 bit), Qt 5.4. Thanks for your attention, I will be happy to get an answer to my question, especially from Yoann Lopez.

    All the best,

  • See Qt Multimedia on Windows Limitations
    "the DirectShow plugin does not support any low-level video functionality such as monitoring video frames being played or recorded using QVideoProbe or related classes"

  • @cincirin

    Thanks. Does it mean that I should simply rebuild my project in Windows Vista or newer? Should I make any changes in order to choose Media Foundation instead of DirectShow, or it will be chosen automatically?

  • @s.gatich
    I am not sure that I am directly addressing your issue, but I am not able to reproduce your problem. I took your code, commented out everything between line 28-46, uncommented the line with "player_->setVideoOutput( surface_ );", and ran the program. The output shows continous "success" lines from the getFrame method..

  • @gs_chris Thanks. Please tell me what OS do you run? I suppose it's Vista or newer, am I right?

    As cincirin wrote, DirectShow does not support low-level processing. But Win XP (I use it) only contains DirectShow, it does not support Media Foundation.

  • @s.gatich yes, I'm on Windows 8. That will be the reason

  • @gs_chris Thanks again. I will rebulid my project, and, if succeed, put "solved" on the topic.

  • The problem was in Windows XP as expected. Qt doesn't support low level video processing with DirectShow, therefore I complied the project in Win 7. Moreover, MinGW connects the program with DirectShow, so I used MSVS compiler, and the program started to work correctly.

    @gs_chris @cincirin

    Guys, thanks for replies.

  • i am using window7 it not supporting