Pages

30 thg 11, 2010

What Is A Streaming Server

Intendent audience

This tutorial assumes the following:

  • You have a collection of .flv or .mp4 files with correct meta-data/moov-atoms
  • You want to use a media server to stream video files on demand (vod)

What Is A Streaming Server

Ok so simply put, a streaming server refers to a dedicated web server, or application installed on a server, that is designed purely for delivering video or audio files. What this means in very simple terms is that your video files will be coming from a different place to your html/php/asp pages.

If you're still not really sure what I'm talking about, check out:

Streaming servers can use a variety of protocols. For example, Adobe Flash Media Server (FMS hereafter) uses RTMP, RTMPS, RTMPe. Apple Darwin Streaming Server (DSS hereafter) uses RTP, RTSP etc. Different protocols have different advantages and disadvantages, but for the duration of this tutorial we'll assume that we care more about the whole thing working than how it organises it's bits and bytes.

Why Use A Streaming Server

In general, the advantages of a streaming server are:

  • Users can seek to any place in the video timeline without waiting for the whole video to buffer
  • No physical data is saved on the users PC cache, so your media files are better protected
  • It uses less bandwidth than progressive*
  • Streams can be combined into a single gapless stream

* This is because on average a user will not watch the entire video, but with progressive download they will still download the entire file.

What Are The Main Options Available

Ok so if you decide to deliver your media via a streaming server, you have a few options available to you.

Install Your Own Media Server Software

Your main options are:

OSFlash Red5

  • Cost: Open-Source
  • Free Trial: -
  • Formats: flv

As of writing it's very buggy, has very little documentation, is extremely temperamental to different server setups and is prone to being a pain in the a**. On the flip side, it's free and if you can get it working, it should work great. Facebook seem to think so anyway, as they built their video streaming services on Red5.

I personally wasted so much time playing with different setups that I simply gave up on Red5. In theory it does work 'straight out of the box' with a pre-built application called 'oflaDemo'. Throw your video files in the streams folder inside this application and you should be good to go. In theory.

Adobe FMS

  • Cost: $999
  • Free Trial: Yes - 10 simultaneous connections
  • Formats: flv, H.264 mp4

Possibly the most well known streaming server, and probably the best. You can download their free 10 user development license, which is still the fully featured product, and give it a test. Within 20 minutes I had this working on a VPS. The documentation literally holds your hand through the install and guides you line by line. And as with Red5, it comes with a pre-built application for streaming vod. Look for the 'vod' folder inside applications. Again, Adobe's Getting Started documentation guides you through this anyway and gets you up and running within about 5 minutes.

Wowza

  • Cost: $999
  • Free Trial: Yes - 10 simultaneous connections
  • Formats: flv, H.264 mp4

I have no personal experience yet of wowza however, with Adobe FMS3 costing exactly the same I don't see why you wouldn't just stick with the big company. I hope others can have more input on Wowza.

Apple DSS

  • Cost: Open-Source
  • Free Trial: -
  • Formats: mov, H.264 mp4, 3gp

Apple's open source streaming server which is basically built on their commercial Quicktime Streaming Server (QTSS). DSS is great if you have no intentions of streaming flv and wish to purely stream H.264 MP4 or 3GP files. Youtube use DSS for their Mobile website. Again I have no personal experience with actually using the player, but with the RTP/RTSP protocol not yet supported by Flowplayer, it wont be discussed here any further.

Lighttpd

  • Cost: Open-Source
  • Free Trial: -
  • Formats: flv, mp4*

* needs checking

Lighttpd (pronounce it "Lighty") is actually a webserver for linux systems (just like Apache). Lighttpd has a very small footprint and specalises in delivering static content. It has a flv streaming plugin which works somewhat as a cross between a streaming server and progressive download. The video is still cached to the user, but they are now able to seek forward into the video. This is known as pseudo streaming.

This is the method that Youtube, along with many other video providers, use to stream their video files (as well as static content such as thumbnails). This is mainly because once you get to the server farm size of youtube, you need the smallest CPU usage possible.

