Search code examples
c#wpfmedia-playermediaelementvideo-codecs

MediaPlayer - Can 'MediaElement' be improved to support more media formats and encodings? Codecs support


MediaPlayer - Can 'MediaElement' be improved to support more media formats and encodings?

Codecs support.

Hello all.

I am building a media player in c# and WPF. All the examples that I find, more or less say the same thing, "place a 'mediaElement' and the basic player buttons and there you go!"

I thought that the mediaElement is essentially the windows media player, but I already found cases where videos play, but show a black screen, while the audio track plays normally, and others where the scrubbing on the timeline takes a lot of time. Also I noticed that when I load a video in this type of player, K-lite codecs doesn't seem to load on the bottom right part of the windows taskbar like they usually do when I use VLC player or Media Player Classic for example.

I 've already found another topic stating that: "The MediaElement is a control that's able to play only some file types. It's based on media player of windows but only on its core encoders. Its basically a bare-bones media player"

Do the issues I am having with the video playback have to do with limited codec support? Is it enough that I have K-lite codecs installed or is there something else that I am missing?

Lastly, in the case that this is as good as mediaElement gets, what alternatives are there? I 've seen people open VLC through their players, but I would like to know what other alternatives are available as well before I dive into that. I ve seen that Microsoft now has "Player Framework" available for Windows 8 for example, but is it only for windows 8?

Thank you all in advance!


Solution

  • Ok so I am happy to announce that I was wrong on a couple of observations and that there is a solution to improve the support for popular media formats, such as mp4, in windows media player and therefore in medialement!!!

    So I was wrong to say that the media element is not really Windows media Player but rather a "bare-bones media player". It is indeed windows media player and it just needs the right set of codecs to be able to play more formats.

    I already had K Lite codecs installed and I added this set of codecs http://www.majorgeeks.com/files/details/media_player_codec_pack.html and now my windows media player doesnt lag anymore when playing mp4 files. Just follow the suggestion of the installer and restart your pc BEFORE starting the installation process. Also... it attempts to trick you with dialogs to install secondary software so BEWARE!!

    Once Installed, just remember to experiment with the "preferred acceleration" parameter in the application's video settings, to see what goes better according to your hardware. I have set it to - CUVID.

    I also installed this set of codecs to support avi format http://www.free-codecs.com/Combined_Community_Codec_Pack_download.htm

    Hope this helps :)