Search code examples
c#.netcomwindowmedia-player

Is there an Event with the Windows Media Player COM-Component that gets fired when a new image is shown?


I have a project with a AxWindowsMediaPlayer object. And it try to find an event that gets fired every time a new frame is shown in a video. For example if a video has 60 Frames / second it should fire 60 times a second, but if a video has for example only 25 it only should fire 25 times.


Solution

  • Windows Media Player high level COM interface provides you with methods to control the player UI, playback state, playlists. The controlling application is not supposed to interfere in such small things like per-frame events.

    Windows Media Player uses either Media Foundation or DirectShow API on its backyard to build playback pipelines and stream media, and even these APIs are not supposed to deliver per-frame events or notifications to Windows Media Player itself.

    By design playback pipelines are queuing up data for presentation and presentation itself is a time sensitive subsystems, blocking events to C# code would have unacceptable overhead and asynchronous notifications would be insufficiently accurate and not quite useful (for example, you could just poll using timer instead).