New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 670150 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 1
Type: Feature

Blocking:
issue 663999



Sign in to add a comment

Background video playback metrics

Project Member Reported by avayvod@chromium.org, Dec 1 2016

Issue description

So far we (or rather Dale) came up with two metrics to track in order to launch disabling the video track for videos:
- time between the video becoming visible and the first frame being rendered - we should avoid making it too long
- average distance between the keyframes - we should probably avoid disabling decoding when this distance is too big

We should try to land these in M56.
 
Dale, a couple of questions wrt the implementation:

- is average_frame_duration_ in VideoRendererAlgorithm the right value for the latter metric? (https://cs.chromium.org/chromium/src/media/filters/video_renderer_algorithm.h?rcl=1480537046&l=288)

- there used to be FrameReady in WMPI long time ago, however it's vanished; seems like VideoRendererAlgorithm RenderFrame is the closest point to when the media pipeline is about to render a frame without going into the compositor to learn when exactly it paints the frame? (see https://codereview.chromium.org/2523923002 and the short discussion there)
Or should I look elsewhere for when the frame is decoded rather than is about to be painted?
1. No, that's just the duration of each frame. You need to look at which packets are marked as keyframes going out of the demuxer.

2. Probably you'll need to set some flag during WMPI::OnShown() that tells VFC to log a histogram of the time until it has a new frame.
Would something like https://codereview.chromium.org/2545523005 work for 1 then?

Not sure what would be the good way to report the stats? Have a non-static ReportStatistic method that would pass new data to the callback along with the decoded bytes in PipelineStatistic?

Do we care about the median/divergence/max key frame distance?
Seems like for YouTube the max is 5333ms while the average is lower on the Big Buck Bunny YouTube video I tried.
Labels: Merge-Request-56
Cc: amineer@chromium.org
+Alex for merge request approval (seems like the auto approval no longer applies)

Comment 7 by dimu@chromium.org, Dec 9 2016

Labels: -Merge-Request-56 Merge-Approved-56 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M56 (branch: 2924)
Project Member

Comment 8 by bugdroid1@chromium.org, Dec 9 2016

Labels: -merge-approved-56 merge-merged-2924
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/034f1b9f3c64af980d051d007c992dc94882241e

commit 034f1b9f3c64af980d051d007c992dc94882241e
Author: Anton Vayvod <avayvod@google.com>
Date: Fri Dec 09 19:36:42 2016

[Video] Collect average keyframe distance for video

BUG= 670150 
TEST=None

Review-Url: https://codereview.chromium.org/2545523005
Cr-Commit-Position: refs/heads/master@{#437287}
(cherry picked from commit 25bc24a5a449737281cd63e7deae7ea9777ba425)

Review-Url: https://codereview.chromium.org/2559273004 .
Cr-Commit-Position: refs/branch-heads/2924@{#437}
Cr-Branched-From: 3a87aecc31cd1ffe751dd72c04e5a96a1fc8108a-refs/heads/master@{#433059}

[modify] https://crrev.com/034f1b9f3c64af980d051d007c992dc94882241e/media/filters/decoder_stream_traits.cc
[modify] https://crrev.com/034f1b9f3c64af980d051d007c992dc94882241e/media/filters/decoder_stream_traits.h
[modify] https://crrev.com/034f1b9f3c64af980d051d007c992dc94882241e/tools/metrics/histograms/histograms.xml

Blocking: 663999
Labels: -M-56 M-57
Status: Fixed (was: Started)
Moving to M57 for the second metric needed.
Project Member

Comment 11 by bugdroid1@chromium.org, Jan 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ac607d65a37cba23db6690580fd78068f9b9fde0

commit ac607d65a37cba23db6690580fd78068f9b9fde0
Author: avayvod <avayvod@chromium.org>
Date: Fri Jan 06 03:16:43 2017

[Media] Record time it takes to start rendering audio and video

BUG= 670150 
TEST=manually with and without the background video track optimization flag.

Record time between the play or seek and when the player has enough
data for both audio and video renderers.

Review-Url: https://codereview.chromium.org/2552493002
Cr-Commit-Position: refs/heads/master@{#441860}

[modify] https://crrev.com/ac607d65a37cba23db6690580fd78068f9b9fde0/media/blink/video_frame_compositor.cc
[modify] https://crrev.com/ac607d65a37cba23db6690580fd78068f9b9fde0/media/blink/video_frame_compositor.h
[modify] https://crrev.com/ac607d65a37cba23db6690580fd78068f9b9fde0/media/blink/webmediaplayer_impl.cc
[modify] https://crrev.com/ac607d65a37cba23db6690580fd78068f9b9fde0/tools/metrics/histograms/histograms.xml

Labels: Needs-Feedback
@avayvod-- Could you please let us know if there are any manual repro steps to reproduce the issue, if there is , please provide us the expected result . So , that we can verify it from Chrome-TE end.

Thanks!
Labels: -Type-Bug Type-Feature
hdodda@, I guess you could play a video and check that Chrome collects the histograms I added in this tracking bug: Media.Video.KeyframeDistance (merged to M56) and Media.Video.TimeFromForegroundToFirstFrame (M57 only).

The former should reflect the average keyframe distance in the videos played while the latter should correspond to the time it takes to paint the first video frame once the video is foreground after playing in the background. We also expect Media.Video.TimeFromForegroundToFirstFrame to report higher values with the --enable-features=BackgroundVideoTrackOptimization flag on (can be set via chrome://flags too).
Project Member

Comment 14 by bugdroid1@chromium.org, Jan 19 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/cc273ddad35337b82ddfdb77248986fc928d035e

commit cc273ddad35337b82ddfdb77248986fc928d035e
Author: avayvod <avayvod@chromium.org>
Date: Thu Jan 19 19:35:12 2017

[Video] Fix the TimeFromForegroundToFirstFrame metric.

Only start tracking the foreground time if the video we had or would optimize is playing or will be playing when shown.

Thus we don't track the time for paused videos or videos we wouldn't optimize like streams so they don't improve the average results.

BUG= 670150 
TEST=manual

Review-Url: https://codereview.chromium.org/2631633003
Cr-Commit-Position: refs/heads/master@{#444816}

[modify] https://crrev.com/cc273ddad35337b82ddfdb77248986fc928d035e/media/blink/video_frame_compositor.cc
[modify] https://crrev.com/cc273ddad35337b82ddfdb77248986fc928d035e/media/blink/video_frame_compositor.h
[modify] https://crrev.com/cc273ddad35337b82ddfdb77248986fc928d035e/media/blink/webmediaplayer_impl.cc
[modify] https://crrev.com/cc273ddad35337b82ddfdb77248986fc928d035e/media/blink/webmediaplayer_impl.h
[modify] https://crrev.com/cc273ddad35337b82ddfdb77248986fc928d035e/media/blink/webmediaplayer_impl_unittest.cc
[modify] https://crrev.com/cc273ddad35337b82ddfdb77248986fc928d035e/tools/metrics/histograms/histograms.xml

Cc: hdodda@chromium.org
Tested on mac os 10.12.2 using chrome dev M57 #57.0.2987.8 and followed steps:

1. Opened chrome by enabling the flag "--enable-features=BackgroundVideoTrackOptimization" and played a youtube video.
2. opened chrome://histograms and checked for "Media.Video.KeyframeDistance" and "Media.Video.TimeFromForegroundToFirstFrame" .
3. Only "Media.Video.KeyframeDistance" is found as attached in screencast.

Attached screencast for reference.

@avayvod-- Could you please confirm us if we had followed correct steps to verify the issue and please let us know if we had anything to correct from our end.

Thanks!
670150.mp4
1.4 MB View Download

Sign in to add a comment