-->

YouTube如何编码视频

文章特色图片

I recently wrote three blog posts about the codecs YouTube uses to encode videos uploaded to the site. Looking back, I realize I was flying blind for the first two posts. 然后, based on data gathered using an application called youtube-dl, the 第三篇 provides the most useful hard data, including the exact encoding ladders used by Google for 4K videos with several million views. 

但我有点超前了. I should start by saying that I’m fascinated by how YouTube encodes its videos. It has the highest volume of incoming videos, 优秀的员工, 绰绰有余的预算, and a clear business need to craft the optimum solution. 今年七月的一天, I was creating a lesson for a new course and focused on the economics of codec deployment. Specifically, with AV1 taking about 18 times longer than H.264 to encode, I was wondering how many views it took to justify the cost of encoding with AV1. Where could I go for real-world evidence? 当然是YouTube. 

So, I started downloading 1080p videos and checking the codec in YouTube’s Stats for Nerds feature. 如我的 第一篇博文, I found that YouTube encoded videos with fewer than 3,000 views with H.264, started to deploy VP9 once videos ac­cumulated 3,500多的观点, and encoded with AV1 primarily on videos with more than 34 million views (or longtail videos that would likely accumulate that many). 

The two takeaways were that VP9 started to make economic sense with only a few thousand views, 但AV1需要数百万美元. 当然, YouTube最近推出了Argos, a video trans­coding chipset that accelerates VP9 encoding (but not AV1), so just because it makes sense for YouTube doesn’t mean that it makes sense for you. 

的起源 第二个与youtube相关的帖子 was a question from a reader who asked whether YouTube created an H.264 version of all encodes so that viewers without VP9 or AV1 playback capabilities would always have videos to play. The answer was yes, but only up to 1080p. 

I wondered whether YouTube encoded 2K/4K versions in AV1. 不像1080p视频, I didn’t see any 2K/4K files encoded with AV1, and I guessed that YouTube didn’t deploy AV1 for UHD videos because of the encoding cost. 然而,在一个 评论这篇文章, a LinkedIn reader noted that he downloaded a file list for a very popular 4K music video with youtube-dl and saw complete encoding ladders for AV1 and VP9, 包括2 k / 4 k, 这 H.264停在1080p. In addition, a LinkedIn colleague provided a link to download youtube-dl and documentation. 

Nothing motivates a researcher more than having a public guess proven wrong, 所以又掉进了兔子洞. youtube-dl提供的数据导致了 第三篇. I downloaded a file list for 10 4K music videos with multimillion views as well as a file list for the 壮志凌云2 trailer, then at about 18 million views. 如前所述, the file lists detailed all audio/video files created by YouTube, 包括决议, 数据速率, 和编解码器-一个真正的 编码数据的宝库. I also downloaded several videos from the file lists to spot-check the data.

Some key findings were that, as my Linked­In 同事建议, YouTube creates full AV1/VP9 ladders for very high-volume 4K videos, 包括2 k / 4 k, 但只能用H编码到1080p.264. Also, at 1080p, AV1 delivers 47% savings over H.264,比VP9节省21%. At 4K, AV1 delivers 28% savings over VP9.

I found these bandwidth savings particularly significant. Back in June 2019, I wrote a blog post called “嘿,AOM:牛肉在哪里?" was a response to yet another member of the Alliance for Open Media loudly proclaiming it was deploying AV1 to "embrace the open spirit," without mentioning details about how much bandwidth savings AV1 actually delivered. 开放的精神听起来很棒, but codecs don’t achieve widespread adoption until they demonstrate significant savings. 我很确定即使是 脾气暴躁的克拉拉·佩勒 会比H节省47%.264 at 1080p and a 28% savings over VP9 at 4K quite meaty.

流媒体覆盖
免费的
合资格订户
现在就订阅 最新一期 过去的问题
相关文章

你的编码阶梯有多少阶?

Streaming Learning Center's 1月时 explains the importance of adjusting the rungs on your encoding ladder in this clip from his presentation at 流媒体 Connect 2021.

Comparing Quality Metrics Up and Down the Encoding Ladder

How can publishers compare video quality at different resolutions? There's the theoretically correct answer and then there's how it's generally done.

Video: How To Build Your Encoding Ladder, Part 2: Resolution

Once you've decided on the bitrates that you want to deliver, it's time to determine the best resolution for each one, 从360p到1080p. Streaming Learning Center's 1月时 shows you how.

Video: How To Build Your Encoding Ladder, Part 1: Bitrates

Streaming Learning Center's 1月时 explains how to choose 数据速率s and resolutions for adaptive bitrate streaming to most effectively meet client expectations and end-user needs.