<p>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.</p>

CC BY-SA 3.0
2014-08-22T21:47:40.930Z
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
CC BY-SA 3.0
2014-08-22T23:26:23.853Z
@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
CC BY-SA 3.0
2014-08-22T23:41:30.533Z
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
CC BY-SA 3.0
2014-08-23T00:02:12.913Z
@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
CC BY-SA 3.0
2014-08-22T05:53:27.133Z
2014-08-22T05:53:27.133Z
AJ Henderson
<p>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?</p>

CC BY-SA 3.0
2014-08-24T20:14:06.490Z
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)?
user1118321
<video-quality><youtube>
How does YouTube convert between different videos resolutions?
a.m.
# How does YouTube convert between different videos resolutions?

(Asked by: username_0 on 2014-08-22)

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?

**Tags:** video-quality, youtube

> **Comments:**
> **username_1**: 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)?  

---

## 1 answers

### Answer by username_2 on 2014-08-22. Score: 4

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.

> **Comments:**
> **username_3**: 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.  
> **username_2**: @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.  
> **username_3**: 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.  
> **username_2**: @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.  

---

