Code Along with Cam : Simulated Live Streaming

Posted by: Cameron Church, November 27, 2009

With the release of native live streaming support in Brightcove 4 the question is not if you should take up live streaming but when.

Live streaming offers a video initiative bags of possibilities but true Live Streaming can be costly.   We do work with many partners that can complete this value chain very seamlessly, or for simple projects there's the very easy to use and free Adobe Live Media Encoder that can connect any camera to the servers via a PC.

But then there's the question of trying before buying.   Before investing in establishing what could be a hefty workflow and value chain why not make sure your users would find this of interest?

That's where Simulated Live Streaming can be a great tool.   Either used in a market research / transitional phases or to bring a cost effective Live-like solution to build a real-time viewership, Simulated Live Streaming is relatively simple to do and is available for most versions of Brightcove (Brightcove 499 Express minimum, Pro and higher preferable).

Simulated Live lets you use never before seen VOD content in a way such that all your viewers are watching the same thing at the same time.  Adding in a live chat app like Twitter / Facebook Livestream box and you've got a real time interaction for the community.

To do this you'll need:

  • A Brightcove account
  • Some content in a playlist
  • A PHP server
  • Your Brightcove Media API Read token
  • Some JavaScript knowledge
  • Access to our BEML templating system (Pro Edition and higher)
  • Some spare time

Here is what you need to do.

Read More →

 

Distribution Strategy , Player Publishing & Design Comments (0), Tags:

Video Encoding 101 - Under the hood of the Codec (Part 1)

Posted by: Cameron Church, November 13, 2009
The series so far:
Introduction - http://blog.brightcove.com/global/2009/10/video-encoding-101-the-series.html
The Beginning -http://blog.brightcove.com/global/2009/10/video-encoding-101-from-the-beginning.html
The Problem Number 1 - http://blog.brightcove.com/global/2009/10/video-encoding-101-the-problem-number-1.html

In general a codec has one task.   Take a data feed in a specific encoding (be it analogue or digital) and run it through an algorithm to try and compress the feed in such a way that the message is no lost during storage and decompression.

In fact that's where the word codec comes from : COmpression DECompresion

Implied in between these 2 transformation states is a new Encoding Specification itself for storage - a language to convert to and store the data in.

To think of this in modern terms compare an email to a text message.

The email may read:

Hi Cam
 
Sorry for not getting this to you on Friday, I was waiting for confirmation of PD rights from our legal team
 
So please can you take a look through this overview, it's basically draft 1 so please let us know your feedback 
 

Also there's a chart for questions to ask the developers and risks and issues so please feel free to add to them

Regards

Ivan

If I were then to text this I may come up with:

Hi m8

Soz 4 not getin DIS 2 U on fri, I wz w8N 4 conf of PD rghtz frm our legal team

So pls cn U tAk a L%k Thru DIS OvrVew, itz basically draft 1 so pls lt us knO yor fEdbak

Also ther's a chart 4 :-Qz 2 ask d devLpRz & rskz & isUz so pls fEl frE 2 + 2 dem

Thanks to Transl8it! web service for helping me out here.

So we took a data stream that was 362 characters in length and compressed it to a stream of 282 characters - or we compressed the original by some 22% whilst still maintaining the overall quality to ensure complete transmission of the message contained within the stream.  In this case our brains acted as the CODEC and the Encoding Specification was the English language and its corresponding character set.

Now take this and apply it to video data streams that are 100x as large as text and still try to achieve 22% compression with no loss to the message within the data - enter the video CODEC.

Before getting into the methods deployed by a video CODEC we need to look at the ability to sustain loss of integrity of the data stream whilst still preserving the message quality.  There is a critical threshold around that a medium (text, image, audio, video) can sustain during transitions like compression and decompression spells the difference between the message being understood or not by the receiver. 

Due to the nature of focus for each medium - that's to say how many messages (denoted by their ability to be comprised of substreams) that can be injected per data stream - the threshold rises drastically from Text to Video.  Text has a very low threshold before the message can become indecipherable because it only allows one stream (non substreams) per transmission.  Whereas Video and Audio have much higher thresholds because there are able to use many substreams to make up the overall data stream - an auditory scene is comprised of many different frequencies and a visual scene the same with many different field of view objects each their own substream.   These substreams combine to form the overall data stream and can suffer the loss / corruption of a few before the whole piece falls apart. 

