I have downloaded some computer science lectures from YouTube recently. There is usually more than one choice of file size and file format to download.

I noticed that for the same video, the downloadable one with FLV 240 extension is larger than another one with MPEG4 360 extension.

What does the number (240 and 360) mean? And which file's compression rate is bigger? That is to say, which one removed much more file elements than the other from the orignal file?


what does the number (240 and 360) mean?

It's the vertical resolution of the video. It means that the video is either 240 pixels or 360 pixels high. This is often also notated as "240p" or "360p". "p" stands for "progressive" and just means that every single frame in this video is a full frame – in contrast to interlaced video.

So what does the number mean to you? Of course, the larger this number, the better the quality, in general. The more pixels you have, the sharper the video will look on a larger screen, if it is enlarged.

You may look at this size chart for common resolutions, for example:

  • PAL (and NTSC), old TV standards
  • VGA, the "classical" old video resolution
  • HD720, a 1280x720p video, very common in internet streaming and TV
  • HD1080, a 1920x1080p video, found on BluRay disks and high-quality streaming

enter image description here

When I download a file, does greater resolution or file size imply better quality?

Now, we first have to define "quality". What is that, even? Quality is an inherently subjective thing. Some people are annoyed by tiny errors in videos, while others are not. Some people like sharp videos, others don't like it when they're too "crisp".

Generally there are three important factors for "subjective" quality in a video:

  • resolution, i.e. the vertical resolution we've already talked about.
  • frame rate, i.e. how many times a frame is shown in a second.
  • bit rate, i.e. how many bits per second are stored for this video.

All of those have an influence on quality. The larger the resolution, frame rate, and bitrate, the better will be the quality. Also, the file size will increase.

enter image description here

So, when trying to judge the quality, you can primarily take the file size as a criterion. Why is this? Just by looking at the vertical resolution only, you can't say anything about the quality. Let's say we have two videos:

  • 320x240 resolution, 25 frames per second, 1 Megabit per second bitrate
  • 320x240 resolution, 25 frames per second, 200 Kilobit per second bitrate

Which one will look better? Of course, the first one, because it has a higher bitrate. And that also means that the file size will be bigger.

But of course, you can't just look at a single parameter to judge this. In fact, a video with a higher resolution can look worse than one with a lower resolution. Let's see another example:

  • 1920x1080 resolution, 12.5 frames per second, 300 Kilobit per second bitrate
  • 1280x720 resolution, 25 frames per second, 600 Kilobit per second bitrate

Here, the 720p video will look better, because it uses more frames per second and has a higher bit rate. Another example would be scaling videos. Imagine you take a video that's originally in 320x240, and scale it up by a factor of two. You get a 480 video, but it won't look better than the original.

What about different codecs?

Now we know that file size is a good indicator for quality. But wait, there's more!

Just because one video is smaller than the other (e.g. 40MB vs. 60MB), this does not necessarily mean that the larger one looks better. Why is that? It might use a more inefficient codec. Now we're talking about the way the video is encoded to the file.

A codec generally just takes the original video and compresses it to a smaller file. You can tell the codec how many bits per second it should use. That's the bit rate we've talked about before.

There are many many codecs, and some are better than others. What does "better" mean, here? It means that two codecs, given the same bit rate, can deliver different results in terms of quality. Let's take an example:

  • MPEG-2 video, typical DVD movie, several GB in size
  • h.264 video, YouTube HD broadcast, a few hundred MB in size

The video from a DVD is huge. Really huge. It can have more than several gigabytes worth of data. And still, a YouTube HD video looks better, while it's using just a few hundred megabytes.

So, as you see, the h.264 codec used for YouTube HD is much better, and much more efficient, than for example the old MPEG-2 codec used for DVDs. This is a reason for not always trusting the file size.

As a rule of thumb: If two files use a different codec, you can't compare their file sizes to check whether one will look better than the other.

What does YouTube do?

So, now we're talking about downloading from YouTube. We already know that YouTube uses a good codec, and it uses this codec for all of its videos. I think you should go with the maximum resolution available when downloading. YouTube won't upscale the videos. That means, if you download the one with the highest vertical resolution, you get the best quality. If you download the one with the higher file size, you'll get the better quality.

You should go with the MP4 option (which uses the aforementioned h.264 codec), if possible. For some videos, the highest resolution isn't even available with FLV.

