Panasonic Gh4

Mar 012013
 

So here is a random curiosity I have always had; what are the optimal export settings one should use for video that is intended for YouTube or Vimeo? I figured the first step is to understand what goes on when you send your video to YouTube or Vimeo. I read the recommended export settings on YouTube and wanted to see if what they recommend is optimal.

Here is the YouTube page that explains what settings you should use when exporting your video. You will notice that they recommend to use 8000 Kbps = 7.81 Mbps for 1080p encoding and 384 kbps for stereo audio. If your exporting 720p, they recommend 5000 Kbps = 4.88 Mbps for video and the same 384 kbps for stereo audio. Right off the bat I notice that 8000 Kbps is a decent bit rate for online video. The 384 kbps for audio is way too high, you won’t need anything over 192 kbps for online audio. If your a person who stresses over specs rather than actual performance gain, go ahead and use 384 kbps for audio. So if your recording a screen with Camtasia or something, I recommend using ~8000 Kbps, .mov, with 192kbps audio. For DSLRs, read on:

YouTube Video Compression:

I used one initial test file for this half-assed test of mine. It was 3.0 seconds long and was about 16.7MB (17,183 kb to be exact). The normal bit rate for 1080p videos off of my Canon 60D is about 45 Mbps (including audio). So it’s almost 7x YouTube’s recommended settings. I uploaded the uncompressed file (by uncompressed I mean no further compression after the in-camera compression) and then downloaded it off of YouTube. 16.7 MB turned into 2.27 MB.

Original clip off of camera (1:1 crop)

Tahoe Raw

Original clip as seen on to YouTube (1:1 crop)

Tahoe Youtube Raw

The dark clouds located at the top of the frame are a bit more washed out. Particularly the dark cloud on the left side of the frame. If your monitor is decently calibrated, you should notice that while the dark clouds are a slightly darker/more contrasty, they clearly have less detail. Furthermore there is a bit less detail seen throughout the mountain. Overall, the differences are subtle, and you really need to look close to spot it.

Original clip off of camera (1:1 crop)

Tahoe Raw2

Original clip as seen on YouTube (1:1 crop)

Tahoe Youtube Raw2

Here I clearly see less detail in the upper parts of the water. Also the wood beam has significantly less detail in it because the darks were crushed, particularly the left side of the beam. Still, the differences are not drastic.

When I compared the entire images, I noticed that for the most part, the darks got fairly crushed. I could not make out detail in the dark parts of the mountains, nor could I see the detail in the wood that is in the foreground. The whole image got a bit softer as well, I was quite shocked at the loss of sharpness in the YouTube version. There was less detail seen when observing the faint clouds and the brighter parts of the mountains. The color seemed to be a bit different, but most likely that is just the darks being crushed. All in all, the difference was very easy to spot @ 1080p.

After seeing these results, I figured if I compress the original 16.7 MB file a bit, maybe YouTube will leave it alone when I upload it. So I rendered the 16.7MB file out in After Effects.

I exported the file using h.264 with a target bit rate of about 15,000 Kbps (maybe it was 10,000 Kbps, not sure).  The file size ended up being almost 4 MB (4,053 kb). And when I uploaded it to YouTube and then downloaded it, I saw that the file was once again compressed by YouTube down to roughly the same 2.27MB size. The difference between the 4MB file and the 2.27MB file was slightly noticeable. I had to look for it to see it:

Compressed clip as seen on YouTube (1:1 crop)

Tahoe Youtube Compressed

Compressed clip as seen on YouTube (1:1 crop)

Tahoe Youtube Compressed2

Compressing the file before uploading it to YouTube did not result in a better playback quality on YouTube. To my eye, it was a mixed bag of nuts. Some parts seemed to retain more detail, while others seemed to lose detail. The wooden beam was a bit less crushed, but the dark clouds were fainter and had less detail.

Lake Tahoe Video
Name MVI_5798 Original MVI_5798 15Mbps
Origianl Size 17,183,816 bytes 4,053,165 bytes
(MB) 16.3 MB 3.86 MB
Bit rate 43.47Mbps 10.3Mbps
Youtube Size 2,327,076 bytes 2,261,559 bytes
(MB) 2.21 MB 2.15 MB
Youtube Bit rate 5.89Mbps 5.73Mbps

