Using Silverlight and the cloud for online video
Mark Newton finds that Silverlight isn't dead in the water when it comes to online video
Any discussion about developing with Microsoft's Silverlight always arrives at the question of why?
Considering HTML5 is just around the corner, shouldn’t we all just abandon Silverlight – and Flash, too, for that matter – to start building HTML5 apps?
Well, the current development tools for HTML5 aren’t very good in my opinion, and one big limitation of HTML5 when using it to display videos is that there currently isn’t an agreement for copyright protection of video content, whereas Silverlight, Flash and Apple already have this covered. It makes sense that providers of video content would be happier having their content shown within one of those systems rather than the current HTML5.
Obviously, this problem will eventually be resolved, but currently there’s no sign of a solution in the W3C specification.
HTML the tech of choice?
Talking to people such as Mark Quirk at Microsoft UK, I find their view is that HTML5 is the technology of choice for any public-facing web application, whereas Silverlight with its greater flexibility and ease of programming is more suited to application development where the user’s platform is known, or where it’s considered okay to restrict the application to run only on Windows or OS X devices.
Silverlight, with its greater flexibility and ease of programming, is more suited to application development where the user’s platform is known
I’ve seen some great Silverlight applications already, although it currently would appear best suited to data visualisation and video apps, but I’m sure that once limitations on secure access to the host system are lifted, we should see a greater variety appearing.
While adding basic video content to a Silverlight application is relatively easy, people often want to be able to do live streaming. Live video streaming is something that in the past has been sufficiently difficult that you might have left it to a dedicated company, which would have ruled it out of the question for small-budget events.
Microsoft has a streaming technology called Smooth Streaming, which differs from ordinary video streaming in being able to deal with poor network connections by seamlessly reducing and increasing video quality, so as to avoid those annoying pauses in video playback while the playback device buffers more content.
The BBC iPlayer that we’re all familiar with uses similar technology to enable it to deliver video over poor internet connections. Microsoft’s solution is extremely easy to implement and will not only stream video to Silverlight clients, but now with the latest release will stream to iPhones and iPads using Apple’s own video playback technology built into iOS, meaning your content will be available through a wider range of devices than before.
The server-side parts of the Smooth Streaming system have to run on a Windows 2008 server, with IIS7, but the Media services are free. Setup is relatively simple and mostly wizard based, and once done there’s a quick test screen to check that all the relevant services are installed and running.
Next you need to produce your Smooth Streaming video stream. To do this you need Expressions Encoder 4 Pro, which at £69 is reasonable value; there are other encoders out there that will work just as well.
Expressions Encoder will do more than just Smooth Streaming encoding; it can be used for all sorts of video creation. You should run this product on a machine near to the video source, and I fired up Encoder on my Windows 7 laptop and pointed the video input to the webcam. I then set the output options to streaming and entered a publishing point that’s basically a URL on the server I previously set up – and that’s it.