Stability issues with WPF MediaElement (MediaFailed, Slow Motion Video), are there any workarounds?

I have a couple of problems with it:

  • cannot play and continue to work until the application is restarted.
  • the sound plays normally, but the video is in slow motion and will not play normally until the application restarts.
  • There is no way to reinitialize, except restarting the application. (what i know)
  • There is no real solid way to know if a video is rendering. I can watch the position to check that she is playing, but she does not guarantee that the video is output.

I run two instances of the extended version of MediaElement in my WPF application, which depends on their stability. After many tests, I came to the conclusion that this is the most high-performance video player, above MediaKit and vlcdotnet, due to the use of exclusively GPU for decoding. I encoded the video in WVC1 (Windows Media Video AP @ l3 VC-1) for 1080p quality and relatively small file sizes. In the end, after several plays, the videos will not play, after which the MediaFailed event will be triggered and subsequently completely stop working until the application is restarted.

I understand that when this fails, this is the main failure in the basic Windows Media Player OCX control, and it cannot be fixed in any way other than a complete restart of the application. Has anyone found any reliable workarounds to solve these problems? Mom, a word on the Microsoft forums ...

+6
source share
1 answer

Answering my own question to help future SO'ers who might run into these problems. The problem is WPF, it is not planned to be improved. For a more reliable, low-cost solution, try WPFMediaKit .

+2
source

Source: https://habr.com/ru/post/915093/


All Articles