Streaming video library for C# - c#

I'm looking at options for adding streaming video to a social web site written in ASP.NET/C#. I have a great deal of experience with Flash too, so I'm comfortable using FLV players, but I'd definitely go Silverlight if the right library is available.
The library would need to be able to encode user uploaded video in a web format.
I imagine playback will be Flash or Silverlight based.
It would need to create thumbnails of the video.
It would need to have server software for streaming the video or have some 3rd party way of doing so.
I don't mind paying a licensing fee for the software, so it does not have to be open source or free.
The license must allow use on a commercial web site.
The closest thing I have found is MediaSoft's offering. But I never heard of this company before starting my search and don't know anyone using their software. They seem to be using FFMPEG to perform encoding, which I heard can spawn legal issues for commercial web sites. Though I'm not very familiar with the licensing of FFMPEG myself so please correct me if I heard wrong.
Has anyone used MediaSoft? Any other video libraries that you have used that worked well? Did you just end up writing your own video encoding and serving library?

Not sure about Silverlight, but Flash will render both h.264 and FLV videos. FFMPEG can convert into both via liblame for FLV and x264 for h.264. It can also generate thumbnails.
It and the corresponding modules are licensed under the LGPL/GPL which means you can use FFMPEG to generate videos/thumbnails without restriction as long as you have the rights to the original movies that you're transcoding. The GPL/LGPL license restrictions only apply to the FFMPEG code/binaries which won't matter until you decide to distribute those binaries to other people.

In addition to the above answer, you can look at red5 as a streaming solution
http://osflash.org/red5

Related

How to convert video files to H.264 in C#

I've searched without any luck about how this can be done in C#. What i'm trying to archieve is a program that accepts video files and converts them to H.264. Here is an example of a page where you can do this interactively:
http://www.ofoct.com/video-converter/convert-to-h-264-video.html
Question:
How can I in .NET create a program that can do something similar to whats being done from that homepage I shared? Any help or input is highly appreciated, thanks!
EDIT:
The reason i want to do this is because it seems like videos play in both iOS and Android devices when this is done, perhapps there is another way to make sure videos can play in both iOS and Android?
EDIT again:
Lets say i film a Video on a phone Android/iOS, now I'm using a ASP.NET web api that I'd like to convert theese movies to H.264 before storing in Azure, Is this possible? If so, any pointers on how?
There is a wrapper available http://www.ffmpeg-csharp.com/
The main point is that no one is going to write an encoder due to how slow it would be in .NET
Encoding/decoding are provided by the OS, through Direct Show (in the past) or Microsoft Media Foundation. For example, the Microsoft Media Foundation already contains a [H.264 Video Encoder](H.264 Video Encoder).
The SDK is appropriate for C++ and Microsoft hasn't released a wrapper. There are wrapper projects available though, eg. MF.Net, DirectShow.NET, WindowsMedia.NET although it doesn't have any activity since 2012.
There are also similar questions in StackOverflow, that propose other options, like using Microsoft's Encoder, although H.264 support is available only in the Pro version
The only plausable way would be to call out to an encoding application such as ffmpeg.
I'm not sure that this what you need but you can download a nuget called
NR.VideoConverter :> then you can write this code to convert the type of video
like from mp4 to mvo or anything I'm not sure what is h264 but I did find it when I wanted to change my videos so it could help y
var converter = new NReco.VideoConverter.FFMpegConverter();
converter.ConvertMedia(FilePath, FilePath, NReco.VideoConverter.Format.h264);

Split and Merge MP4 video

