open source Codec library to make media player in c#.net - c#

Is their any open source codec library?
That i can use to make my media player?
i have to make a media player (using c#.net) that would support mp3,mp4, flv and xvid files,

VLC (which in itself is I think a pretty good media player) offers a .Net interface in order to embed it in applications, you can check the VideoLAN Wiki for details (I never used it, but as far as I can see on forums, it works).

Related

Open .m3u8 video streaming on Unity 3d

I have a problem regarding unity 3d video stream, I want to open I can open mp4 videos but with the video player I can't open m3u8 video streams, is there a way to open this kind of videos.Is there any way to play it via u3dxt plugin
EasyMovieTexture is able to play m3u8 format
The AVPro Video plugin for Unity has really good adaptive video file support (both DASH and HLS/m3u8) and supports many platforms. Much easier to use compared to EasyMovieTexture as well.
Using AVPro Video and the Vimeo Unity plugin together is also really helpful if you need to host and transcode videos to the m3u8 format.

Playing media from byte stream in .net

I am developing application that receives media content(.mp3/.mp4/.avi) in form of bytes.
However, as WPF doesn't support playing media from stream, So I started with WMP.dll.
I am creating class library that receives media in form of bytes and media format and play media accordingly.
Referring Creating the WMP Programmatically, however, I didn't find method to pass bytes stream.
So My question is how do I play media from bytes using wmp.dll?
Edit: I am using WMP.dll using COM located at C:\WINDOWS\system32\wmp.dll
I've been through this process a long time ago ...
Basically I would advise you NOT to go down the WMP route at all. It's heavy, cumbersome and not very nice to work with. I encountered lots of issues along the way basically. Least of all it being feature rich (which it isn't).
The best solution I found and the one I'm still using now is a library called BASS from Un4SeenDevelopments.
This library is tiny < 100k and basically it's awesome. Never had a problem with it and it has it's own .NET wrapper that is a free download from the site.
The support is amazing and the compatibility via a massive selection of plugins and additional libraries is staggering.
Highly recommended for what you want to do.
"BASS is an audio library for use in software on several platforms. Its purpose is to provide developers with powerful and efficient sample, stream (MP3, MP2, MP1, OGG, WAV, AIFF, custom generated, and more via OS codecs and add-ons), MOD music (XM, IT, S3M, MOD, MTM, UMX), MO3 music (MP3/OGG compressed MODs), and recording functions. All in a compact DLL that won't bloat your distribution."

Video Streaming using C#

I'm starting a new project to play the video on my LAN, actually if I enter an IP on my browser I got a m3u file with the following info:
http://192.168.1.101:31344
So, if I open that file Im able to see the video using VLC Media Player. However in the school, I proposed to implement my own video player. I know there are some options, like DirectX, Silverlight, etc.. so I'm looking for recommendations on which technology use so any advice is welcome.
I don't have any restriction, the only one is to use C# on VS 2010 Professional.
Thanks,
m0dest0.
Well, I've used Silverlight with an embedded MediaElement and just set the source to the address of the video file. It was simple to use. I wouldn't call it "writing your own video player", but it should do.
There's plenty of examples in the link I gave you.

How can I play any audio file(e.g. mp3,wav) in C#?

I have a question regarding with audio files.My question is:How can I play any audio file(e.g. mp3,wav) in C#? So if I press a button,I want to play to an audio file.
How can I do that? Can you tell me how it is done with a sample code?Lastly,I have used .Net Framework 4.0.
for that first you need to load wmp.dll from your system32 folder
Then you need to add COM component
Now you can do other things(creating player)
I have a tiny project (cutted NAudio version, only playback is left and only MP3 and WAV is supported) to play MP3 and WAV files. Do you still need it? I can upload it if you need to.
A full code example on how to play waves in c# forms apps can be found here
http://msdn.microsoft.com/en-us/library/ms173187%28v=VS.100%29.aspx
You can also play wave files using C# and the XNA Framework. But that may not serve your purpose, since that is primarily for games development.

Is it possible to transcode audio in C# using DirectSound?

I want to transcode a lot of audio from its source format to PCM without resampling or messing with the sample size. I figure if Windows Media Player can play the file and it doesn't use a legacy ACM codecs it must be using DirectSound to do so (this is on Windows XP and Windows Server 2k3). So is it possible to access DirectSound from C# and do so? I've tried searching the web but all the examples have been about playback which I have no interest in doing.
DirectSound is an audio playback API, you mean DirectShow. Windows Media player does use DirectShow to play audio files. In theory, all you need to do is build the same playback graph that media player uses, but replace the audio driver on the end with a .WAV writer filter.
This is somewhat easier to do in C++ code, since the DirectShow graph object is really designed to be called from C++, but with a good set of interop definitions, you can do this in C#.
There's http://directshownet.sourceforge.net/ for serious hacking with DirectShow in .NET, but that's probably overkill for your problem.
I would suggest getting a copy of GraphEdit if you don't already have one. You can use it to "prototype" direct show graphs interactively. drop a file into graphedit. then delete the filter on the end and replace it with a file writer filter.
One problem you will have is that there is no .WAV file writer filter in the default set of o DirectShow filters, you will have to find or write one.
If you just want to get the files converted, and could care less about learning how to write code using DirectShow, I would suggest that you just get a copy of Sound Forge (possibly even a demo version). It has a scripting language (C#,vb) that can be used to easily batch process most audio file formats.
Conversion to WAV can be done from the Windows command line using SoX (Sound eXchange, http://sox.sourceforge.net/). You could write a batch file or a C# application that calls SoX with the proper attributes. I'm not sure how WinAMP's feature works specifically, but it has a file writer output option built in as well. You can stream the entire playlist to wave files.
Have a look at this article on CodeProject about audio conversion here and here.

Categories