And in fact it's the identification and removal or manipulation of these  substreams that allow modern day codecs like H.264 and MP3 to achieve compression ratios much higher than 25% as we did with the text.

These codecs are called Lossy because by taking into account the higher loss threshold of the medium they will perform much higher manipulation to the individual substreams at the cost of introducing loss via error knowing that as long as they stick within tolerance the message quality won't suffer irrecoverably.

There are indeed Lossless CODECs that swap the balance and ensure quality of the substreams over compression ability.   FLAC for Audio and Lagarith for Video are but two - you can read more here: http://en.wikipedia.org/wiki/List_of_codecs

Looking at my text example above - a Lossless CODEC would be akin to the text messaging there.  Removing spaces and substituting characters that mean the same thing but in a simple format.   A Lossy CODEC would do further work looking at entire sentences and removing whole words and coming up with clever ways to rebuild it during decompression.

In today's online video world we suffer fro the Problem Number 1 and so Lossy CODECs are what we need to make sure we get our data down the limited pipe.  No doubt as internet bandwidth increases globally we'll see a time when Lossless CODECs will come to the forefront and posts like these will go the way of the dodo but we're not there yet and I'm still in a job.  

So how does a video codec like H.264 manipulate the substreams to get a high rate of compression?  It's a process called frame-residue storage. 

Now please note from here on I'm not going to get overly technical.  Partly because this outside the scope of this series and partly because even I struggle to comprehend the real science of the matter!

So high level we need to look at the video data stream in 4D - as a data stream that has a time axis to it.  Each slice of time in an uncompressed video data stream is a 3D image (a Frame) of the scene.   Just like a flip book you use to draw as kids, if progress (flip) along the timeline fast enough (Frames Per Second)  you get seamless movement and in turn video.

Now very simplistically what H.264 does as codec is to look at video as a flip book with all its individual frames and selects what we call Key Frames or I-Frames.   These are full featured frames, as if all substreams pulsed at once to give the complete picture.   These Key Frames are then spaced more or less evenly apart (typically around 1 second).

We now have a heartbeat pulse of 1 second of the video stream - not enough data to give smooth motion considering it takes about 25 Frames per Second for us to perceive it as motion but we can start getting the gist of the overall message across the stuttering data stream.

The next step is then to fill in the gaps.   And what H.264 does is look at the difference, delta, of the current frame in relation to its neighbouring Key Frames.  This difference is referred to as the residue.   Basically what has moved in the video field of view between the last pulse.  By focusing on what has moved we can eliminate what has not moved which turns out to be quite a bit when we talk about very small time slices of video.   This can then be discarded and we have a compressed stream of key frames and change information.

So what gets stored in the H.264 file (and most other lossly video CODECs) are the key frames and the changes in the substreams between them.  This allows for very high compression but the story doesn't end there.   Because other elements can come into place such as bitrates, framesize, subpixel size, P and B frames and much more.

This last list is more a way of tweaking the residue that is detected to further refine how much data can be discarded.

In the next part I'll look at this refinements in more detail.

-- Cameron Church

 

Player Publishing & Design Comments (0), Tags:

Live Broadcast of the Facebook Garage Event

Posted by: Cameron Church, November 11, 2009

I'm heading down to give my 15mins of cents to the London Facebook Garage tonight.

For those not able to make it tonight we're going to do what we did with the Drupal for Marketing event and stream this live over the BC3 platform.

We'll also have the same tie into a Facebook Livestream box and you can embed the stream directly into your FB Profile by clicking the button in-player.

You can see more about the event here : http://www.facebookgarage.co.uk/

Enjoy!

Please note that the stream probably won't come up until 7pm so keep trying to connect.

This event has now closed and the player taken down. Was a great time! Head over to the Facebook Garage website to view post event videos

 

Distribution Strategy , Player Publishing & Design Comments (0), Tags:

Code Along with Cam : Next Gen Embed Video in Facebook News Feed

Posted by: Cameron Church, October 28, 2009

I've been reading a great post by fellow Brightcove Blogger Chris Little over at our Ecosystem blogroll about how Brightcove Players have been whitelisted by Facebook. 

This essentially means that a user can share a video from your player/site and have it appear in their FB Newsfeed for immediate inline playback.

I have need of such an integration to help spread the word of a live event we're looking at doing with Drupal tomorrow.

