What do the numbers 240 and 360 mean when downloading video? How can I tell which video is more compressed?
Solution 1:
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
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.
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.
Solution 2:
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