This post is also available in: Russian
In recent years, online video streaming has been gaining substantial popularity. It has many applications, starting with the already well-known online TV, sports events, conferences and seminars, video on demand and computer gaming tournaments. Also, it is used for online negotiation and collaboration. Internet bandwidth growth has made all of these services possible. Many high-end products are based on online streaming. In this article, we will discuss the basic challenges you should face while designing your online video streaming infrastructure.
Video Source
When designing a live streaming system, having an idea of your expected video source is of utmost importance. Those could be antenna signal, Web video stream (RTSP for example). As an alternative, the users may add their own video streams. You should also figure out the format and the number of video streams.
Based on that, you should select encoders and transcoders. If the signal is received from an antenna, usually you will need encoders with SDI inputs, selected based on the number of signals. Sometimes, SDI video capture card and Flash Media Live Encoder are quite sufficient. To select the hardware, you have to know your video formats and the number of video streams. Also, you should define requirements for advanced hardware features, i.e. dynamic bit rate coding or simultaneous publication of streams on multiple servers, etc.
If video streams will be published by users, you should develop a custom Flash publisher application or a FMLE setup user guide (containing an XML configuration file for simplicity). In this case, it is important to consider video streams access authorization and to provide additional capacity for receiving video streams.
So, here are the first questions for you to answer:
- How is the video signal reaching you?
- How do you prepare it for distribution among users?
- What equipment you need to process the signal?
Pool of Origin / Edge Flash Media Servers
Let’s now discuss a geographically dispersed Flash Media Server system for video stream delivery. Among numerous Adobe resources, you can find detailed instructions on how to develop similar configurations based on Flash Media Server.
When designing the system, you should have a deep insight into video stream delivery to end users. Web access issues strongly affect online streaming projects. Therefore, efficiency of video delivery to the end user is of particular importance. Here are the possible options for solving the problem:
- Build a geographically dispersed cluster consisting of Flash Media Server and Edge Servers located close to the main consumption areas
- Use a CDN provider, already having a geographically dispersed cluster which is, most likely, designed for significantly higher loads than your project is going to generate (at least initially, until your popularity exceeds Facebook)
- Use innovative P2P technology of content delivery.
Building your own cluster requires high startup investments, so high quality financial planning is needed. The main purpose of Origin / Edge configuration is load balancing, ensuring the best user experience. Also, with this approach you’ll need Flash Media experts in your developer team. They will set up load sharing between Flash Media Servers, develop algorithms to ensure fault tolerance and initialization of video streams at the servers. Probably, they will also have to set up authentication and access restriction services, video stream recording, and other value-added services. To estimate the number of servers, the most popular recommendation is: 4 Edge per Origin, not more than 3 Gbps per Edge.
It is often convenient to use Flash Media Server as a load balancer with RTMP Redirect. Based on our experience, you can process up to 1,000 incoming connections per second on an eight-cores server.
Using CDN requires an informed approach to monetizing content. In this case, you are actually paying for your users’ views of video content. Who will pay for 1 minute (or, better, for 1 GB) of the streaming session? Well, either the user or the advertiser has to pay in any case. Try to build a clear financial model, and it will help you to evaluate whether you qualify for CDN services at this stage or you’d better seek for alternatives. If you use CDN services, you just have to deploy the Origin server and the core business logic (e.g., user authentication). Scaling up will be provided by the CDN partner.
An alternative is to use a P2P technology. In the first approximation, the new Adobe technology seems to become a real helper to live video streaming. On the one hand, it does not involve substantial investments at the project startup (although Flash Media Enterprise Server is not inexpensive whatsoever). On the other hand, if your content grows popular, it provides a geographically dispersed video delivery system (in a certain way, you get numerous small Edge Servers). At the moment the technology is pretty new and needs to be time-proven and field-tested in commercial projects (however, first successful projects have already been implemented). Would not the new technologies bring a substantial competitive edge to your project?
So now we have to answer the following question: what content delivery models fit your project best from the financial and technical viewpoints?
Business Logic
Flash Media Server allows you to develop custom business logic to monetize your content. The most popular monetization tools are subscription based and pay per view models. In such cases, the mechanisms of external authorization are often used. Flash Media Server calls an external Web service to determine content availability to a specific user. To ensure high performance, we recommend external authentication using Flash Media Server C++ plug-ins.
Also, when using Flash Media Servers, you can implement a variety of value-added services:
- DVR – recording of video streams and live stream timeshift
- Video Snapshot – obtaining snapshots from video streams
- Virtual Channels – virtual TV channels, compiled from video files.
Sometimes you need to support integration with a billing or statistics system. For this purpose, you can use Flash Media Server logs. Also, if online processing is required, you will need a mechanism similar to external authorization.
To stream premium content or to protect any kind of content, you’ll need Adobe Flash Access 2.0. This product helps to protect video content from unauthorized access and distribution (this is often required by large copyright holders).
So, here are the questions to be answered at the design phase:
- Do you need user authentication to access video content?
- What additional services will be offered to users? Which mechanisms will be needed on the server side?
- Do you need a mechanism to charge for video access (billing system)? Do you need online or offline billing?
Flash Video Player
Implementation of Flash video player for live video differs but slightly from a common video file player based on RTMP. Significant changes are needed to implement additional features (DVR, Timeshift), as they require special control of connection to the video server (especially, if ring buffer is used to record video). RTMP Redirect Processing is also performed manually.
We strongly recommend tracking the video player QoS metrics via Google Analytics or Omniture. For this purpose, you can use the TiViSta free library). It allows you even to get insight on geographical QoS data among your video viewers.
As a result, you should get a similar scheme:
As an example of implementing online video streaming portal, please look at our test service OnTiVi. t’s quite operable and functional, by the way, and imposes no restrictions on users.
Finally, it is worth considering the use of mobile devices as video cameras (mobile reporter) and streaming to mobile devices. Here are some exciting implementations of online video streaming services: livestream.com, ustream.com, and justin.tv.