New issue
Advanced search Search tips

Issue 905156 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Dec 11
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Feature

Blocking:
issue 905161



Sign in to add a comment

MediaCapabilities.decodingInfo() works on Chromebook.

Project Member Reported by deanliao@chromium.org, Nov 14

Issue description

Some Chromebooks have weak CPU with hardware video decoder. With MediaCapabilities.decodingInfo() API, application shall provide video which format is  most suitable to play on the target device.
 
Blocking: 905161
Cc: chcunningham@chromium.org dalecur...@chromium.org
Quoted from Chris:
The design doc for decodingInfo is here
https://docs.google.com/document/d/1sVFhNNY0LJ-uYAra1uiHoOEMUvitU17JqV6k_PmXVco/edit?usp=drivesdk

The stats are collected for any video tag playback, including Netflix and YouTube (which use media source to connect to the video tag).

The stats are saved to a local database and queried whenever media capabilities API requests are made.

The stats are also reported to UKM, but only as a mechanism to grade the API and monitor implementation changes and general video playback performance. I have not attempted to send these stats back to fresh clients of a same device type. I don't know if chrome knows the device make and model. It's an interesting idea. In practice, the empty DB gets stats about playback rapidly, so the priority of seeding this with offline data has been low 
I'm confused from the title/comments what work this bug is tracking. decodingInfo() already works on Chromebooks in the same way that it does for Chrome in general. 
I wrote a webpage for listing decodinginfo() return values.
https://deanliao.users.x20web.corp.google.com/www/decodinginfo.html

I opened it on some Chromebooks, all (supported, smooth, power_efficient) are checked (even vp9 4k video). I tried to play various video with different codec and size (using http://crosvideo.appspot.com/). The result, however, remained the same.

I plan to write an autotest (or tast) to play various profile of video on a target Chromebook. 

Chris, can you tell me how to query MediaCapabilitiesDatabase? How do I know if current video playback sends statistics to db? How many playbacks is needed to reflect on decodinginfo() result?
Update: the decodinginfo() result page is now served in google cloud:
https://storage.googleapis.com/crosvideo.appspot.com/decodinginfo.html
Re #4, the experiment was in Chromebook guest mode. With user login, the dashboard works as expected. Experimenting on empty VideoDecodeStats db, it reflect on decodingInfo() in dozens of seconds.

Though not quite important, I'm curious when will playback stats be updated to db? I tried to play a few seconds it doesn't reflect even if its average drop rate is far more than 10%. I looked at the code and it doesn't check minimum number of frame_decoded so once stats are uploaded, no matter how short video is played, it should reflect to decodingInfo().
When we have no stats we report smooth=power_efficient=true for any supported configuration. Supported=false/true doesn't rely on stats, so this is always accurate. 

Playbacks update to the DB in 2 situations:
- mid playback, when some aspect of the stream changes (codec, fps, resolution)
- end of playback, when the underlying media player gets destroyed

Note that removing the <video> from the DOM is often not enough to trigger garbage collection to trigger the end-of-playback case. But you can always force it by closing the tab, navigating away, or calling a fresh load() on the <video>.

Stats are recorded via polling every 2 seconds, and it takes an initial 3 seconds to do some startup tasks. Net, it takes about 5 seconds of playback to get any stats. I'll update the mechanism in the near future to bring this initial delay closer to 1 second.

deanliao@, are there any action items (given answers above)? 
Status: Verified (was: Assigned)
Chris, Thanks for your clarification of video playback stats update flow.

Per discussion above, MediaCapabilities.decodingInfo() works on Chromebook except guest mode. And the stats updating mechanism is practical though delay can be shorter in the near future. I'll mark it as fixed.
What was the issue in guest mode. From comment 6 it sounded like it was working fine? 

Guest mode will start out with a fresh DB and it will accumulate stats as long as the profile is alive. If you close all the windows of guest mode and then create a new guest mode session, you start again with a fresh DB. This is how guest mode features usually work (everything starts fresh: no history, bookmarks etc from other profiles).

Sign in to add a comment