video compression is a very important aspect of how video streaming websites
like youtube netflix and hulu work without it you wouldn't be able to
stream such high quality high frame videos like this one first some math
let's say you're watching a video with a resolution of
pixels that's like 2 million pixels per frame and in this case you've got 30
frames per second that's a whopping 62
million pixels per second if each pixel needs 24 bits or three bytes of
information you're looking at 178 megabytes of data per second completely
uncompressed that would be 51 gigabytes of information for a single five minute
video we've got pretty fast internet here at the office but even we can only
download like two and a half gigabytes in five minutes
that's a long ways away from 51. fortunately a five minute high
definition youtube video is not 51 gigabytes it's in fact more like 72
megabytes that's like 700 times smaller
how did they do that that's the magic of video compression which works mostly by
minimizing redundancy in the video data
now there are all sorts of different ways to compress video and lots of
different video containers and codecs but i won't go into detail about that
because last already covered it in this episode and frankly i still don't really
understand it all even though i am employed as a video editor so don't tell
Linus so here's what you need to know there are two ways to compress video
spatial compression and temporal compression also known as intra-frame
and interframe respectively seriously who names this stuff
anyway i'm going to describe each of these in terms of the jpeg image format
and the mpeg video format spatial or
intra-frame compression is applied only to individual video frames to compress a
video frame you can use the same process that's used to compress a still image
like a jpeg when a jpeg is created color
information of the image is reduced in a process called chroma sub sampling and
then the image is split into sections of 8x8 pixels called macroblocks then all
of this fancy stuff is done to these blocks to further reduce the file size
it's easy to see this effect on an image that has been saved with a high amount
of compression all those ugly looking squares are known as compression
artifacts some images like this red square can be compressed more than
others like this complicated photograph because the red square is very simple
with a lot more redundancy so that's how a jpeg uses spatial compression now for
an mpeg sometimes called a motion jpeg
things are a bit more complicated than just lining up a whole bunch of jpegs
one after the other to be used as video frames doing it that way would not allow
for inter frame or temporal compression
temporal compression works again by reducing redundancy if you go through a
video like this one frame by frame you'll notice that many frames are
almost completely identical that's redundancy which can be easily
compressed for example for all the parts of this video that don't need to change
from one frame to the next like all this whiteness around me all we need is an
instruction for those parts of the frame which says don't change anything like
jpeg the mpeg standard breaks a video frame into 8x8 pixel macro blocks and
each macro block receives instructions on what to do with the pixels they
already have there are instructions for staying exactly the same for moving
rotating changing color changing completely and so on video frames with
instructions like this are called p frames and they use about half as much
data as an iframe which is pretty much just a jpeg
there are also b frames which are predictions or interpolations between i
and p frames b frames use a quarter as much data as an iframe so they really
save a lot of space this is all pretty easy to see on a video file that has
been saved in an extremely low quality setting like what you're seeing right
now again all these awful square thingies are called compression
artifacts furthermore sometimes a video file will be corrupted or missing some
data when that happens you get an effect like this one
this particular effect is caused by a missing iframe which would have cleared
away the old image to make room for a new one without the iframe the list of
changes in the following b and p frames are applied to the wrong image so now
you know why a video sometimes looks weird or gets all blocky those artifacts
are a result of the video compression being either too high or else some kind
of error in the coding or transmission of the video data now listen if none of
that made any sense everything i've said can be broken down to one thing
bit rate the bit rate is the amount of data or bits that are being used every
second if a video has a low bid rate it will be low resolution and or low
quality with lots of compression artifacts if a video has a high bitrate
it will be high quality and or high resolution so the more bits you have to
work with the better the video will look there's just no getting around that even
with the best compression methods video compression is a balancing act between a
good looking video or a small file size you can't have both but if compromise is
not your style maybe you'll like fractal design now i'm sure you've all grown
accustomed to embarrassing torturous events happening to line us in these
spots let's look at them now
behind in this manner
speaking of mean fractal design is that buying up all of my advertising
inventory so i was a little nervous about doing this ad i am however
relieved to say that josh has granted me a reprieve i guess Linus is the one he
wants to torture so we're using this spot to thank all of you the viewers who
went to the survey page and responded so positively to our previous fractal
design ads as fast as possible that they've decided to continue sponsoring
this show so thanks to you guys and thanks to fractal design the company
whose cases power supplies and fans bring all of the boys to all of the
yards be sure to check back over the next few weeks to learn just what that
reference might mean thanks for watching this episode of fastest possible give us
a like or a dislike leave a comment subscribe do it subscribe and we'll see
you next time