{"video_id":"qbGQBT2Vwvc","title":"Video Compression as Fast As Possible","channel":"Techquickie","show":"Techquickie","published_at":"2015-05-07T14:58:16Z","duration_s":370,"segments":[{"start_s":0.08,"end_s":6.24,"text":"video compression is a very important aspect of how video streaming websites","speaker":null,"is_sponsor":0},{"start_s":3.84,"end_s":9.36,"text":"like youtube netflix and hulu work without it you wouldn't be able to","speaker":null,"is_sponsor":0},{"start_s":7.44,"end_s":13.44,"text":"stream such high quality high frame videos like this one first some math","speaker":null,"is_sponsor":0},{"start_s":11.92,"end_s":18.4,"text":"let's say you're watching a video with a resolution of","speaker":null,"is_sponsor":0},{"start_s":15.759,"end_s":23.439,"text":"pixels that's like 2 million pixels per frame and in this case you've got 30","speaker":null,"is_sponsor":0},{"start_s":20.32,"end_s":26.16,"text":"frames per second that's a whopping 62","speaker":null,"is_sponsor":0},{"start_s":23.439,"end_s":31.359,"text":"million pixels per second if each pixel needs 24 bits or three bytes of","speaker":null,"is_sponsor":0},{"start_s":28.4,"end_s":37.36,"text":"information you're looking at 178 megabytes of data per second completely","speaker":null,"is_sponsor":0},{"start_s":34.8,"end_s":41.44,"text":"uncompressed that would be 51 gigabytes of information for a single five minute","speaker":null,"is_sponsor":0},{"start_s":39.6,"end_s":44.399,"text":"video we've got pretty fast internet here at the office but even we can only","speaker":null,"is_sponsor":0},{"start_s":43.28,"end_s":49.12,"text":"download like two and a half gigabytes in five minutes","speaker":null,"is_sponsor":0},{"start_s":46.8,"end_s":52.559,"text":"that's a long ways away from 51. fortunately a five minute high","speaker":null,"is_sponsor":0},{"start_s":50.559,"end_s":58.879,"text":"definition youtube video is not 51 gigabytes it's in fact more like 72","speaker":null,"is_sponsor":0},{"start_s":55.68,"end_s":61.199,"text":"megabytes that's like 700 times smaller","speaker":null,"is_sponsor":0},{"start_s":58.879,"end_s":67.2,"text":"how did they do that that's the magic of video compression which works mostly by","speaker":null,"is_sponsor":0},{"start_s":63.84,"end_s":68.64,"text":"minimizing redundancy in the video data","speaker":null,"is_sponsor":0},{"start_s":67.2,"end_s":72.799,"text":"now there are all sorts of different ways to compress video and lots of","speaker":null,"is_sponsor":0},{"start_s":70.64,"end_s":76.0,"text":"different video containers and codecs but i won't go into detail about that","speaker":null,"is_sponsor":0},{"start_s":74.4,"end_s":79.759,"text":"because last already covered it in this episode and frankly i still don't really","speaker":null,"is_sponsor":0},{"start_s":78.24,"end_s":84.96,"text":"understand it all even though i am employed as a video editor so don't tell","speaker":null,"is_sponsor":0},{"start_s":82.479,"end_s":89.52,"text":"Linus so here's what you need to know there are two ways to compress video","speaker":null,"is_sponsor":0},{"start_s":87.439,"end_s":95.04,"text":"spatial compression and temporal compression also known as intra-frame","speaker":null,"is_sponsor":0},{"start_s":92.32,"end_s":98.159,"text":"and interframe respectively seriously who names this stuff","speaker":null,"is_sponsor":0},{"start_s":96.56,"end_s":103.6,"text":"anyway i'm going to describe each of these in terms of the jpeg image format","speaker":null,"is_sponsor":0},{"start_s":100.4,"end_s":105.84,"text":"and the mpeg video format spatial or","speaker":null,"is_sponsor":0},{"start_s":103.6,"end_s":110.72,"text":"intra-frame compression is applied only to individual video frames to compress a","speaker":null,"is_sponsor":0},{"start_s":108.64,"end_s":115.6,"text":"video frame you can use the same process that's used to compress a still image","speaker":null,"is_sponsor":0},{"start_s":112.56,"end_s":117.36,"text":"like a jpeg when a jpeg is created color","speaker":null,"is_sponsor":0},{"start_s":115.6,"end_s":121.439,"text":"information of the image is reduced in a process called chroma sub sampling and","speaker":null,"is_sponsor":0},{"start_s":119.52,"end_s":126.64,"text":"then the image is split into sections of 8x8 pixels called macroblocks then all","speaker":null,"is_sponsor":0},{"start_s":124.64,"end_s":130.959,"text":"of this fancy stuff is done to these blocks to further reduce the file size","speaker":null,"is_sponsor":0},{"start_s":128.879,"end_s":134.959,"text":"it's easy to see this effect on an image that has been saved with a high amount","speaker":null,"is_sponsor":0},{"start_s":132.72,"end_s":138.8,"text":"of compression all those ugly looking squares are known as compression","speaker":null,"is_sponsor":0},{"start_s":136.64,"end_s":142.64,"text":"artifacts some images like this red square can be compressed more than","speaker":null,"is_sponsor":0},{"start_s":140.56,"end_s":146.8,"text":"others like this complicated photograph because the red square is very simple","speaker":null,"is_sponsor":0},{"start_s":144.56,"end_s":152.64,"text":"with a lot more redundancy so that's how a jpeg uses spatial compression now for","speaker":null,"is_sponsor":0},{"start_s":149.52,"end_s":154.239,"text":"an mpeg sometimes called a motion jpeg","speaker":null,"is_sponsor":0},{"start_s":152.64,"end_s":158.239,"text":"things are a bit more complicated than just lining up a whole bunch of jpegs","speaker":null,"is_sponsor":0},{"start_s":156.319,"end_s":164.319,"text":"one after the other to be used as video frames doing it that way would not allow","speaker":null,"is_sponsor":0},{"start_s":160.879,"end_s":166.48,"text":"for inter frame or temporal compression","speaker":null,"is_sponsor":0},{"start_s":164.319,"end_s":171.28,"text":"temporal compression works again by reducing redundancy if you go through a","speaker":null,"is_sponsor":0},{"start_s":169.04,"end_s":174.72,"text":"video like this one frame by frame you'll notice that many frames are","speaker":null,"is_sponsor":0},{"start_s":172.64,"end_s":178.8,"text":"almost completely identical that's redundancy which can be easily","speaker":null,"is_sponsor":0},{"start_s":176.64,"end_s":182.239,"text":"compressed for example for all the parts of this video that don't need to change","speaker":null,"is_sponsor":0},{"start_s":180.4,"end_s":186.0,"text":"from one frame to the next like all this whiteness around me all we need is an","speaker":null,"is_sponsor":0},{"start_s":184.4,"end_s":191.36,"text":"instruction for those parts of the frame which says don't change anything like","speaker":null,"is_sponsor":0},{"start_s":188.64,"end_s":196.239,"text":"jpeg the mpeg standard breaks a video frame into 8x8 pixel macro blocks and","speaker":null,"is_sponsor":0},{"start_s":194.4,"end_s":200.159,"text":"each macro block receives instructions on what to do with the pixels they","speaker":null,"is_sponsor":0},{"start_s":197.92,"end_s":204.64,"text":"already have there are instructions for staying exactly the same for moving","speaker":null,"is_sponsor":0},{"start_s":202.56,"end_s":209.2,"text":"rotating changing color changing completely and so on video frames with","speaker":null,"is_sponsor":0},{"start_s":207.28,"end_s":213.92,"text":"instructions like this are called p frames and they use about half as much","speaker":null,"is_sponsor":0},{"start_s":211.36,"end_s":217.599,"text":"data as an iframe which is pretty much just a jpeg","speaker":null,"is_sponsor":0},{"start_s":215.519,"end_s":223.04,"text":"there are also b frames which are predictions or interpolations between i","speaker":null,"is_sponsor":0},{"start_s":220.56,"end_s":226.879,"text":"and p frames b frames use a quarter as much data as an iframe so they really","speaker":null,"is_sponsor":0},{"start_s":224.959,"end_s":231.04,"text":"save a lot of space this is all pretty easy to see on a video file that has","speaker":null,"is_sponsor":0},{"start_s":228.799,"end_s":234.64,"text":"been saved in an extremely low quality setting like what you're seeing right","speaker":null,"is_sponsor":0},{"start_s":232.48,"end_s":238.56,"text":"now again all these awful square thingies are called compression","speaker":null,"is_sponsor":0},{"start_s":236.159,"end_s":242.879,"text":"artifacts furthermore sometimes a video file will be corrupted or missing some","speaker":null,"is_sponsor":0},{"start_s":240.799,"end_s":246.239,"text":"data when that happens you get an effect like this one","speaker":null,"is_sponsor":0},{"start_s":244.159,"end_s":249.92,"text":"this particular effect is caused by a missing iframe which would have cleared","speaker":null,"is_sponsor":0},{"start_s":248.319,"end_s":254.799,"text":"away the old image to make room for a new one without the iframe the list of","speaker":null,"is_sponsor":0},{"start_s":252.159,"end_s":259.28,"text":"changes in the following b and p frames are applied to the wrong image so now","speaker":null,"is_sponsor":0},{"start_s":257.28,"end_s":264.24,"text":"you know why a video sometimes looks weird or gets all blocky those artifacts","speaker":null,"is_sponsor":0},{"start_s":261.919,"end_s":268.72,"text":"are a result of the video compression being either too high or else some kind","speaker":null,"is_sponsor":0},{"start_s":266.639,"end_s":272.88,"text":"of error in the coding or transmission of the video data now listen if none of","speaker":null,"is_sponsor":0},{"start_s":270.96,"end_s":277.36,"text":"that made any sense everything i've said can be broken down to one thing","speaker":null,"is_sponsor":0},{"start_s":275.12,"end_s":282.8,"text":"bit rate the bit rate is the amount of data or bits that are being used every","speaker":null,"is_sponsor":0},{"start_s":280.08,"end_s":286.639,"text":"second if a video has a low bid rate it will be low resolution and or low","speaker":null,"is_sponsor":0},{"start_s":284.96,"end_s":291.6,"text":"quality with lots of compression artifacts if a video has a high bitrate","speaker":null,"is_sponsor":0},{"start_s":289.199,"end_s":296.479,"text":"it will be high quality and or high resolution so the more bits you have to","speaker":null,"is_sponsor":0},{"start_s":294.16,"end_s":300.639,"text":"work with the better the video will look there's just no getting around that even","speaker":null,"is_sponsor":0},{"start_s":298.32,"end_s":305.52,"text":"with the best compression methods video compression is a balancing act between a","speaker":null,"is_sponsor":0},{"start_s":302.72,"end_s":310.0,"text":"good looking video or a small file size you can't have both but if compromise is","speaker":null,"is_sponsor":0},{"start_s":307.84,"end_s":313.759,"text":"not your style maybe you'll like fractal design now i'm sure you've all grown","speaker":null,"is_sponsor":0},{"start_s":312.08,"end_s":319.039,"text":"accustomed to embarrassing torturous events happening to line us in these","speaker":null,"is_sponsor":0},{"start_s":315.44,"end_s":319.039,"text":"spots let's look at them now","speaker":null,"is_sponsor":0},{"start_s":320.16,"end_s":326.08,"text":"behind in this manner","speaker":null,"is_sponsor":0},{"start_s":324.0,"end_s":329.52,"text":"speaking of mean fractal design is that buying up all of my advertising","speaker":null,"is_sponsor":0},{"start_s":327.6,"end_s":334.56,"text":"inventory so i was a little nervous about doing this ad i am however","speaker":null,"is_sponsor":0},{"start_s":332.0,"end_s":338.56,"text":"relieved to say that josh has granted me a reprieve i guess Linus is the one he","speaker":null,"is_sponsor":0},{"start_s":336.72,"end_s":343.039,"text":"wants to torture so we're using this spot to thank all of you the viewers who","speaker":null,"is_sponsor":0},{"start_s":340.88,"end_s":346.72,"text":"went to the survey page and responded so positively to our previous fractal","speaker":null,"is_sponsor":0},{"start_s":344.8,"end_s":350.4,"text":"design ads as fast as possible that they've decided to continue sponsoring","speaker":null,"is_sponsor":0},{"start_s":348.479,"end_s":354.639,"text":"this show so thanks to you guys and thanks to fractal design the company","speaker":null,"is_sponsor":0},{"start_s":352.24,"end_s":358.08,"text":"whose cases power supplies and fans bring all of the boys to all of the","speaker":null,"is_sponsor":0},{"start_s":356.24,"end_s":361.919,"text":"yards be sure to check back over the next few weeks to learn just what that","speaker":null,"is_sponsor":0},{"start_s":360.0,"end_s":366.08,"text":"reference might mean thanks for watching this episode of fastest possible give us","speaker":null,"is_sponsor":0},{"start_s":364.0,"end_s":371.759,"text":"a like or a dislike leave a comment subscribe do it subscribe and we'll see","speaker":null,"is_sponsor":0},{"start_s":369.039,"end_s":371.759,"text":"you next time","speaker":null,"is_sponsor":0}],"full_text":"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"}