1
00:00:00,080 --> 00:00:06,240
video compression is a very important aspect of how video streaming websites

2
00:00:03,840 --> 00:00:09,360
like youtube netflix and hulu work without it you wouldn't be able to

3
00:00:07,440 --> 00:00:13,440
stream such high quality high frame videos like this one first some math

4
00:00:11,920 --> 00:00:18,400
let's say you're watching a video with a resolution of

5
00:00:15,759 --> 00:00:23,439
pixels that's like 2 million pixels per frame and in this case you've got 30

6
00:00:20,320 --> 00:00:26,160
frames per second that's a whopping 62

7
00:00:23,439 --> 00:00:31,359
million pixels per second if each pixel needs 24 bits or three bytes of

8
00:00:28,400 --> 00:00:37,360
information you're looking at 178 megabytes of data per second completely

9
00:00:34,800 --> 00:00:41,440
uncompressed that would be 51 gigabytes of information for a single five minute

10
00:00:39,600 --> 00:00:44,399
video we've got pretty fast internet here at the office but even we can only

11
00:00:43,280 --> 00:00:49,120
download like two and a half gigabytes in five minutes

12
00:00:46,800 --> 00:00:52,559
that's a long ways away from 51. fortunately a five minute high

13
00:00:50,559 --> 00:00:58,879
definition youtube video is not 51 gigabytes it's in fact more like 72

14
00:00:55,680 --> 00:01:01,199
megabytes that's like 700 times smaller

15
00:00:58,879 --> 00:01:07,200
how did they do that that's the magic of video compression which works mostly by

16
00:01:03,840 --> 00:01:08,640
minimizing redundancy in the video data

17
00:01:07,200 --> 00:01:12,799
now there are all sorts of different ways to compress video and lots of

18
00:01:10,640 --> 00:01:16,000
different video containers and codecs but i won't go into detail about that

19
00:01:14,400 --> 00:01:19,759
because last already covered it in this episode and frankly i still don't really

20
00:01:18,240 --> 00:01:24,960
understand it all even though i am employed as a video editor so don't tell

21
00:01:22,479 --> 00:01:29,520
Linus so here's what you need to know there are two ways to compress video

22
00:01:27,439 --> 00:01:35,040
spatial compression and temporal compression also known as intra-frame

23
00:01:32,320 --> 00:01:38,159
and interframe respectively seriously who names this stuff

24
00:01:36,560 --> 00:01:43,600
anyway i'm going to describe each of these in terms of the jpeg image format

25
00:01:40,400 --> 00:01:45,840
and the mpeg video format spatial or

26
00:01:43,600 --> 00:01:50,720
intra-frame compression is applied only to individual video frames to compress a

27
00:01:48,640 --> 00:01:55,600
video frame you can use the same process that's used to compress a still image

28
00:01:52,560 --> 00:01:57,360
like a jpeg when a jpeg is created color

29
00:01:55,600 --> 00:02:01,439
information of the image is reduced in a process called chroma sub sampling and

30
00:01:59,520 --> 00:02:06,640
then the image is split into sections of 8x8 pixels called macroblocks then all

31
00:02:04,640 --> 00:02:10,959
of this fancy stuff is done to these blocks to further reduce the file size

32
00:02:08,879 --> 00:02:14,959
it's easy to see this effect on an image that has been saved with a high amount

33
00:02:12,720 --> 00:02:18,800
of compression all those ugly looking squares are known as compression

34
00:02:16,640 --> 00:02:22,640
artifacts some images like this red square can be compressed more than

35
00:02:20,560 --> 00:02:26,800
others like this complicated photograph because the red square is very simple

36
00:02:24,560 --> 00:02:32,640
with a lot more redundancy so that's how a jpeg uses spatial compression now for

37
00:02:29,520 --> 00:02:34,239
an mpeg sometimes called a motion jpeg

38
00:02:32,640 --> 00:02:38,239
things are a bit more complicated than just lining up a whole bunch of jpegs

39
00:02:36,319 --> 00:02:44,319
one after the other to be used as video frames doing it that way would not allow

40
00:02:40,879 --> 00:02:46,480
for inter frame or temporal compression

41
00:02:44,319 --> 00:02:51,280
temporal compression works again by reducing redundancy if you go through a

42
00:02:49,040 --> 00:02:54,720
video like this one frame by frame you'll notice that many frames are

43
00:02:52,640 --> 00:02:58,800
almost completely identical that's redundancy which can be easily

44
00:02:56,640 --> 00:03:02,239
compressed for example for all the parts of this video that don't need to change

45
00:03:00,400 --> 00:03:06,000
from one frame to the next like all this whiteness around me all we need is an