Advantages Of Setting Up Your Own Media Server

  • You stay in complete control
  • Cheaper in the long term
  • Potentially free (Red5, Lighty)

Disadvantages Of Setting Up Your Own Media Server

  • Potentially high setup costs ($999+)
  • No Global Infrastructure e.g. UK users would need a UK mirror, Japanese users would need a Japanese mirror

Usage

Simply save all your video files in the video on demand application folder. For example, on Adobe FMS:

/adobeFMS/applications/vod/media

As mentioned before, one of the best things you get with FMS is the support and documentation. Here's all you should need:Adobe: Beginner VOD

Then request the file from the address of the server (example IP 222.22.44.222) :

rtmp://222.22.44.222:1935/vod/flv:name_of_video

FMS comes with a pretty good admin console straight out of the package. Red5 has one, but for me it was always buggy. Wowza has an admin interface too. These are mainly for monitoring bandwidth, connections, usage etc.

Rent A Shared Media Server Account

This basically involves getting a separate hosting account from a provider who provisions shared accounts or VPS accounts on their own FMS/Wowza/Lighty dedicated servers. This means they incur the setup costs and you just pay for the bandwidth, storage and then a little extra on top.

Main providers:

Advantages Of Using A FMS Provider

  • Low setup costs
  • Hassle Free - Up and running in 10 minutes

Disadvantages Of Using A FMS Provider

  • Can be very expensive as your site grows
  • Content is still only streamed from a single location (Influxis mentions using a 3rd part CDN but just cut out the middle man!)

Usage

Using the hosting account is basically identical to if you had set it up yourself. Your account has a dedicated IP, the host will give you any specific details as to the folder structure of your account, and then you just access the files over RTMP on port 1935.

Use A CDN

Main providers:

Content Distribution Networks are basically a global network of media servers, all mirroring each other. Upon requesting a file from a CDN, their network determines their closest server to the user and delivers the file from that location. Because of this design, they are the fastest and most reliable solution available. They are also (usually) the most expensive.

From personal experience, Simpl CDN are very upfront and honest on their prices. They offer instant account activation, and $15.00 of credit to use on their 'pay as you go' payment structure, which is the opposite of what Influxis do! The other CDN providers all require a more personal sales approach, i.e. giving them a call. While this is often frustrating, and a business practice that I personally hate for a service such as this where a simple Rate card would work fine, I have at some point spoke to most of the providers in the list above and they all work in about the same way. Traffic goes up, cost per GB goes down.