For example, I tested this on one of my own videos, uploaded as h.264:

charon:~ werner$ youtube-dl http://www.youtube.com/watch?v=tu1zF7mr6pg -F
[youtube] Setting language
[youtube] tu1zF7mr6pg: Downloading video webpage
[youtube] tu1zF7mr6pg: Downloading video info webpage
[youtube] tu1zF7mr6pg: Extracting video information
Available formats:
22  :   mp4 [720x1280]
45  :   webm    [720x1280]
35  :   flv [480x854]
34  :   flv [360x640]
18  :   mp4 [360x640]
43  :   webm    [360x640]
5   :   flv [240x400]

As you can see, the best quality is available through MP4 (equals h.264 codec) and WebM only.

  • Is it just for explicit downloads that it's not offering the highest resolutions in FLV? I'm asking because I do see 720/1080p offerings on Youtube from time to time and am using the flash player, not the html5 one. – Dan Neely Nov 21 '11 at 14:14
  • @DanNeely It could be that YouTube does not expose a downloadable FLV for the HD streams. In this example, the highest available (downloadable) FLV stream is 480p. MP4 goes up to Full HD. I don't know why this is, or if there's just a missing implementation in the tool I use, but YouTube doesn't make the download API for videos public. At least I haven't found out a lot of information about it. – slhck Nov 21 '11 at 14:27
  • Pretty good diagram!Thanks!Codec is a very important factor.I can not distinguish the difference between a mp4 [360x640] one and a flv [240x400] one on the quality.Can you ,or somebody?Does the flv[240x400] have large filesize than the mp4 [360x640] one ,why?The mp4 one has small filesize and good quality ?If all my guess is right .Does that mean the resolution of mp4 is better? – DaMing Nov 23 '11 at 13:46
  • > I can not distinguish the difference between … * – Then you probably just can't see the difference, and it doesn't matter. *> The mp4 one has small filesize and good quality ?If all my guess is right .Does that mean the resolution of mp4 is better? – The resolution is for example 648x480. The quality does not have to be better. – slhck Nov 24 '11 at 16:31
  • @DaMing See my updated answer for more info. – slhck Nov 24 '11 at 16:55

Assuming that the source file is pristine, quality of a product file can generally be determined by the following-
codec, bitrate, resolution.

  • "Those numbers" indicate resolution.
  • File size indicates bitrate.
  • File extension generally can predict codec. [Note that many extensions are container formats and can contain many different codecs: avi, mp4, mkv]

(Bitrate is filesize over time and will determine filesize in the end)

Typically, you want to maximize and balance each of these to get the best file.

There are certain situations where a 'large value' in one of the criteria can overshadow another criteria. The following listed are reasons why you can't necessarily just look for the largest file, resolution or codec.

  • A larger file can easily be lower quality than a smaller file. (And often is in practice). Example: mpeg2 DVD vs bluray rip.
  • A larger resolution file can be lower quality than a lower resolution file. (Not too often in practice)
  • A file with a better codec can be lower quality than one with worse codec. mpeg2 high def broadcast with very high bitrate will be better quality than lower bitrate mpeg4's
  • "Bitrate is filesize over time and will determine filesize in the end"-this sentence is pretty constructive!For a certain video.The length of time is fixed.So the more of the bitrate value, the better. – DaMing Nov 23 '11 at 13:06
  • "A file with a better codec can be lower quality than one with worse codec. "What does it mean?Why does it not be higher,but lower?Would you please give me much more details?Thanks.And in your first two suggestions,I think you want to express those are special cases by the word "...can easily..."and "....can be lower",those all are not often or happen usually, am I right? – DaMing Nov 23 '11 at 14:02
  • 1
    Sorry for being unclear. As I said, you want to balance/maximize each of the criteria. You can't simply look for the largest file or best codec for the reasons listed. – user606723 Nov 23 '11 at 14:30
  • Thank you for replying to me so quickly!Suppose other factors are all the same,except for codec's performance.Whether does it also hold the water that "A file with a better codec can be lower quality than one with worse codec."?I guess" A file with a better codec can be higher quality than one with worse codec. – DaMing Nov 23 '11 at 14:49
  • 1
    If all other factors are the same, a file with a better codec will be better than that of a worse codec. – user606723 Nov 23 '11 at 17:42

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.