After digging into the code - I found it had some limitations given the FB's architecture requires the metadata of the video and player to be hosted on a HTML page.   If you're doing contextual publishing then this can be relatively straightfoward.

But I'm more interested in build this out in a BEML component that can be transported to any of my player templates.

To do this I needed 3 things

1. A server side script to create the meta tags on the fly

2. A BEML component to call the FB Sharer URL

3. A BEML Image link added to the player to allow a user to action it

Read More →

 

Custom Component Design , Distribution Strategy , Player Publishing & Design Comments (0), Tags:

Accessiblity is Key - UPDATED!

Posted by: Cameron Church, August 21, 2009

I received a comment on a past post I did in April looking at creating a custom BEML component that allowed a player to be controlled via the keyboard. A big step needed to get towards a universally accessible player.

Chris kindly pointed out that although my component worked in IE it failed miserably in other browsers like Firefox.   So I opened up the code and did some repairs and modifications.  

Below you can see the player and you should be able to control it using the arrow keys:

  • UP - Play/Pause the video
  • DOWN - Stop the video (and send it back to the beginning)
  • LEFT - Seek back 15 seconds
  • Right - Seek forward 15 seconds

Read More →

 

Custom Component Design , Player Publishing & Design Comments (2), Tags:

The Hook and Bucket Publishing Model

Posted by: Cameron Church, August 5, 2009

One of my favourite emerging player publishing models is what I like to call 'The Hook and Bucket'.  This model tends to be of tremendous value for omni-media infotainment publishers like La Vanguardia in Spain and the OMS network in Germany.

Put simply The Hook and Bucket is effectively a way of placing hooks to your content throughout your site (homepage, landing pages, in-situ articles) and capitalises on the user's desire to watch a specific video by reeling them in to a video aggregator / ghetto section of the site to submerse them in an interface where they can gorge themselves fully on your entire back catalogue of content, not just their selected video. 

The overall goal here is to dramatically increase user stickiness which is best denoted by your player to video conversion ratio (how many videos are played per player load/session).   The higher your conversion (over 1.5 is a good target) the better your return on player load cost and the higher your user stickiness and therefore available ad inventory.  Very important metrics when measuring the success of your video business.

In the world of omni media delivery, where more often than not you  find fiercer competition between the actual media on a specific page then you do between competing web properties, the Hook and Bucket model really comes in its own by bringing low cost, highly effective access to your video catalogue. 

By deploying 'Hooks' across the site, you advertise your content (either contextually or opportunistically), you identify which users are your consumers by their direct interaction with your hooks and reel them in when they bite amplifying the return by not only giving them what they want but also guessing what they may also want to watch all in the same transaction (throwing them into your bucket). 

Not only do you in turn amplify your video consumer's consumption you also dial down the cost of fishing for non-video users.  Consider a homepage where 1 out of 10 visitors can be classified as a 'video user' (this is a user who's primary way of consuming information is via the video medium).   If you place a player on this page 9 out of every 10 loads will not result in a video play back - that's 90% of your player loads that you're not getting a return on.   Put more simply that is 90% of your page loads that are more bloated in size and cost then they need to be.

So to achieve this saving on your site consider placing some 'hooks' where once your player sat.  Show the video still and some metadata retrieved via the BC3 Media API - like they do here at Augsburger Allgemeine.    This is a major factor smaller in size and cost then loading the player but still gives the user what they need to make the decision to consume or not to consume while not punishing the business or the non-video users.

Once the user 'opts-in' to your video offering then you can be as aggressive as you like.   You can swap out the hook with a player in-page or take them through to a central site where you have more opportunity to show content and ad placements.  It's up to you how far you go but rest assured that when a user engages anything with a click they are expecting something to happen.   How long that takes to happen is less important now that the user has the control - the end justify the means - so taking them through a follow on page (issuing a page-turn) is not the cardinal sin it is in other aspects of web design.  Just make sure you get them to that follow-on within 1 degree of the click.   Any intermediary steps will undoubtedly show a large drop off (i.e. don't go an place a display ad between the hook and bucket).

Although this model works incredibly well for omni-media properties, it is also effective for sites with high volume homepages that need to get the traffic back into a video bucket on the sitemap. 

Go on and give it a try

-- Cameron Church

 

Player Publishing & Design Comments (0), Tags: