Engineering and Developers Blog
What's happening with engineering and developers at YouTube
Smoother <video> in Chrome
Tuesday, November 10, 2015
Video quality matters, and when an HD or HFR playback isn’t smooth, we notice. Chrome noticed. YouTube noticed. So we got together to make YouTube video playback smoother in Chrome, and we call it Project Butter.
For some context, our brains fill in the motion in between frames if each frame is onscreen the same amount of time - this is called
motion interpolation
. In other words, a 30 frames per second video won’t appear smooth unless each frame is spaced evenly each 1/30th of a second. Smoothness is more complicated than just this - you can read more about it in this
article by Michael Abrash at Valve
.
Frame rates, display refresh rates and cadence
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.
We played videos a bunch of different ways and scored them on smoothness.
Smoothness score
Using off the shelf
HDMI capture hardware
and some
special video clips
we computed a percentage score based on the number of times each video frame was displayed relative to a calculated optimal display count. The higher the score, the more frames aligned with the optimal display frequency. Below is a figure showing how Chrome 43 performed when playing a 30fps clip back on a 60Hz display:
Smoothness: 68.49%, ~Dropped: 5 / 900 (0.555556%)
The y-axis is the number of times each frame was displayed, while the x-axis is the frame number. As mentioned previously the calculated ideal display count for a 30fps clip on a 60Hz display is 2. So, in an ideal situation, the graph should be a flat horizontal line at 2, yet Chrome dropped many frames and displayed certain frames for as many as 4 display cycles! The smoothness score reflects this - only 68.49 percent of frames were displayed correctly. How could we track down what was going on?
Using some of the
performance tracing tools
built into Chrome, we identified
timing issues
inherent to the existing design for video rendering as the culprit. These issues resulted in both missed and irregular video frames on a regular basis.
There were two main problems in the interactions between Chrome’s
compositor
(responsible for drawing frames) and its media pipeline (responsible for generating frames) --
The compositor didn’t have a timely way of knowing when a video frame needed display. Video frames were selected on the media pipeline thread while the compositor would occasionally come along looking for them on the compositor thread, but if the compositor thread was busy it wouldn’t get the notification on time.
Chrome’s media pipeline didn’t know
when
the compositor would be ready to draw its next new frame. This led to the media pipeline sometimes picking a frame that was too old by the time the compositor displayed it.
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:
Smoothness: 99.33%, ~Dropped: 0 / 900 (0.000000%)
Smooth like butter. Read more in
public design document
, if you’re interested in further details.
Dale Curtis, Software Engineer, recently watched
WARNING: SCARIEST GAME IN YEARS | Five Nights at Freddy's - Part 1
Richard Leider, Engineering Manager, recently watched
Late Art Tutorial
.
Renganathan Ramamoorthy, Product Manager, recently watched
Video Game High School
YouTube Channels: Get with the Program!
Monday, September 24, 2012
It's never been easier to create compelling videos and build a social presence on YouTube. At this year's Google I/O, YouTube product managers and channel gurus Dror and A.J. presented tips and tricks for making great content centered around raising brand awareness, raising money, and obtaining feedback about your products and services.
Don't worry if you missed their talk, we recorded it! So, sit back, grab some popcorn, and get ready to learn how to showcase your brand in front of YouTube's 800 million unique visitors per month!
Click
here
to view the slides from the video above.
Not sold yet? Well, have a sneak peek at some of the great material they cover below, and remember Dror and A.J.’s number one recommendation:
make content, not commercials
!
Sneak Peek
Tips and Tricks
Hook the user in the first 15 seconds (or they'll leave)
Brand your channel!
Make the most of your budget
Review
YouTube’s Trends
for ideas
Camera shy?
Consider animation.
(It might actually be cheaper than video.)
Several successful channels focus on curating videos from their community
Enhance your videos without fancy software/hardware using the
YouTube Editor
or
other integrated web editors
Many, many more...
What's your goal?
Raising awareness
Master your PR via video (include all your features and make bloggers’ lives easier)
Provide product/service demo videos to promote your company
Tell backstories about clients using your products/services
Raising money
Add video to your crowdfunding pitch to increase funds raised by 114% (
source: Indiegogo
)
Researching and supporting users
Record tutorials to promote and educate (see which features are the most popular using
YouTube’s Analytics
... you might be surprised)
Use
Google Hangouts
for scalable office hours and virtual focus groups
Figure out what features customers like/dislike via the world’s largest focus group
Resources to learn more
Creator Hub
Creator Playbook
(what you wish you knew about YouTube)
Trends Dashboard
YouTube for Developers
(that’s us)
Wow, you made it this far without
watching the video
? Did we tell you they fill the presentation with awesome videos that showcase their points (including
Chuck Testa
)?
Nope!?
Well, now you know, and you will definitely want to
watch the whole thing!
-Jeremy Walker, YouTube API Team
Build awesome YouTube experiences with new APIs and tools
Wednesday, June 27, 2012
When we introduced the
first YouTube API
in 2005, we knew that it would be developers who would help us grow YouTube as a platform for connecting the world through video. At this year’s Google I/O, we’re continuing on with that mission through an
entire track dedicated to YouTube
, where we’re announcing new APIs and developer tools, as
well as a showcase of some of the most innovative apps built with YouTube.
Make mobile video shine
With mobile video now making up as much as
half of all mobile traffic
, your mobile experience needs video that’s high quality, fast and sleek. We want to give you the best tools to build these experiences, so we’re previewing the new
YouTube Android Player API
for high-quality and fluid video playback.
Engage with your communities through video
The next generation of
YouTube Direct
allows you to engage with your community by having them submit videos which you can then feature in playlists. YouTube Direct Lite is implemented in client-side JavaScript using
CORS
, and does not require any server-side deployments—adding it to your site is as simple as adding an
MMMmmm...data!
Retrieving analytics data for your videos used to mean downloading an archive of CSV files that you then had to process. Now, you can use our new
YouTube Analytics API
to build custom tools for your data. It's a RESTful web service that gives you the freedom to request customized reports containing only the data you care about. We’re also giving the
YouTube Data API
a facelift with new features like universal search and updated client libraries in 8 different languages.
Play, watch and learn from developers like you at Google I/O
We’ll be talking about these new features and other developer tools at Google I/O this week, so check out our
sessions
and
codelabs
, download the official
Google I/O app
, and follow online at developers.google.com/io. At I/O you can also visit with Developer Sandbox companies like
Flipboard
,
Dude Perfect
and
SONY PlayStation @ Home
who are building awesome experiences with YouTube APIs. We’ll also share our sessions on the
Google Developers YouTube Channel
, and you can always find us on
Google+
and our
developer forum
.
Cheers,
—Amanda Surya, YouTube API Team
YouTube APIs: Search Explained
Tuesday, May 5, 2009
In an alternate universe (where I have a goatee) I may be a voice actor instead of a Googler. However, since we live in this universe, the best I can do is make you a screencast about the YouTube API. Specifically, this video discusses the various search options we have in our Data API and the various limitations and caveats to keep in mind while integrating it into your program or website.
If our API documentation is like the printed manual in the box of a new purchase that you never read, think of this video as the one-page laminated card with pretty pictures on it telling you not to get crushed by a bookshelf or hurt your back. Enjoy!
Labels
.net
360
acceleration
access control
accessibility
actionscript
activities
activity
android
announcements
apis
app engine
appengine
apps script
as2
as3
atom
authentication
authorization
authsub
best practices
blackops
blur faces
bootcamp
captions
categories
channels
charts
chrome
chromeless
client library
clientlibraries
clientlogin
code
color
comments
compositing
create
curation
custom player
decommission
default
deprecation
devs
direct
discovery
docs
Documentation RSS
dotnet
education
embed
embedding
events
extension
feeds
flash
format
friendactivity
friends
fun
gears
google developers live
google group
googlegamedev
googleio
html5
https
iframe
insight
io12
io2011
ios
iphone
irc
issue tracker
java
javascript
json
json-c
jsonc
knight
legacy
Live Streaming API
LiveBroadcasts API
logo
machine learning
mashups
media:keywords keywords tags metadata
metadata
mobile
mozilla
NAB 2016
news
oauth
oauth2
office hours
open source
partial
partial response
partial update
partners
patch
php
player
playlists
policy
previews
pubsubhubbub
push
python
quota
rails
releases
rendering
reports
responses
resumable
ruby
samples
sandbox
shortform
ssl https certificate staging stage
stack overflow
stage video
staging
standard feeds
storify
storyful
subscription
sup
Super Chat API
survey
tdd
theme
tos
tutorials
updates
uploads
v2
v3
video
video files
video transcoding
virtual reality
voting
VR
watch history
watchlater
webvtt
youtube
youtube api
YouTube Data API
youtube developers live
youtube direct
YouTube IFrame Player API
YouTube live
YouTube Reporting API
ytd
Archive
2018
Aug
Apr
2017
Nov
Sep
Aug
Mar
Jan
2016
Nov
Oct
Aug
May
Apr
2015
Dec
Nov
Oct
May
Apr
Mar
Jan
2014
Oct
Sep
Aug
May
Mar
2013
Dec
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
2012
Dec
Nov
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2011
Dec
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2010
Dec
Nov
Oct
Sep
Jul
Jun
May
Apr
Mar
Feb
Jan
2009
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2008
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
2007
Dec
Nov
Aug
Jun
May
Feed
YouTube
on
Follow @youtubedev