Skip

This YouTube, it vibrates?
June 9, 2006 4:52 AM   Subscribe

How does YouTube work?

I'm trying to locate some information on the kind of backend needed to power a site like YouTube. Not in terms of scale or size, more in terms of the kind of software. How are the clips re-encoded and how are they streamed? Would you need Flash Media Server? What, after bandwidth, would be the biggest cost?
posted by prolific to Computers & Internet (13 answers total) 3 users marked this as a favorite
 
Bandwidth is by far the biggest cost. Bandwidth costs go down with added volume, but expect to pay at least $.85 to $1/GB, if you have a low-moderate volume.

They also transcode whatever video format you upload to FLV, which is not cheap, computationally. Not sure what kind of software they use to do this, but it looks like this free package might be able to do it.

Finally, YouTube doesn't stream its video -- it uses "progressive download." You can do PD with no special server software.
posted by TonyRobots at 5:24 AM on June 9, 2006


Thanks for clearing that up, TonyRobots, I was told earlier that special server software would be needed and that the licensing would be expensive.
posted by prolific at 5:31 AM on June 9, 2006


I'm guessing the after bandwidth their next biggest cost is their team of lawyers.
posted by mikepop at 5:47 AM on June 9, 2006


I'd bet the cost of lawyers to bandwidth will soon be 1:1 if not 2:1. :P

But yeah, bandwidth, then storage, then administrative time, then processor time.

If you're just getting started, it'll be storage, administrative time, bandwidth, processor, I'd think.
posted by unixrat at 6:18 AM on June 9, 2006


I'm not sure you should be so quick to worry about what costs there are after bandwidth, since YouTube is spending $1 million per month on bandwidth alone.

But yeah, staff, storage and enough processors to transcode uploaded video into FLV seem likely candidates for other big costs.
posted by revgeorge at 6:48 AM on June 9, 2006


I'm actually less interest in cost as I am in the technology needed.
posted by prolific at 7:48 AM on June 9, 2006


Last time I heard, ffmpeg (linked by TonyRobots) can't encode the audio portion of the FLV format. Unless they're doing two streams simultaneously (MP3 + FLV), they must be using an official encoder. Unless YouTube requires Flash 8, that means they're using Sorenson Squeeze for Flash which is scriptable and can watch folders for files to transcode. Otherwise, they're using something from On2, probably the Flix engine to do the transcoding.

As mentioned by others, transcoding to FLV is extremely expensive computationally. I suspect they have a farm of machines doing transcoding and nothing else.

Once you've got the video, you need to distribute it. You can buy your own Flash Media Server license, but if you want to saturate any decent internet connection, it's going to cost you at least $45,000 (for an 'Origin' license). The alternative is to stream through a CDN (content delivery network) such as VitalStream or Akamai (there are others too). No idea what the costs are there though.
posted by lowlife at 8:31 AM on June 9, 2006


I encoded AVIs to FLV using the free FLV Encoder. I used the Flash script called Flash Video Player, also free. There are a lot of Flash Video Players out there. I liked the way the one I referenced looked.

The end results, in terms of quality, were at or better than YouTube. I have no idea how well this would scale since I had several manual processes, but I didn't pay a dime other than hosting to get it all up and running.
posted by tayknight at 8:41 AM on June 9, 2006


Bandwidth is by far the biggest cost. Bandwidth costs go down with added volume, but expect to pay at least $.85 to $1/GB, if you have a low-moderate volume.

If by 'low-moderate' volume you mean less than 100 videos served per day, maybe, but in reality you'd be aiming a lot higher than that even for a 'low-moderate' video site.

Generally you'd use something like a 100Mbps unmetered server for $2k per month (32,000 gigabytes per month - though you're never going to get full throughput, so even assuming 10,000 gigabytes per month for $2k, that's still only 20 cents a gig). You can go even cheaper if you colo yourself, but then you have equipment costs.

I'd say the biggest cost isn't necessarily bandwidth (again depends on the popularity of the site), but talent to keep the whole thing running. Salaries are one of the most sky-high expenses out there.
posted by wackybrit at 9:02 AM on June 9, 2006


Kind of off-topic, but according to this article, YouTube serves 200TB/day.
posted by carter at 9:38 AM on June 9, 2006


You can find colocated linux boxes for $100 that offer a terabyte a month of bandwidth. That comes out to 10 cents a gig, and is just about the best deal possible.
posted by mathowie at 9:59 AM on June 9, 2006


lowlife, ffmpeg doesn't have any problems encoding the audio of FLVs for me (I use ffmpegx, the Mac GUI version of ffmpeg). There are the occasional QuickTime files that have the streams reversed -- audio before video -- but once I learned that and figured out which checkbox to click off to deal with it, I haven't had any hiccups at all.
posted by delfuego at 4:09 PM on June 9, 2006


but expect to pay at least $.85 to $1/GB
Are you freaking kidding me? You can get a dedicated box at layeredtech.com with 1000 GB per month for $65, and this kind of deal is not unique in the hosting industry. If you're paying anywhere close to $1 per GB you are getting robbed blind.
posted by Rhomboid at 7:32 PM on June 9, 2006


« Older Where are all the militant Isl...   |  What are the success factors i... Newer »
This thread is closed to new comments.


Post