The ambiguity in the bit rate used for the compressed export (15Mbps vs 10Mbps ) is something I will have to revisit. The reason I want to revisit this issue is because all my subsequent 10Mbps exports that I uploaded onto YouTube outperformed the uncompressed uploads in terms of bit rate. The Lake Tahoe video was the only case where this did not happen. The conclusion I have drawn is this; YouTube is going to target the bit rate of your original Canon file size to some random bit rate. So lets assume the bit rate of your Canon footage is 45Mbps. Your YouTube bit rate for that file is always going to be some fraction of your original bit rate, which sucks because the Canon footage is already extremely compressed to start off with. With a basic understanding of what YouTube is doing, I decided to research this topic further and more scientifically by uploading a series of videos.

The first video (Garage) consisted of a dark setting with a tiny bit of movement. The second video (Outdoor Pan) consisted of a high dynamic range environment with lots of camera movement. The final video (Indoor Pan) consisted of a high dynamic range environment with lots of camera movement. The test I conducted consisted of feeding YouTube multiple bit rate versions of the same file, here are my results:

Garage
Name MVI_5587 Original MVI_5587 10Mbps MVI_5587 3.5Mbps
Origianl Size 85,689,548 bytes 13,061,619 bytes 6,535,919 bytes
(MB) 81.7 MB 12.4 MB 6.23 MB
Bit rate 46.35Mbps 7.04Mbps 3.53Mbps
Youtube Size 5,514,753 bytes 6,193,311 bytes 5,803,427 bytes
(MB) 5.26 MB 5.91 MB 5.53 MB
Youtube Bit rate 2.98Mbps 3.35Mbps 3.14Mbps
Compression Ratio 0.064381885 0.072337821 0.067686659

As you can see, the 10Mbps export produced the least compressed file on YouTube. In fact the difference in bit rate was quite shocking, the 10Mbps version had a bit rate on YouTube that was 12.3% higher than the bit rate of the uncompressed file. Visually, the files I compressed and then uploaded outperformed the original uncompressed file.

Original clip off of camera (1:1 crop)

WiresRaw

 

Original clip as seen on YouTube (1:1 crop)

WiresRaw Youtube Uncompressed

The differences should jump out at you. The highlights at the bottom part of the frame got completely blown out, and the darks throughout the frame got crushed. If your monitor is decently calibrated you should see that in the original image there is white/grey smoke in the dark background one the upper right side of the frame. That grey detail has been greatly reduced in the YouTube version of the clip.

Compressed clip as seen on YouTube (1:1 crop)

Wires Youtube compressed

When I compressed the clip and then uploaded it, I was able to retain some of that dynamic range; the highlights were less blown out and the darks were less crushed. I see much more of the grey smoke detail in the upper right side of the frame. Unfortunately there are more blocking artifacts throughout the frame causing the image to become slightly less sharp. Because I never watch YouTube videos @ 1080p in full screen mode (I watch them in the condensed player size @ 720p), I would likely not see this loss in sharpness. But I defiantly would see the increased dynamic range in the player so personally I would choose compressing the video first and the uploading it to YouTube.

Outdoor Pan
Name MVI_3340 Original MVI_3340 10Mbps MVI_3340 “Optimal”
Origianl Size 115,055,917 bytes 21,646,150 bytes 13,565,186 bytes
(MB) 109 MB 20.6 MB 12.9 MB
Bit rate 43.38Mbps 8.2Mbps 5.13Mbps
Youtube Size 11,571,846 bytes 11,661,559 bytes 11,394,817 bytes
(MB) 11.0 MB 11.1 MB 10.8 MB
Youtube Bit rate 4.38Mbps 4.42Mbps 4.3Mbps
Compression Ratio 0.100917431 0.101834862 0.837209302

Again the 10Mbps file outperformed the rest of my settings. After the first two renders, I saw that YouTube wanted my file to be about 11.0 MB. So I made a third file called “Optimal”. I figured I would compress this file down to 11MB in After Effects so that YouTube would not have to do any work. Anyway, After Effects rendered it out to 12.9MB, and I uploaded that to YouTube. I was shocked to see that despite my aggressive rendering the “Optimal” file ended up having the lowest bit rate of the bunch. Again, the compressed versions of the file beat out the original file visually in the YouTube player.

Original clip off of camera (1:1 crop)

Shrubs Raw

Original clip as seen on YouTube (1:1 crop)

Shrubs Youtube Raw

Wow! A complete mess. This time, YouTube completely crushed the detail in the shadows. You literally see zero detail throughout many of the bushes. Notice how the sky in the background is less blue as well.

Compressed clip as seen on YouTube (1:1 crop)

 Shrubs Youtube Compressed

 While this clip has more blocking artifacts, it also has more dynamic range. I can see way more detail throughout the bushes. The choice for me is a slam dunk; compressed it first, then upload to youtube.

