ms-media-foundation

ReadSample not (or very slowly) returning on some Windows 11 systems


We have an application that uses IMFSourceReader::ReadSample to get specific frames out of videos. This has worked reliably for years on Windows 7, 8 and 10.

Now, on Windows 11 it happens on some systems (not all Windows 11 systems are affected by this), that ReadSample either takes around 30 seconds to return (if that is the case, the returned frame is correct), or does not return at all. This makes our application unusable on those Windows 11 installations.

The videos that are affected can be played normally in the windows media player, and also work in a System.Windows.Controls.MediaElement control that is embedded in our application, so I don't think that it's a codec issue.

Has anyone else seen this effect? Or does anyone have an idea on how to debug this? I now have a system available, where I can reproduce this (before, it was just customer reports). I tried using mftrace, but it exits with an exception whenever I try to attach it to our application.


Solution

  • It turns out that the affected PCs were using integrated intel graphics chips. Updating the graphics device driver to the newest version solved the problem.

    The old graphics driver wasn't really that old, and the problem did not exist before Windows 11, and I still don't understand why Windows Media Player could play the affected videos, but I still want to post this "solution" for the benefit of other who might run into this problem.