In the prior post on video streaming there was a promise of a future article on using CDNs to stream videos for your site. Unlike public services like YouTube and Vimeo, you have more control over your content using a CDN.

Public networks have restrictions on the size, quality, and length of videos. They also may have restrictions on content. These restrictions are no longer an issue when you use a CDN.

CDN (Content Delivery Network) – A system of equipment and computers that distribute content on the Internet. Instead of having just one computer like your web server delivering content, you have a highly optimized network deliver video, images, and static content. Your Facebook photos and MySpace music are served from these networks. It also has an added benefit of having multiple locations, allowing clients to view your content from the fastest location to them.

There are many different configurations for CDNs, which I may post in a future article. For now thinking of it as storage bin for your media, where your media stays there for a certain amount of time. In this example I have the CDN refresh my videos every day. This means my website only has to deliver the video once a day instead of multiple times a day, which is a huge savings in terms of processing power and bandwidth.

YouTube and other services compress your videos when you upload them to there server. Most CDNs, unless they are specifically setup for video, do not compress videos for you. It is your job to convert them to the final format. In this case I used On2 Technologies Flix Pro to convert my video to flash with the following settings: 480×360, FLV 6-E VBR 448kbs max, 30fps, max keyframe 150, MP3 audio at 64kb/s 44KHz stereo, which resulted in a video size of 2.2MB (from a 5.7MB mp4). This is a fairly high quality setting. I’d suggest tweaking the settings to find out what works for you and encode versions for different resolutions and bandwidth requirements. This produces the “High”, “Medium”, “Low” options you see for trailers and other online videos. [download original video] [download encoded video]

To compare the benefits of using a CDN you can view the following examples.

Here is the original video from the last post in YouTube


Here is the video streaming from directly from this web site. Note how it has to download the entire video before it starts playing.

		 

Here is the video streaming from the CDN. Note how it starts playing immediately.

 


		

In this example I used the Flowplayer flash player and SimpleCDN for content delivery.