First, some background:
I'm developing a Silverlight 3 application and want to add support for live streaming (webcam + microphone as input). Unfortunately, Silverlight cannot access a webcam or a microphone itself, so I need to create a stand-alone application for establishing the media stream. I guess Silverlight would work best with Microsoft technology, so I want to use the ASF format with WMV/WMA encoding.
After doing some research, here is what I think I could do:
It seems it is possible to capture both webcam and microphone input with DirectShow and then combine it into one "stream".
To encode the stream, I probably need to pass it to the Windows Media Format SDK libraries (MSDN documentation describes how to use DirectShow with WM ASF Writer).
I think it should be then possible to use something like "Network Sink" to broadcast the ASF stream (without writing it to the HDD).
I guess that connecting lots of clients to the stream would be quite heavy on bandwidth, so I should probably send the stream to a server and broadcast it from there. I just don't know if it's possible to use a combination of ASF Reader/Writer to "pass" the stream through the server. I also don't know if I could use multicasting to achieve a similar result.
I'm planning to use C#, although this probably doesn't make much difference as I will have to use some wrappers for C++ libraries anyway (like DirectShow.Net or SlimDX).
Unfortunately, I have virtually no experience with handling media streams. So my first question is, is it even possible to do streaming in the way I described?
And if it IS possible, is it a sensible way or should I consider using some different libraries/frameworks?
While using DShow and/or WMF SDK will give you the greatest amount of flexibility, if you only goal is to stream video/audio to Silverlight you can use something like Windows Media Encoder 9 or you can use the new Expression Encoder. Both support streaming live webcam and mic to a Windows Media Server publishing point or it can host the stream on a local port. Both have an SDK that is available via .NET (WME uses COM interop and Encoder has a native .NET API) This stream is compatible with Silverlight and Windows Media Player.
Related
1) I'm researching the technology I can use for a browser applicaton that streams video. It should capture video from webcam and push it to service where it's stored and can be watched later. One of the (possible?) options is Azure Media Services. But after a quick look at the documentation it seems that it's not possible to use pure modern browser without plugins. Am I correct? If no, can you please give some links to github projects or an example of code to look at?
2) Another possible technology option is Amazon Kinesis Video Streams (looks lite the best solution I came up with so far), but maybe you can recommend some other cloud services?
Thanks!
Currently the short answer is no.
WebRTC is the right solution for broadcasting from a browser. That's the only protocol for live streaming that will be "somewhat" widely supported in modern browsers like latest Chrome.
AMS does not yet support receiving WebRTC. We only support RTMP and Smooth ingest right now (Chunked MP4)
As far as I'm aware, Kinesis also expects you to send chunked MKV (like chunked MP4 but a less popular container format), which would need a browser plugin or javascript library to support. I don't see any Producer library from them in Javascript.
WebRTC is your answer - but to catch that in the cloud, you may need to look at other solutions that run in an Azure Container. There are a bunch of 3rd party solutions out there for WebRTC.
Which web player I can use to get live stream from Windows Media Services? Is there are any crossplatform solutions (Windows, iPad/iPhone)? Should I make live convertation to flv or any other trick?
You could try using h264/aac video format for targeting iOS systems as explained in this article: Apple HTTP Live Streaming with IIS Media Services (this is kind of your only choice if you want to support iphone/ipad etc). This format will also be valid for Windows Phone 7 devices.
For the rest of Windows-based systems you could use Silverlight as streaming client, although you will need to use a different format based on Windows Media Video.
I realize that the official supported streaming protocol for the iPhone is HTTP streaming . This is great, but many appliances implement the RTSP protocol to stream video. I have looked around for quite some time looking for RTSP libraries in objective c and have not found them. Does anyone know of such libaries?
If not, does anyone know of some demo/code examples from people who have tried to get this to work. Since Apple supports h264 in hardware, I'm assuming it is possible to get low level, implement the stream, then construct the video packet and pass it along as if you have streamed using HTTP streaming. Anyone advice on how this might be done is appreciated.
Check out live555. This will handle all the RTSP handshaking and deliver data (in your case, h264) to you application for further processing/decoding. It is a C/C++ library, and hence can run on iOS.
Your options for integration with a cocoa app are:
1) Run live555 on its own thread using the event loop mechanism given as part of the library (note then that all operations directly related to live555 need to be run on this thread as live555 itself is not designed to be thread-safe).
2) Provide a cocoa implementation of "TaskScheduler", in which you use the cocoa library for async network callbacks, timers etc.
The above points will make more sense to you after reviewing the live555 doco.
I'm interested if there any web server application that allows you to stream HD quality live chat without software application installed on streaming client PC. Flash Media Server allows HD streaming but it must be encoded prior to that which makes impossible to work with as any streaming client will need to install and handle their encoding software.
Thanks
I'm not sure what you mean about the installation of software. Naturally you will need to encode your video before it can be streamed, and the client needs some piece of software to play it. That can be software that is already present of course, like Flash or Silverlight.
You might want to look at IIS Smooth Streaming. It should be able to handle HD quality streaming very well (there's a demo on the site).
Are there any open source projects in any language and other recourses that I need to look at in order to implement flv to 3gp conversion? It's better to be streaming, I mean return first portion of 3gp before last portion of flv is downloaded.
Or are there any similar services already implemented - my goal is to have something like
http://converter.org?source=sourceUrl.flv&targetFormat=3gp that I can feed to 3gp player, in my case - on iPhone, and not wait until server downloads entire flv.
UPDATE: ffmpeg does really good job here, just
ffmpeg -i input.flv output.mp4
and that's it. But output file can be used only after conversion is done. Streaming is still an open question. There is ffserver that does some sort of streaming but I could not make it work.
I'm not sure if it is possible, but if there's one thing that should do it.
it's http://www.ffmpeg.org/ ..
it can convert anything to anything on an online platform. don't know if it supports streaming but definitely the best solution for online video conversion
Well this one might be a little late to the party but to stream video online you'll need a Media Streaming Server to deliver the video over a specific streaming protocol (i.e. HTTP,HTTPS,RTSP,RTMP). I've also been looking for such a "real-time" transcoding service but the closest thing I've found so far is the Video CDN's which are quite pricy, and also limited in formats/support. What would be really nice is for one of the media servers to add in a real-time transcoding feature. At the time of this writing no such service exists that I know of.
The top 10 most popular options for Media Streaming Servers are (IMHO):
VideoLAN - VLC Media Player (good for quick tests and proof-of-concept)
Kaltura - Open Source video platform
Real Media - Helix Universal Streaming Server (may be best bet for 3GP over RTSP)
Apple - Darwin Streaming Server / Quicktime (Live) Broadcaster (best for iPhone/iPad)
Red5 - Open Source Flash Streaming Server
Adobe - Flash Streaming Server
Wowza - Media Server
FluMotion - Open Source Multimedia Streaming
Microsoft - Windows Media Server (AVI, WMV, Silverlight & other formats)
FreeCast - An OGG Theoris (video) and OGG (audio) streaming/conversion platform
As you can see there are many options for streaming and you can start as simply as hosting the video on the same server and delivering to Desktop computer browsers via HTTP (the easiest way to get started with this is trial & error). Each offers different features in terms of protocols supported and transcoding, but none are truly real-time as you mention where you could feed in a source video and get an output video in the format of you choosing (i.e. 3GP). My personal choice would be to start with VLC for small-scale tests on a home network, since it is basically a swiss-army knife for desktop video that can also act as a server for any of the formats it can playback (though it may be more complicated to get this to stream to the public internet and even harder to go all the way to a single device on a private carrier network, some info is available from people who've tried):
http://forum.videolan.org/viewtopic.php?f=4&t=45782
Some basic transcoding instructions to go to MP4 (required for iPhone/iPad/iPods):
http://wiki.videolan.org/MPEG-4
I also agree about FFMPEG being by far the best solution for video conversion, as it also supports 3GP and you can at least start playing around with conversion on your own test server, you might want to try the following PHP Classes project:
http://www.phpclasses.org/package/5977-PHP-Manipulate-video-files-using-the-ffmpeg-program.html
In my experience that was an excellent contribution to speed web interaction with FFMPEG's mostly command-line and sometimes clunky interface. Who knows, maybe you'll build the first real-time transcoding service, I'd be the first to signup as a customer and/or as a contributor to help you on that!