Indoor Pan
Name MVI_3341 Original MVI_3341 10Mbps
Origianl Size 55,327,859 bytes 9,124,392 bytes
(MB) 52.7 MB 8.70 MB
Bit rate 46.33Mbps 7.65Mbps
Youtube Size 4,097,170 bytes 4,424,210 bytes
(MB) 3.90 MB 4.21 MB
Youtube Bit rate 3.43Mbps 3.7Mbps
Compression Ratio 0.074003795 0.079886148

Once again, my test confirmed what I knew already; compressing your video down to around 10Mbps and then uploading it will result in a higher bit rate than uploading your uncompressed footage strait into YouTube. So it turns out that YouTube’s advice about exporting your files at about 8,000 Mbps is great advice. 8,000 Mbps compression being optimal is consistent with my findings of 10,000 Mbps beating the competition. So in my opinion, if you compress your file to somewhere between 12,000 Mbps and 8,000 Mbps you will be getting optimal performance from YouTube. Visually, the original uncompressed file was handled the worst by YouTube.

Original clip off of camera (1:1 crop)

Books Raw

Original clip as seen on YouTube (1:1 crop)

Books Raw Youtube

The result here is even worse than the result we observed with the bushes. YouTube just decided to make a bunch of the detail disappear by making it black.

 Compressed clip as seen on YouTube (1:1 crop)

Books Compressed Youtube

As usual, my compressed version of the clip shows more dynamic range. And, sadly it shows more blocking. But keep in mind these pictures I am showing you are 1:1 crops @ 1080p. If you watch the videos at 720p or 480p, you likely will not see much blocking. The loss of sharpness due to blocking only comes into play when you watch the footage at 1080p and sit close to the screen.

GH4Ad

Vimeo Video Compression:

The Vimeo test was not as thorough because I don’t have a Vimeo Plus or Vimeo Pro account, meaning I am limited to only one HD upload a week. My initial Vimeo test consisted of uploading the same two Lake Tahoe files that I uploaded onto YouTube. The compression of the SD Vimeo stream was slightly more severe for the 16.7MB file. My 16.7MB file got compressed down to 254KB in SD mode, while my 4MB compressed version of the file got compressed down to 262KB. The SD footage looked similarly awful for both clips. Like YouTube, Vimeo likes to compress your file down to a certain size, regardless of what bit rate you feed it.

The HD file came out to be 962KB. It seems small, but is quite comparable to YouTube because Vimeo only outputs 1080p for Pro users. For Vimeo Plus* and regular members the HD stream is 720p (2.25x less pixels than 1080p). So if I multiply the 962KB by 2.25, I will get a rough estimate of the 1080p bit rate, which would be 2164.5 KB. Sadly, 2164.5 KB is lower than the Youtube 1080p bit rate I was getting (2324.48 KB). To my eye the 720p footage looked the same in both players. I often hear people suggesting that Vimeo is superior to YouTube because the great video quality. I didn’t see it after my initial test.

* I believe there is some option for Plus members to enable 1080p videos. I am not 100% sure.

After comparing the Tahoe videos, I moved on to the other test files. This is where the difference jumped out at me. Vimeo’s 720p file for for the uncompressed garage video had a file size of 3,165KB (3,240,136 bytes). Multiplying this by 2.25, we get 7,290,306 bytes, for a 1080p equivalent. This smokes the YouTube bit rate by over 32%. But lets not focus on the bit rates. As I showed previously, a higher bit rate doesn’t mean anything. More important is the method of compression. If it is compressed well, then it will look better than if it was compressed poorly. And as I showed visually, YouTube does not compress files as well as After Effects or Premier does with respect to dynamic range. So how does Vimeo compress its files? Very well. In  fact, you don’t even need to precompress your files. You can just upload your files off of your camera right onto Vimeo, and Vimeo will compress your file in a way that preserves the detail and color. No compression required on your end. I uploaded the 10Kbps bit rate version of the garage file which resulted in a 3,198KB file size on Vimeo. Visually, there was no difference between the 10Kbps version and the uncompressed version of the garage file.

Conclusion:

Uploading uncompressed files onto YouTube is disastrous if you care about preserving your dynamic range. If you are using high bit rate DSLR files, I encourage you to precompress them before you upload them onto YouTube. I personally use After Effects to achieve this, but you can use Sony Vegas, Adobe Premiere, Avid, Final Cut, or a stand alone compression software to get the job done. I found the bit rate sweet spot to be around 10Mbps. If you compress and then upload, your footage will have a higher dynamic range on YouTube at the expense of macroblocking artifacts. Personally, I doubt most people watch YouTube in full screen mode, so I think the macroblocking is not a big deal.