Advantages Of Using A CDN

  • The fastest possible downloads to your users.
  • Support ALL file types
  • No infrastructure setup costs
  • Most reliable. If one servers fail, many more to step in it's place.
  • Pay only for what you use (Most CDN's)

Disadvantages Of Using A CDN

  • Some of the larger CDN's charge a setup fee, possibly to keep away smaller clients
  • Pricing is not often very obvious
  • The 'price per GB' can seem very expensive

Usage

Using your CDN is ideally simple and straightforward. All providers offer the service to 'mirror' an origin server that you specify. Basically, you place all your files in a publically accessible folder, and then limit access by IP to just your CDN. As soon as files are added to that folder, the CDN copies it into their network.

You are provided all necessary access info, but it again usually comes down to something like:

rtmp://your.account.simplecdn.com:1935/your.account/your_video_file.mp4

Most CDN's also offer the choice of manually uploading video files via ftp. Erm... no.

What's The Cost Comparison

Okay so this may seem tricky, so I'll try and do 2 comparisons. One for a small video website, one for a pretty large video website. These estimates will be updated as they're looked into more, prices change etc. So let's assume:

  • Site A: 100 files (50MB each / 1Mbit bitrate) = 5GB storage. 100 views each per day for one month = 488GB transfer
  • Site B: 488GB storage. 1,000 views each per day for one month = 476TB transfer
Site A
ProviderStorageBandwidthSetupAdditionalTotal
SimpleCDN$5$4300$48
Akamai0$468*00$468
Limelight0$380*00$380
Influxis0$223***00$223
Own FMS-$50****$10000$1050
Own Red5-$50****-0$50

* Limelight and Akamai do not have published rate cards. A quick survey of current customers resulted in average pricing of $0.96 for Akamai, and $0.78 for Limelight at this traffic level.
** Advanced II was the closest match for this scenario, although there is a lot of unused storage with this plan.
*** Influxis plan with the the Custom Plan Builder **** Suitable Hosting = Virtual III Rapid VPS here

Site B
ProviderStorageBandwidthSetupAdditionalTotal
SimpleCDN$5$43,38000$43,385
Akamai0$224,21500$224,215
Limelight0$112,10800$112,108
Influxis0$35,400**00$35,400**
Own FMIS-$22,242***$3500$1040$24,282
Own Red5-$22,242***$0$1040$23,282

* Limelight and Akamai do not have published rate cards. A quick survey of current customers resulted in average pricing of $0.46 for Akamai, and $0.23 for Limelight at this traffic level.
** 2 servers, $21 per Mbps, Prices may vary based on a case by case basis depending on usage and need. For more information, contact Director of Enterprise Solutions, Robert Parker at 661-775-3936 x206 or email: robert [at] influxis [dot] com
*** Suitable Hosting = $15 per Mbps, 4 x Dedicated III Rapid VPS here

Price Summary

Firstly, let me stress again this are estimates. However, it's pretty obvious that some options excel at different requirement levels. For site A, it seems the tempting option would be to setup Red5 server. However, again I must stress how buggy the software is, still in it's beta and constantly changing. After SimpleCDN, all the other CDN's and Influxis seem just as appealing. Check the performance comparison further down to decide.

for site B, Influxis has the most attractive pricing. The Influx's plan includes your choice of USA (Los Angeles, San Jose, Seattle, Chicago, Dallas, Atlanta, Ashburn, New York) and/or European (London, Frankfurt, Amsterdam) servers. SimpleCDN comes close to Influxis in their pricing. These two seem to be in another level altogether than their competitors, yet once you have a large site setting up your own server farm using Flash Media Interactive seems the better value option. However, this is where the value of a CDN will really come into play. And thats the reason why the price difference between Influxis/SimpleCDN and Limelight/Akamai is a little worrying. You can't help but think how much extra service/product are you getting for that money. Is it money well spent? Are Influxis and SimpleCDN simply taking a lower cut? I'd love to answer, but my hosting is not past the $20,000 a month. If your site pulls that much traffic, setup a meeting with them and find out face to face.

Whats The Performance Comparison

This part of the tutorial is possibly the simplest part.

  • Own FMS or Shared FMS: Files streamed from one location.
  • CDN: Files streamed from the closest mirror to user

If the numbers add up, choose the CDN every time. If your site is still at the very early stages, using a development server for a while might actually work. Just don't get more than 10 users at a time! (From experience, 10 users online at once usually means around 15,000 uniques a month).

Which Solution Is Best For Me

  • Well, if your website is small, and you love buggy software, install Red5 on your VPS and just deal with the extra bandwidth charges.
  • If your website is small but you intend to grow, sign up with simpleCDN or Influxis
  • If your website is very large, you should be using a CDN or setting up your own!
  • If your website has many international visitors, go with a CDN
  • If your content is extra high quality and it's impeccable delivery is important, go with Akamai/Limelight. Why? Because you can't afford the risk of learning "You get what you pay for"

How To Setup Flowplayer For Streaming

Ok, this is possible the reason a lot of you started reading this tutorial. And I've saved it until the end to tell you that the demos/documentation already cover this in great detail! Try these links out:

Author

Author: Liam Gooding
Website: Goodings Media UK Web Development

I hope you find this useful. This tutorial is intended to be a work in progress, and I'd very much like users to pick it apart on the forums so that we can improve it and make it as informative as possible.




This tutorial is the work of the author only, and does not represent Flowplayers opinion in any way. If you have something interesting to say about web videos please contact us on support@flowplayer.org and we are happy to publish it.

What Is A Streaming Server

Intendent audience

This tutorial assumes the following:

  • You have a collection of .flv or .mp4 files with correct meta-data/moov-atoms
  • You want to use a media server to stream video files on demand (vod)

What Is A Streaming Server

Ok so simply put, a streaming server refers to a dedicated web server, or application installed on a server, that is designed purely for delivering video or audio files. What this means in very simple terms is that your video files will be coming from a different place to your html/php/asp pages.

If you're still not really sure what I'm talking about, check out:

Streaming servers can use a variety of protocols. For example, Adobe Flash Media Server (FMS hereafter) uses RTMP, RTMPS, RTMPe. Apple Darwin Streaming Server (DSS hereafter) uses RTP, RTSP etc. Different protocols have different advantages and disadvantages, but for the duration of this tutorial we'll assume that we care more about the whole thing working than how it organises it's bits and bytes.

Why Use A Streaming Server

In general, the advantages of a streaming server are:

  • Users can seek to any place in the video timeline without waiting for the whole video to buffer
  • No physical data is saved on the users PC cache, so your media files are better protected
  • It uses less bandwidth than progressive*
  • Streams can be combined into a single gapless stream

* This is because on average a user will not watch the entire video, but with progressive download they will still download the entire file.

What Are The Main Options Available

Ok so if you decide to deliver your media via a streaming server, you have a few options available to you.

Install Your Own Media Server Software

Your main options are:

OSFlash Red5

  • Cost: Open-Source
  • Free Trial: -
  • Formats: flv

As of writing it's very buggy, has very little documentation, is extremely temperamental to different server setups and is prone to being a pain in the a**. On the flip side, it's free and if you can get it working, it should work great. Facebook seem to think so anyway, as they built their video streaming services on Red5.

I personally wasted so much time playing with different setups that I simply gave up on Red5. In theory it does work 'straight out of the box' with a pre-built application called 'oflaDemo'. Throw your video files in the streams folder inside this application and you should be good to go. In theory.

Adobe FMS

  • Cost: $999
  • Free Trial: Yes - 10 simultaneous connections
  • Formats: flv, H.264 mp4

Possibly the most well known streaming server, and probably the best. You can download their free 10 user development license, which is still the fully featured product, and give it a test. Within 20 minutes I had this working on a VPS. The documentation literally holds your hand through the install and guides you line by line. And as with Red5, it comes with a pre-built application for streaming vod. Look for the 'vod' folder inside applications. Again, Adobe's Getting Started documentation guides you through this anyway and gets you up and running within about 5 minutes.

Wowza

  • Cost: $999
  • Free Trial: Yes - 10 simultaneous connections
  • Formats: flv, H.264 mp4

I have no personal experience yet of wowza however, with Adobe FMS3 costing exactly the same I don't see why you wouldn't just stick with the big company. I hope others can have more input on Wowza.

Apple DSS

  • Cost: Open-Source
  • Free Trial: -
  • Formats: mov, H.264 mp4, 3gp

Apple's open source streaming server which is basically built on their commercial Quicktime Streaming Server (QTSS). DSS is great if you have no intentions of streaming flv and wish to purely stream H.264 MP4 or 3GP files. Youtube use DSS for their Mobile website. Again I have no personal experience with actually using the player, but with the RTP/RTSP protocol not yet supported by Flowplayer, it wont be discussed here any further.

Lighttpd

  • Cost: Open-Source
  • Free Trial: -
  • Formats: flv, mp4*

* needs checking

Lighttpd (pronounce it "Lighty") is actually a webserver for linux systems (just like Apache). Lighttpd has a very small footprint and specalises in delivering static content. It has a flv streaming plugin which works somewhat as a cross between a streaming server and progressive download. The video is still cached to the user, but they are now able to seek forward into the video. This is known as pseudo streaming.

This is the method that Youtube, along with many other video providers, use to stream their video files (as well as static content such as thumbnails). This is mainly because once you get to the server farm size of youtube, you need the smallest CPU usage possible.

Advantages Of Setting Up Your Own Media Server

  • You stay in complete control
  • Cheaper in the long term
  • Potentially free (Red5, Lighty)

Disadvantages Of Setting Up Your Own Media Server

  • Potentially high setup costs ($999+)
  • No Global Infrastructure e.g. UK users would need a UK mirror, Japanese users would need a Japanese mirror

Usage

Simply save all your video files in the video on demand application folder. For example, on Adobe FMS:

/adobeFMS/applications/vod/media

As mentioned before, one of the best things you get with FMS is the support and documentation. Here's all you should need:Adobe: Beginner VOD

Then request the file from the address of the server (example IP 222.22.44.222) :

rtmp://222.22.44.222:1935/vod/flv:name_of_video

FMS comes with a pretty good admin console straight out of the package. Red5 has one, but for me it was always buggy. Wowza has an admin interface too. These are mainly for monitoring bandwidth, connections, usage etc.

Rent A Shared Media Server Account

This basically involves getting a separate hosting account from a provider who provisions shared accounts or VPS accounts on their own FMS/Wowza/Lighty dedicated servers. This means they incur the setup costs and you just pay for the bandwidth, storage and then a little extra on top.

Main providers:

Advantages Of Using A FMS Provider

  • Low setup costs
  • Hassle Free - Up and running in 10 minutes

Disadvantages Of Using A FMS Provider

  • Can be very expensive as your site grows
  • Content is still only streamed from a single location (Influxis mentions using a 3rd part CDN but just cut out the middle man!)

Usage

Using the hosting account is basically identical to if you had set it up yourself. Your account has a dedicated IP, the host will give you any specific details as to the folder structure of your account, and then you just access the files over RTMP on port 1935.

Use A CDN

Main providers:

Content Distribution Networks are basically a global network of media servers, all mirroring each other. Upon requesting a file from a CDN, their network determines their closest server to the user and delivers the file from that location. Because of this design, they are the fastest and most reliable solution available. They are also (usually) the most expensive.

From personal experience, Simpl CDN are very upfront and honest on their prices. They offer instant account activation, and $15.00 of credit to use on their 'pay as you go' payment structure, which is the opposite of what Influxis do! The other CDN providers all require a more personal sales approach, i.e. giving them a call. While this is often frustrating, and a business practice that I personally hate for a service such as this where a simple Rate card would work fine, I have at some point spoke to most of the providers in the list above and they all work in about the same way. Traffic goes up, cost per GB goes down.

Advantages Of Using A CDN

  • The fastest possible downloads to your users.
  • Support ALL file types
  • No infrastructure setup costs
  • Most reliable. If one servers fail, many more to step in it's place.
  • Pay only for what you use (Most CDN's)

Disadvantages Of Using A CDN

  • Some of the larger CDN's charge a setup fee, possibly to keep away smaller clients
  • Pricing is not often very obvious
  • The 'price per GB' can seem very expensive

Usage

Using your CDN is ideally simple and straightforward. All providers offer the service to 'mirror' an origin server that you specify. Basically, you place all your files in a publically accessible folder, and then limit access by IP to just your CDN. As soon as files are added to that folder, the CDN copies it into their network.

You are provided all necessary access info, but it again usually comes down to something like:

rtmp://your.account.simplecdn.com:1935/your.account/your_video_file.mp4

Most CDN's also offer the choice of manually uploading video files via ftp. Erm... no.

What's The Cost Comparison

Okay so this may seem tricky, so I'll try and do 2 comparisons. One for a small video website, one for a pretty large video website. These estimates will be updated as they're looked into more, prices change etc. So let's assume:

  • Site A: 100 files (50MB each / 1Mbit bitrate) = 5GB storage. 100 views each per day for one month = 488GB transfer
  • Site B: 488GB storage. 1,000 views each per day for one month = 476TB transfer
Site A
ProviderStorageBandwidthSetupAdditionalTotal
SimpleCDN$5$4300$48
Akamai0$468*00$468
Limelight0$380*00$380
Influxis0$223***00$223
Own FMS-$50****$10000$1050
Own Red5-$50****-0$50

* Limelight and Akamai do not have published rate cards. A quick survey of current customers resulted in average pricing of $0.96 for Akamai, and $0.78 for Limelight at this traffic level.
** Advanced II was the closest match for this scenario, although there is a lot of unused storage with this plan.
*** Influxis plan with the the Custom Plan Builder **** Suitable Hosting = Virtual III Rapid VPS here

Site B
ProviderStorageBandwidthSetupAdditionalTotal
SimpleCDN$5$43,38000$43,385
Akamai0$224,21500$224,215
Limelight0$112,10800$112,108
Influxis0$35,400**00$35,400**
Own FMIS-$22,242***$3500$1040$24,282
Own Red5-$22,242***$0$1040$23,282

* Limelight and Akamai do not have published rate cards. A quick survey of current customers resulted in average pricing of $0.46 for Akamai, and $0.23 for Limelight at this traffic level.
** 2 servers, $21 per Mbps, Prices may vary based on a case by case basis depending on usage and need. For more information, contact Director of Enterprise Solutions, Robert Parker at 661-775-3936 x206 or email: robert [at] influxis [dot] com
*** Suitable Hosting = $15 per Mbps, 4 x Dedicated III Rapid VPS here

Price Summary

Firstly, let me stress again this are estimates. However, it's pretty obvious that some options excel at different requirement levels. For site A, it seems the tempting option would be to setup Red5 server. However, again I must stress how buggy the software is, still in it's beta and constantly changing. After SimpleCDN, all the other CDN's and Influxis seem just as appealing. Check the performance comparison further down to decide.

for site B, Influxis has the most attractive pricing. The Influx's plan includes your choice of USA (Los Angeles, San Jose, Seattle, Chicago, Dallas, Atlanta, Ashburn, New York) and/or European (London, Frankfurt, Amsterdam) servers. SimpleCDN comes close to Influxis in their pricing. These two seem to be in another level altogether than their competitors, yet once you have a large site setting up your own server farm using Flash Media Interactive seems the better value option. However, this is where the value of a CDN will really come into play. And thats the reason why the price difference between Influxis/SimpleCDN and Limelight/Akamai is a little worrying. You can't help but think how much extra service/product are you getting for that money. Is it money well spent? Are Influxis and SimpleCDN simply taking a lower cut? I'd love to answer, but my hosting is not past the $20,000 a month. If your site pulls that much traffic, setup a meeting with them and find out face to face.

Whats The Performance Comparison

This part of the tutorial is possibly the simplest part.

  • Own FMS or Shared FMS: Files streamed from one location.
  • CDN: Files streamed from the closest mirror to user

If the numbers add up, choose the CDN every time. If your site is still at the very early stages, using a development server for a while might actually work. Just don't get more than 10 users at a time! (From experience, 10 users online at once usually means around 15,000 uniques a month).

Which Solution Is Best For Me

  • Well, if your website is small, and you love buggy software, install Red5 on your VPS and just deal with the extra bandwidth charges.
  • If your website is small but you intend to grow, sign up with simpleCDN or Influxis
  • If your website is very large, you should be using a CDN or setting up your own!
  • If your website has many international visitors, go with a CDN
  • If your content is extra high quality and it's impeccable delivery is important, go with Akamai/Limelight. Why? Because you can't afford the risk of learning "You get what you pay for"

How To Setup Flowplayer For Streaming

Ok, this is possible the reason a lot of you started reading this tutorial. And I've saved it until the end to tell you that the demos/documentation already cover this in great detail! Try these links out:

Author

Author: Liam Gooding
Website: Goodings Media UK Web Development

I hope you find this useful. This tutorial is intended to be a work in progress, and I'd very much like users to pick it apart on the forums so that we can improve it and make it as informative as possible.




This tutorial is the work of the author only, and does not represent Flowplayers opinion in any way. If you have something interesting to say about web videos please contact us on support@flowplayer.org and we are happy to publish it.

Powered By Blogger