YouTube details ‘Project Butter’ initiative for smoother video in Chrome
With YouTube video as the motivation, Chrome recently received some enhancements to make the video experience as smooth as possible across devices. Dubbed “Project Butter” (not that Project Butter), YouTube engineers worked together with Chrome engineers to make optimizations to video playback.
YouTube engineers walked us through their thought process with the optimizations in a blog post:
Your device’s screen redraws itself at a certain frame rate. Videos present frames at a certain rate. These rates are often not the same. At YouTube we commonly see videos authored at 24, 25, 29.97, 30, 48, 50, 59.94, and 60 frames per second (fps) and these videos are viewed on displays with different refresh rates – the most common being 50Hz (Europe) and 60Hz (USA)… For a video to be smooth we need to figure out the best, most regular way to display the frames – the best cadence. The ideal cadence is calculated as the ratio of the display rate to frame rate. For example, if we have a 60Hz display (a 1/60 second display interval) and a 30 fps clip, 60 / 30 == 2 which means each video frame should be displayed for two display intervals of total duration 2 * 1/60 second.
Using that math, the team was able to come up with an algorithm that will allow Chrome to auto adjust to the optimal settings based on the display and the quality of the video being streamed. The improvements were introduced with Chrome 44:
In Chrome 44, we re-architected the media and compositor pipelines to communicate carefully about the intent to generate and display. Additionally, we also improved which video frames to pick by using the optimal display count information. With these changes, Chrome 44 significantly improved on smoothness scores across all video frame rates and display refresh rates… Smooth like butter
YouTube has more on the enhancements for video in Chrome 44 in its blog post here.
Google’s original Project Butter debuted with the announcement of Android 4.1 Jelly Bean, as an initiative to make the Android experience smoother and more user-friendly. For its purpose, the project was a success — Android 4.4 went on to become one of the most stable and beloved versions of Android yet, and was succeeded by Lollipop, a complete revamp that reinvented Android from the ground up.
As you may know, the current stable release of Chrome is version 46, and version 44 stable was released a few months ago.