If you upload uncompressed footage onto Vimeo, it will look about the same in the Vimeo video player as the compressed version of the footage. So basically it doesn’t matter what you do on Vimeo because Vimeo spits out a high quality file either way. Your file still gets compressed a ton. Nothing on Vimeo or YouTube will ever look as good as the footage stored on your camera. Vimeo can store your uncompressed source files, but it will not play them in the video player. Vimeo only plays the compressed version of your source files in the video player. Personally, because I am limited to only 500MB of uploads a week, I would compress my footage at a bit rate of about 10Mbps and then upload it to Vimeo.

What looks better, YouTube footage or Vimeo footage?

Since the Vimeo player has a default resolution of about 960×540 pixels, SD footage looks awful on it. Vimeo takes the SD footage (which is 360p) and blows it up to 540P. So if you watch SD Vimeo footage on a laptop or something, sit further away from your screen. For standard definition video playback, the advantage goes to YouTube. Now, lets say you uploaded uncompressed footage onto YouTube and Vimeo, in that case the Vimeo footage will look much better if you care about dynamic range. Finally, lets say you take my advice and upload compressed footage onto YouTube @ around 10Mbps. Does that YouTube footage look as good as the Vimeo footage? In short; yes. I compared the compressed YouTube video files to the Vimeo files (remember, it doesn’t really matter what version of the Vimeo files I choose since the compressed versions look about the same as the uncompressed version) and the footage looked about the same. Certainly nothing to lose sleep over.

Personally, I will be exporting all my videos intended for internet playback at 10Mbps from now on.

1080p vs 720p Compression

In a nutshell, your video quality stays the same regardless of whether you export at 1080p or 720p. If you don’t have a plus or pro account on Vimeo, you should export at 720p so that you don’t use up your allocated storage space (you only get 500mb of uploads a week). For YouTube, you may as well upload at 1080p since YouTube allows you to upload as much as you want, and YouTube’s player plays HD @ 1080p (Vimeo, only plays HD at 720P for non plus/pro members). I ran tests on multiple files, and the compression looked exactly the same on 720p and 1080p videos. Furthermore, the file sizes had the same ratio with respect to resolution (file size was about 2.25x bigger for 1080p), confirming my observation.

I do my compression in Adobe After Effects and also in Adobe Encoder. You can encode in Adobe Premier as well. Any Adobe software will do a better job at compression than YouTube.

  5 Responses to “Youtube vs Vimeo Video Compression”

  1. Thank you very much for all that infos! ;-)

  2. I just encoded 20 vimeo videos at 1080p at 5mb/s. After reading this, should I re-encode to a higher bitrate? Will higher bit rates stutter playback for viewers on slower systems or internet connection? Is it worth the time…will 5 mb/s be noticeably worse?

    • Hi, based on my calculations the bitrate for a 1080p file played on Vimeo, is about the same as the bitrate on file played on Youtube (maxes out around 6mb/s for 1080p I think). The only difference is that Vimeo compresses way better/more efficiently. My Vimeo tests were not as in depth, so I got this estimate by comparing the file size I got from Vimeo’s compression of my Lake Tahoe video and comparing the size of the compressed file to YouTube’s compression. So, I don’t think anyone will notice the difference in a file compressed at 5mb/s vs 6mb/s on Vimeo. Keep in mind most people on Vimeo will only watch in 720p, so your file will be a bit smaller for them and maybe play even smoother. So I would defiantly keep the videos and not re-upload them since any picture quality gains would be very minor.

      As for stuttering; I think it is a Vimeo software problem or users’ computer problem rather than a bitrate problem. The reason I think this is because I can play 1080HD files on other websites, but on Vimeo even low quality SD videos stutter for me randomly. Also my crappy laptop seems to play HD Vimeo files better than my higher sepc’d PC. On Youtube, I never have playback problems. I think the best thing you can do is upload videos to Youtube and Vimeo in case some people can’t play Vimeo smoothly (plus Youtube videos get way more views).

  3. Poor comparison, the source video quality was horrendous. The average user won’t notice that minute difference. I rather you should have used a game instead.

    • Yeah the quality is shit because the source video on my DSLR is compressed as hell already. Do you mean I should record a game with Camtasia like Legue of Legends or something? I might do that, thanks for the idea.

 Leave a Reply

Login With a Social Account

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Film Brute