Sunday, August 25, 2013

Anatomy of a Singleton

So why would I want to cover such a fundamental concept as how to create a singleton?  Well there are two reasons.  First, it is actually surprising how few developers I come across that know how to make an effective singleton object - so perhaps the concept, though fundamental, is not nearly so basic.  Second, as with many patterns in programming, there are many ways to accomplish the same task, and that can be fun to examine.  Let's step through the ways we can implement a singleton in Objective-C, some of which are applicable in concept to other languages too.

Lots of ways to skin a cat...er...singleton

Tuesday, August 13, 2013

HTTP Live Streaming - Videos On Demand (HLS - VOD)

HTTP Live Stream also known as HLS is cool.  Really cool.  The concept if fairly simple, people have numerous different network speeds and those speeds can change over time as well - so how do we deliver the user the best quality streaming media in the fastest way possible?  The short answer is take your media and encode it to numerous different outputs that range in bitrate so that you can dynamically select which source to be shown at any given time.    Now the specification for the protocol can be daunting and the vast configuration possibilities can be overwhelming, but truly, the simplicity of creating a video on demand that supports HLS is quite easy - and all platforms support it.  In this article I will go step by step through the process of how to take a source video and then output it into the numerous bitrate videos we wish to use and I will then convert those videos into HLS compliant streams and stitch them together.  I'll finish with a link to my github repo that has an open source Mac OS X project for converting 1 source video into a variable bitrate HLS stream, which can easily be hosted (I use an S3 bucket) and immediately start providing dynamic video content to your users.  See Apple's documentation of the technology for more thorough explanation and detail of how to use the protocol.

Anatomy of an HTTP Live Stream