46
00:03:04,400 --> 00:03:11,360
instruction for those parts of the frame which says don't change anything like

47
00:03:08,640 --> 00:03:16,239
jpeg the mpeg standard breaks a video frame into 8x8 pixel macro blocks and

48
00:03:14,400 --> 00:03:20,159
each macro block receives instructions on what to do with the pixels they

49
00:03:17,920 --> 00:03:24,640
already have there are instructions for staying exactly the same for moving

50
00:03:22,560 --> 00:03:29,200
rotating changing color changing completely and so on video frames with

51
00:03:27,280 --> 00:03:33,920
instructions like this are called p frames and they use about half as much

52
00:03:31,360 --> 00:03:37,599
data as an iframe which is pretty much just a jpeg

53
00:03:35,519 --> 00:03:43,040
there are also b frames which are predictions or interpolations between i

54
00:03:40,560 --> 00:03:46,879
and p frames b frames use a quarter as much data as an iframe so they really

55
00:03:44,959 --> 00:03:51,040
save a lot of space this is all pretty easy to see on a video file that has

56
00:03:48,799 --> 00:03:54,640
been saved in an extremely low quality setting like what you're seeing right

57
00:03:52,480 --> 00:03:58,560
now again all these awful square thingies are called compression

58
00:03:56,159 --> 00:04:02,879
artifacts furthermore sometimes a video file will be corrupted or missing some

59
00:04:00,799 --> 00:04:06,239
data when that happens you get an effect like this one

60
00:04:04,159 --> 00:04:09,920
this particular effect is caused by a missing iframe which would have cleared

61
00:04:08,319 --> 00:04:14,799
away the old image to make room for a new one without the iframe the list of

62
00:04:12,159 --> 00:04:19,280
changes in the following b and p frames are applied to the wrong image so now

63
00:04:17,280 --> 00:04:24,240
you know why a video sometimes looks weird or gets all blocky those artifacts

64
00:04:21,919 --> 00:04:28,720
are a result of the video compression being either too high or else some kind

65
00:04:26,639 --> 00:04:32,880
of error in the coding or transmission of the video data now listen if none of

66
00:04:30,960 --> 00:04:37,360
that made any sense everything i've said can be broken down to one thing

67
00:04:35,120 --> 00:04:42,800
bit rate the bit rate is the amount of data or bits that are being used every

68
00:04:40,080 --> 00:04:46,639
second if a video has a low bid rate it will be low resolution and or low

69
00:04:44,960 --> 00:04:51,600
quality with lots of compression artifacts if a video has a high bitrate

70
00:04:49,199 --> 00:04:56,479
it will be high quality and or high resolution so the more bits you have to

71
00:04:54,160 --> 00:05:00,639
work with the better the video will look there's just no getting around that even

72
00:04:58,320 --> 00:05:05,520
with the best compression methods video compression is a balancing act between a

73
00:05:02,720 --> 00:05:10,000
good looking video or a small file size you can't have both but if compromise is

74
00:05:07,840 --> 00:05:13,759
not your style maybe you'll like fractal design now i'm sure you've all grown

75
00:05:12,080 --> 00:05:19,039
accustomed to embarrassing torturous events happening to line us in these

76
00:05:15,440 --> 00:05:19,039
spots let's look at them now

77
00:05:20,160 --> 00:05:26,080
behind in this manner

78
00:05:24,000 --> 00:05:29,520
speaking of mean fractal design is that buying up all of my advertising

79
00:05:27,600 --> 00:05:34,560
inventory so i was a little nervous about doing this ad i am however

80
00:05:32,000 --> 00:05:38,560
relieved to say that josh has granted me a reprieve i guess Linus is the one he

81
00:05:36,720 --> 00:05:43,039
wants to torture so we're using this spot to thank all of you the viewers who

82
00:05:40,880 --> 00:05:46,720
went to the survey page and responded so positively to our previous fractal

83
00:05:44,800 --> 00:05:50,400
design ads as fast as possible that they've decided to continue sponsoring

84
00:05:48,479 --> 00:05:54,639
this show so thanks to you guys and thanks to fractal design the company

85
00:05:52,240 --> 00:05:58,080
whose cases power supplies and fans bring all of the boys to all of the

86
00:05:56,240 --> 00:06:01,919
yards be sure to check back over the next few weeks to learn just what that

87
00:06:00,000 --> 00:06:06,080
reference might mean thanks for watching this episode of fastest possible give us

88
00:06:04,000 --> 00:06:11,759
a like or a dislike leave a comment subscribe do it subscribe and we'll see

89
00:06:09,039 --> 00:06:11,759
you next time
