What algorithm does YouTube follow to convert between different formats? Does YouTube store different videos (for different formats) on disk or store only 1 and convert from this to appropriate format as requested?

  • Your title and your question are different. Are you specifically asking about resampling (i.e. downscaling/upscaling) algorithms, or transcoding (converting from whatever format you uploaded to whatever format they then serve)? Aug 24 '14 at 20:14

Youtube stores whatever you upload and transcodes to other formats using their own versions of multiple compression formats including h.264 and webm. All transcodes go from the same original file that you upload and are stored after transcoding. Youtube may change the options used from time to time and save new encodes of the video. Encodes are generally pre-rendered upon upload and then used from disk as far as I can tell.

  • 1
    They are always pre-rendered. On-demand renderings costs way too much, processing time costs a lot of money in server terms. Disk space is very cheap.
    – timonsku
    Aug 22 '14 at 21:47
  • @ProfessorSparkles - they could still theoretically on-demand encode a version when first used and then save it. I don't believe they do this, but they also don't publish a lot of their process from anything I've seen.
    – AJ Henderson
    Aug 22 '14 at 23:26
  • Well it would take up considerably more resources if you take into account that this would have to happen millions of times per day essentially making YouTube one huge ass live streaming site for mostly a single viewer per stream that also streams in a lot of different formats which aren't all that suited for this task. Encoding them in the background with unused resources is much much more cost effective. But yes in theory its something that would be possible but I highly doubt it happens in practice, its just costs too much money to make sense.
    – timonsku
    Aug 22 '14 at 23:41
  • @ProfessorSparkles - I don't want to stray in to a discussion, but that's just it, until someone views a video, you don't know what they want to view. You can either encode up front for something that someone may or may not ever need or you can encode the first time someone uses it. It doesn't cost any more to encode it the first time it is used than it does to encode it before someone uses it as long as you are running preemptive encodings whenever the encoders aren't busy. It would be much more complex to build something to allocate the processing, but it would be more efficient.
    – AJ Henderson
    Aug 23 '14 at 0:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.