Ibrahim 2 hours ago
Ibrahim 2 hours ago
As more people watch more high-quality videos across more screens, we need video formats that provide better resolution without increasing bandwidth usage. That’s why we started encoding YouTube videos in VP9, the open-source codec that brings HD and even 4K (2160p) quality at half the bandwidth used by other known codecs.
VP9 is the most efficient video compression codec in widespread use today. In the last year alone, YouTube users have already watched more than 25 billion hours of VP9 video, billions of which would not have been played in HD without VP9's bandwidth benefits. And with more of our device partners adopting VP9, we wanted to give you a primer on the technology.
How VP9 works
Videos hold a lot of information. If video were stored in the same format that a camera sensor uses when shooting a scene, the resulting files would be enormous — raw 4K is up to 18,000 Mbps! Instead, modern video compression looks at a video more like a person might, by encoding a description of the features in a scene, and tracking how those features move and change. This compression is hundreds of times more efficient than a camera sensor's recording and is what makes video streaming possible.
While VP9 uses the same basic blueprint as previous codecs, the WebM team has packed improvements into VP9 to get more quality out of each byte of video. For instance, the encoder prioritizes the sharpest image features, and the codec now uses asymmetric transforms to help keep even the most challenging scenes looking crisp and block-free.
Here's a comparison between the image quality you'd get watching Janelle Monaé with VP9 or legacy H.264 transcodes on a 600Kbps connection:
Bringing quality to the people
This new format bumps everybody one notch closer to our goal of instant, high-quality, buffer-free videos. That means that if your Internet connection used to only play up to 480p without buffering on YouTube, it can now play silky smooth 720p with VP9.
VP9 also has benefits for people with limited bandwidth or expensive data plans. By cutting bitrates in as much as half, it dramatically increases the set of users that can watch 360p quality video without increased rebuffering or cost.
Opening the door to 4K
And for those who can never get enough pixels (including your humble author!), VP9 unlocks the burgeoning world of 4K videos. At larger video sizes, VP9 actually gets even more efficient than its predecessors, so uninterrupted 4K content can now be streamed by a significant and growing part of the YouTube audience. The amount of 4K video uploaded to YouTube has more than tripled in the past year, and VP9 helps us plan for improved streaming into the future. You can find 4K videos by using the search filter, or see some of our favorites in this playlist.
Where can I use VP9?
Thanks to our device partners, VP9 decoding support is available today in the Chrome web browser, in Android devices like the Samsung Galaxy S6, and in TVs and game consoles from Sony, LG, Sharp, and more. More than 20 device partners across the industry are launching products in 2015 and beyond using VP9.
Steven Robertson, Software Engineer, recently watched “St. Lucia - Before The Dive.”
- Add more replicas for better read throughput and data durability
- Introduce sharding to scale your write throughput and let your data set grow beyond a single machine
- Create separate replica pools for batch jobs and backups, to isolate them from live traffic
- Clone the whole deployment into multiple datacenters worldwide for disaster recovery and lower latency
At YouTube, we went on that journey as we scaled our MySQL deployment, which today handles the metadata for billions of daily video views and 300 hours of new video uploads per minute. To do this, we developed the Vitess platform, which addresses scaling challenges while hiding the associated complexity from the application layer.
- Horizontal scaling – add capacity by launching additional nodes rather than making one huge node
- Dynamic placement – let the cluster manager schedule Vitess containers wherever it wants
- Declarative specification – describe your desired end state, and let the cluster manager create it
- Self-healing components – recover automatically from machine failures
In this environment, Vitess provides a MySQL storage layer with improved durability, scalability, and manageability.
How you can migrate
Over the last four years, we’ve worked with browser vendors and the broader community to close those gaps, and now, YouTube uses HTML5 <video> by default in Chrome, IE 11, Safari 8 and in beta versions of Firefox.
The benefits of HTML5 extend beyond web browsers, and it's now also used in smart TVs and other streaming devices. Here are a few key technologies that have enabled this critical step forward:
Adaptive Bitrate (ABR) streaming is critical for providing a quality video experience for viewers - allowing us to quickly and seamlessly adjust resolution and bitrate in the face of changing network conditions. ABR has reduced buffering by more than 50 percent globally and as much as 80 percent on heavily-congested networks. MediaSource Extensions also enable live streaming in game consoles like Xbox and PS4, on devices like Chromecast and in web browsers.
VP9 video codec
HTML5 lets you take advantage of the open VP9 codec, which gives you higher quality video resolution with an average bandwidth reduction of 35 percent. These smaller files allow more people to access 4K and HD at 60FPS -- and videos start 15-80 percent faster. We've already served hundreds of billions of VP9 videos, and you can look for more about VP9 in a future post.
Encrypted Media Extensions and Common Encryption
In the past, the choice of delivery platform (Flash, Silverlight, etc) and content protection technology (Access, PlayReady) were tightly linked, as content protection was deeply integrated into the delivery platform and even the file format. Encrypted Media Extensions separate the work of content protection from delivery, enabling content providers like YouTube to use a single HTML5 video player across a wide range of platforms. Combined with Common Encryption, we can support multiple content protection technologies on different platforms with a single set of assets, making YouTube play faster and smoother.
YouTube enables everyone to share their videos with the world, whether uploading pre-recorded videos or broadcasting live. WebRTC allows us to build on the same technology that enables plugin-free Google Hangouts to provide broadcasting tools from within the browser.
Using the new fullscreen APIs in HTML5, YouTube is able to provide an immersive fullscreen viewing experience (perfect for those 4K videos), all with standard HTML UI.
Moving to <iframe> embeds
Given the progress we've made with HTML5 <video>, we’re now defaulting to the HTML5 player on the web. We're also deprecating the "old style" of Flash <object> embeds and our Flash API. We encourage all embedders to use the <iframe> API, which can intelligently use whichever technology the client supports.
These advancements have benefitted not just YouTube’s community, but the entire industry. Other content providers like Netflix and Vimeo, as well as companies like Microsoft and Apple have embraced HTML5 and been key contributors to its success. By providing an open standard platform, HTML5 has also enabled new classes of devices like Chromebooks and Chromecast. You can support HTML5 by using the <iframe> API everywhere you embed YouTube videos on the web.
Richard Leider, Engineering Manager, recently watched, “Ex Hex - Waterfall.”
To bring you closer to the people and projects that make YouTube tick, we’re launching the YouTube Engineering and Developers Blog. About once a month, expect to see behind-the-scenes explanations, tools and tips for developers, and explanations of the most fundamental and interesting technical challenges at YouTube.
We look forward to hearing what you think about these topics, so please let us know in the comments or with a video!
Posted by the YouTube team
With the new YouTube WatchMe for Android project, you can easily integrate YouTube Live Streaming into your Android app. YouTube WatchMe brings your app the same live broadcasting capabilities that you've seen in great apps like Live on YouTube – by Xperia™ and Re – by HTC.
- Sync the Github repo
- In your Google Developer Console,
- Enable the Youtube Data API v3 and Google+ API.
- Create a client ID for Android, using your SHA1 and package name.
- Include cross-platform compiled streaming libraries.
- libffmpeg.so under src/main/jniLibs/armeabi,
- another streaming library with modifying VideoStreamingInterface