ChrisCreateBoss asked:
…What else can I use to play several video and audio formats? Formats such as mkv, mpeg, mov, avi, m2ts; wav, mp3. Oh and that is because my project is about a quick file preview app just like on mac os x computers, you select a file, press space, and a nice window pops up showing the selected file.
Oh, I see now…
You see, Microsoft media software is (sigh…), despite of pretending to be fancy and some of their good quality media containers and codecs, was always notoriously bad in supporting all those formats and streams. First thing to understand: there are no just formats. There are
media containers and compression algorithms for different kinds of streams supported by different codecs, and those containers can host some subset of those streams (Matroska is perhaps the only one supporting nearly everything, sometimes called "king of containers.) Please see:
http://en.wikipedia.org/wiki/Digital_container_format,
http://en.wikipedia.org/wiki/Codec,
http://en.wikipedia.org/wiki/List_of_codecs,
http://en.wikipedia.org/wiki/List_of_codecs#Video_compression_formats.
Can you see how many combination you might have? And video and audio streams are not all, there are others (captions, and so on).
Now, Microsoft media components… no, I don't even want to discuss them. With your appetites for the supported containers… Microsoft is just not serious. I even removed Windows Media Player completely from some computers. Yes, it can work if you highly extend the set of supported codecs and formats (I would highly recommend to have freeware K-Lite Codec Pack and keep the latest versions,
http://en.wikipedia.org/wiki/K-Lite_Codec_Pack), but even then not everything will work, by far. To improve your playing experience in just this approach I would advise, for example, open-source Windows Player Classic Home Cinema:
http://mpc-hc.sourceforge.net,
http://sourceforge.net/projects/mpc-hc,
http://mpc-hc.sourceforge.net/downloads.
Besides, it is million times more professional and convenient for serious users, not just consumers of media, but those how produce, support or remaster things.
But as to the components, I don't know any which allows to embed this product immediately. Instead, I can only recommend to embed VLC, also very universal player. It's concept is different: it does not depend on codecs, only uses FFMpeg/libav, the library which include all support directly. Please see:
http://en.wikipedia.org/wiki/VideoLAN,
http://www.videolan.org/,
also highly recommended:
http://en.wikipedia.org/wiki/FFmpeg,
http://ffmpeg.org/,
http://en.wikipedia.org/wiki/Libavcodec,
http://libav.org/.
For VLC, you can find components for .NET and
System.Windows.Forms
:
http://sourceforge.net/projects/libvlcnet,
https://wiki.videolan.org/C_Sharp,
https://github.com/ZeBobo5/Vlc.DotNet[
^].
Note that VLC (VideoLAN) is not really a player. It is mostly used as a player, but it can also be used for many other things, such as transcoding (but I would rather recommend FFMpeg/libav, see above), and, notably, for streaming.
See also my past answers:
need help in getting the streaming video from an other computer in C#,
Streaming music files in vb.net without WMP.
—SA