I have a desktop application (mfc) in which now I have to implement split and merge of MP4 videos. I have searched a lot and found almost nothing online. Please help me with some hints on how to proceed and what to use. Splitting and merging should be done on timeline basis and not based on size. Code is in VC++
Can I achieve this with Windows Video Encoder? If yes, how to know about the exposed methods in WME?
DirectShow (now part of Windows SDK) provides editing services (EDS) but I would suggest ffmpeg (http://ffmpeg.zeranoe.com/builds/) as a better choice since it would support wider range of formats (e.g. H.264 - http://msdn.microsoft.com/en-us/library/windows/desktop/dd390353(v=vs.85).aspx).

WinRt C# Audio Library

I am looking to develop an app in C# WinRt, but was wondering what libraries are available for playback and for complicated manipulation. I am looking for a free library that allows for an extensive list of audio formats to be played (for example mp3, wma, wav, ogg, etc.) and also to be analyzed. Thats pretty much the basic functionality I would need. But if I could get picky, a library that can convert audio files between the formats would be handy. Doing a google search I came across the Naudio library, but it was not so greatly compatible with WinRt.Thanks for any tips or advice on this.
The current alpha build of NAudio 1.7 (available via NuGet) does contain a Windows RT assembly and the source code includes a simple demo of playback and recording as a Windows Store app. Since it uses Media Foundation, you'll be able to play most of the file types you suggested (although ogg won't be supported out of the box), and you can construct your audio pipeline to access the audio as floating point samples for analysis.
Things that aren't currently supported are using the Media Foundation encoders to encode, and the various reader/writer classes need to be re-written to use the WinRT asynchronous streams and File I/O APIs instead of the regular .NET ones. Hopefully these features will be added to the library soon.

Filling and playing audio buffer in C# (.NET 4.0)

Where I can found something suitable (library) for .NET 4.0 (C#) capable for following features:
+ Reading mp3/wav samples with direct access to samplebuffer of loaded samples? (for example I want to load mp3 sample and programatically add reverb, chorus, and more custom effects implemented by me)
+ Playing directly audio buffers (arrays of floats)
+ Saving audio buffers to disk as mp3 or wav
Some time ago i found ASIO for .NET and this only works with .NET 3.5, is there something for .NET 4.0? Thank's a lot for your help.
ASIO for .NET won't help you in the cracking of mp3 or wav files. The most modern API in Windows for doing this is Microsoft Media Foundation. These are all COM APIs though, so you're either going to be doing (perhaps painful) COM interop from .NET or (easier) writing a C++/CLI wrapper. If you go the C++/CLI wrapper, you will need to be aware of performance issues (especially with how critical latency is to audio programming).
I'm skeptical that you will get the audio latency you need when programming in .NET. A good audio driver (like ASIO) will get you down to <3ms of latency. So if you are targetting "live audio", you will need to be generating audio buffers quicker than that (unless you are fine with longer latencies). To put it this way, the "time intervals" that the Windows APIs deal with are in 100 nanosecond intervals :).
You likely don't want to have to crack the files yourself. It becomes tedious as it's not only just mp3 and wav. You also have to be aware of how the wav is formatted as well (to account for different bit rates, number of channels, etc.). Using Media Foundation, it will automatically load the write decoder for you, you just give it the file path. Check out this tutorial that shows opening an existing WAV file and writing a new WAV file. I just recently went down this path for a drum sequencer I'm creating, and it's not very painful at all (if you're familiar with COM programming).
The central component in MF that makes this possible is the MFSourceReader.
If you're wanting to play the audio after you modify it, you can look at the sample "RenderExclusiveEventDriven" in the Windows SDK (under "audio" I believe). That's what I did for the drum sequencer as well. Latency won't be an issue and you're just dealing with byte arrays, so manipulating the raw data becomes very easy. Though at this point, you can probably stick with the ASIO .NET route and just use that to play the raw data you get from MFSourceReader.
I don't think there are .NET wrappers around Media Foundation yet (though if somebody has done that work already, feel free to post here as it would be awesome to know).

ASP.NET - how to read attributes (length, resolution, codec) of video files

I'm working on an ASP.NET app that allows users to upload video files. After the user uploads, I need to determine some of the attributes of the media - namely it's duration/length, resolution, and codec (if possible).
What's the simplest way to approach this? Should I use the WMP SDK - this seems to involve actually instantiating the media player on the server. Is there anything in the framework to do this, or do I need to rely on an external library?
I'm not concerned about displaying or streaming the video back to the user.
There is nothing in the framework, you will need some sort of library. The best I've seen (but it has been a year or so since I've looked) is taglib-sharp:
http://developer.novell.com/wiki/index.php/TagLib_Sharp
The site seems to be down right now, but I see that it's been ported to fink (for OSX) only a couple of months ago, so I assume that is temporary.
oops, just saw that you're not the first to ask a question along these lines and I'm not the first to suggest taglib-sharp:
View/edit ID3 data for MP3 files
(note: it supports audio and video files).
hth

Categories

Resources