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

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Feature

Blocked on:
issue 709302
issue 669159
issue 670150
issue 671381



Sign in to add a comment
link

Issue 663999: Disable background video track for SRC= content to save resources.

Reported by avayvod@chromium.org, Nov 10 2016 Project Member

Issue description

The (internal) doc is here: https://docs.google.com/document/d/1p40W4XXDB6VkxqPd4aRpR9oLP_SCdMuTVsr9P0NOauE/edit#

The idea is to do the analogue of:

document.getElementsByTagName('video')[0].videoTracks[0].selected = false

whenever the video is in the background to stop decoding it.

We want to launch this on Android and on desktop but desktop might require some heuristics to avoid breaking the user expectations too much w.r.t. video coming to the foreground.
 

Comment 1 by bugdroid1@chromium.org, Nov 23 2016

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/39c1024093bdd21abd2c2ea3de5c05f7b9fee8ce

commit 39c1024093bdd21abd2c2ea3de5c05f7b9fee8ce
Author: avayvod <avayvod@chromium.org>
Date: Wed Nov 23 21:43:13 2016

Disable background video track behind a feature flag

BUG=663999
TEST=unit test + manual testing with the flag on - see chrome://media-internals logging track selection

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

[modify] https://crrev.com/39c1024093bdd21abd2c2ea3de5c05f7b9fee8ce/chrome/app/generated_resources.grd
[modify] https://crrev.com/39c1024093bdd21abd2c2ea3de5c05f7b9fee8ce/chrome/browser/about_flags.cc
[modify] https://crrev.com/39c1024093bdd21abd2c2ea3de5c05f7b9fee8ce/content/browser/renderer_host/render_view_host_impl.cc
[modify] https://crrev.com/39c1024093bdd21abd2c2ea3de5c05f7b9fee8ce/content/public/common/common_param_traits_macros.h
[modify] https://crrev.com/39c1024093bdd21abd2c2ea3de5c05f7b9fee8ce/content/public/common/web_preferences.cc
[modify] https://crrev.com/39c1024093bdd21abd2c2ea3de5c05f7b9fee8ce/content/public/common/web_preferences.h
[modify] https://crrev.com/39c1024093bdd21abd2c2ea3de5c05f7b9fee8ce/content/renderer/media/webmediaplayer_ms_unittest.cc
[modify] https://crrev.com/39c1024093bdd21abd2c2ea3de5c05f7b9fee8ce/content/renderer/render_view_impl.cc
[modify] https://crrev.com/39c1024093bdd21abd2c2ea3de5c05f7b9fee8ce/media/base/media_switches.cc
[modify] https://crrev.com/39c1024093bdd21abd2c2ea3de5c05f7b9fee8ce/media/base/media_switches.h
[modify] https://crrev.com/39c1024093bdd21abd2c2ea3de5c05f7b9fee8ce/media/blink/webmediaplayer_impl.cc
[modify] https://crrev.com/39c1024093bdd21abd2c2ea3de5c05f7b9fee8ce/media/blink/webmediaplayer_impl.h
[modify] https://crrev.com/39c1024093bdd21abd2c2ea3de5c05f7b9fee8ce/media/blink/webmediaplayer_impl_unittest.cc
[modify] https://crrev.com/39c1024093bdd21abd2c2ea3de5c05f7b9fee8ce/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
[modify] https://crrev.com/39c1024093bdd21abd2c2ea3de5c05f7b9fee8ce/third_party/WebKit/Source/core/html/HTMLMediaElement.h
[modify] https://crrev.com/39c1024093bdd21abd2c2ea3de5c05f7b9fee8ce/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in
[modify] https://crrev.com/39c1024093bdd21abd2c2ea3de5c05f7b9fee8ce/third_party/WebKit/Source/web/WebRuntimeFeatures.cpp
[modify] https://crrev.com/39c1024093bdd21abd2c2ea3de5c05f7b9fee8ce/third_party/WebKit/public/platform/WebMediaPlayerClient.h
[modify] https://crrev.com/39c1024093bdd21abd2c2ea3de5c05f7b9fee8ce/third_party/WebKit/public/web/WebRuntimeFeatures.h
[modify] https://crrev.com/39c1024093bdd21abd2c2ea3de5c05f7b9fee8ce/tools/metrics/histograms/histograms.xml

Comment 2 by avayvod@chromium.org, Nov 23 2016

Should we merge this to M56 so people could enable it on Beta?

Comment 3 by avayvod@chromium.org, Nov 28 2016

Blockedon: 669159

Comment 4 by avayvod@chromium.org, Dec 1 2016

Labels: -Pri-2 Pri-1

Comment 5 by avayvod@chromium.org, Dec 6 2016

Blockedon: 671381

Comment 6 by avayvod@chromium.org, Dec 16 2016

Blockedon: 670150

Comment 7 by avayvod@chromium.org, Jan 9 2017

Blockedon: 679357

Comment 8 by avayvod@chromium.org, Jan 11 2017

Blockedon: -679357

Comment 9 by bugdroid1@chromium.org, Jan 13 2017

Project Member

Comment 10 by rbasuvula@chromium.org, Jan 17 2017

Cc: rbasuvula@chromium.org
Labels: Needs-Feedback
Verified this issue on chrome latest #57.0.2984.0 on win 7,Ubuntu 14.04 & Mac 10.12.2 by following steps mentioned as below.

1.Load a video that includes audio (Youtube Red,Vimeo & Amazon Video)
2.Switch that tab to background, then foreground quickly and check the video & audio.
3.After 1m, switch tab to foreground. check the video appear quickly and playback continue without interruption.

Please find the screen shot for reference.

@avayvod : Could you please let us know the expected behavior of the issue.

Thank You!

Comment 11 by rbasuvula@chromium.org, Jan 18 2017

@avayvod: Unable to upload the video in chromium.So providing the video link.Could you please look in to this and update.

https://drive.google.com/a/google.com/file/d/0Bx0w4BGmWEIqdGlxWGl3aEZzOWs/view?usp=sharing

Note: Unable to capture the audio.

Thank you!

Comment 12 by avayvod@chromium.org, Jan 18 2017

Labels: -Type-Bug Type-Feature
Hey, sorry, this is a feature issue, not a bug so no need to verify it as a fix, thanks!

The feature is behind the feature flag (search for background video track in chrome://flags) so I don't think you were testing Chrome with the feature enabled in your video.

Comment 13 by bugdroid1@chromium.org, Jan 20 2017

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/590011e3f3b68faf7f68592b3b931181e0cb4672

commit 590011e3f3b68faf7f68592b3b931181e0cb4672
Author: avayvod <avayvod@chromium.org>
Date: Fri Jan 20 02:01:00 2017

[Video] Set the max keyframe distance for background optimization via FieldTrials.

Get a field trial variations param as the time in milliseconds. Pass it from
RenderViewHostImpl in the browser process to the renderer's RenderFrameImpl via
WebPreferences. Set the value in WebMediaPlayerParams when WebMediaPlayerImpl is
created.

BUG=663999
TEST=manually with chrome --enable-features="BackgroundVideoTrackOptimization<Study" --force-fieldtrials=Study/Group1 --force-fieldtrial-params=Study.Group1:max_keyframe_distance_ms/1000

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

[modify] https://crrev.com/590011e3f3b68faf7f68592b3b931181e0cb4672/content/browser/renderer_host/render_view_host_impl.cc
[modify] https://crrev.com/590011e3f3b68faf7f68592b3b931181e0cb4672/content/public/common/common_param_traits_macros.h
[modify] https://crrev.com/590011e3f3b68faf7f68592b3b931181e0cb4672/content/public/common/web_preferences.cc
[modify] https://crrev.com/590011e3f3b68faf7f68592b3b931181e0cb4672/content/public/common/web_preferences.h
[modify] https://crrev.com/590011e3f3b68faf7f68592b3b931181e0cb4672/content/renderer/render_frame_impl.cc
[modify] https://crrev.com/590011e3f3b68faf7f68592b3b931181e0cb4672/media/blink/webmediaplayer_impl.cc
[modify] https://crrev.com/590011e3f3b68faf7f68592b3b931181e0cb4672/media/blink/webmediaplayer_impl.h
[modify] https://crrev.com/590011e3f3b68faf7f68592b3b931181e0cb4672/media/blink/webmediaplayer_impl_unittest.cc
[modify] https://crrev.com/590011e3f3b68faf7f68592b3b931181e0cb4672/media/blink/webmediaplayer_params.cc
[modify] https://crrev.com/590011e3f3b68faf7f68592b3b931181e0cb4672/media/blink/webmediaplayer_params.h

Comment 14 by avayvod@chromium.org, Apr 13 2017

Labels: -M-57 M-59

Comment 15 by bugdroid1@chromium.org, Apr 14 2017

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

commit e85ec428376cf7d6f281ace33f1a8b440dc601c3
Author: avayvod <avayvod@chromium.org>
Date: Fri Apr 14 00:11:33 2017

[Media] Add a finch trial param for background MediaSource videos

Added a new finch trial parameter to set the max average keyframe
distance that allows disabling of the video track or pausing
MediaSource videos when in the background.
WMPI now uses the right parameter according to the |load_type_|.
Parametrized unit tests test for both load types.

BUG=663999
TEST=unittests+manual

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

[modify] https://crrev.com/e85ec428376cf7d6f281ace33f1a8b440dc601c3/content/renderer/render_frame_impl.cc
[modify] https://crrev.com/e85ec428376cf7d6f281ace33f1a8b440dc601c3/media/blink/webmediaplayer_impl.cc
[modify] https://crrev.com/e85ec428376cf7d6f281ace33f1a8b440dc601c3/media/blink/webmediaplayer_impl.h
[modify] https://crrev.com/e85ec428376cf7d6f281ace33f1a8b440dc601c3/media/blink/webmediaplayer_impl_unittest.cc
[modify] https://crrev.com/e85ec428376cf7d6f281ace33f1a8b440dc601c3/media/blink/webmediaplayer_params.cc
[modify] https://crrev.com/e85ec428376cf7d6f281ace33f1a8b440dc601c3/media/blink/webmediaplayer_params.h

Comment 17 by avayvod@chromium.org, May 16 2017

Labels: -M-59 M-60

Comment 18 by avayvod@chromium.org, Jun 19 2017

Blockedon: 709302
Labels: -M-60 M-61
Moving to 61, pending resolution to Issue 709302 at this point.

Comment 19 by dalecur...@chromium.org, Jun 26 2017

What happened with the MSE launch? I thought we decided to only hold back the SRC launch due to that bug?

Comment 20 by avayvod@chromium.org, Jun 27 2017

Cc: johnpallett@chromium.org
John might have better memory than me but I think we decided offline not to launch anything until M60 because of the src= issue and I simply punted to the next release seeing it won't be resolved in M60.

Comment 21 by bugdroid1@chromium.org, Jul 19 2017

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

commit df848adb8eb6bf9be13ed82e1b2156b8ae93615a
Author: Dale Curtis <dalecurtis@chromium.org>
Date: Wed Jul 19 22:39:46 2017

Enable background video track optimization for MSE content.

While src= track change still suffer from http://crbug.com/709302,
MSE based track changes work fine. This change enables both pausing
and disable track for MSE content with a keyframe distance < 5s.

The experiment data suggests that in the 95th percentile we might
end up waiting ~980ms when disabling a track before the next video
frame is shown. The 25th percentile is ~66ms, 50th is ~155ms, and
75th is ~325ms.

For pausing, the percentiles results are ~10ms, ~32ms, ~116ms, and
~255ms. These compare favorably with control values.

A later CL will cleanup chrome://flags and switches entries once
we are confident in this release.

Notably this has been launch approved since M58 and experiments have
been running since then at 75% of dev, canary, beta. The discovery
of  issue 70302  blocked launch for all playbacks, so this pieces out
the MSE portion which works properly.

BUG=663999,703411
TEST=experiment data looks good.

Change-Id: I07dfebb96d4a2c9147909bb7cdf96fa02469f801
Reviewed-on: https://chromium-review.googlesource.com/576488
Reviewed-by: Anton Vayvod <avayvod@chromium.org>
Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488017}
[modify] https://crrev.com/df848adb8eb6bf9be13ed82e1b2156b8ae93615a/content/renderer/media/media_factory.cc
[modify] https://crrev.com/df848adb8eb6bf9be13ed82e1b2156b8ae93615a/media/base/media_switches.cc

Comment 22 by bugdroid1@chromium.org, Sep 9 2017

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3f4935b98ff638e8f3332c70bf476d3e8d1b5102

commit 3f4935b98ff638e8f3332c70bf476d3e8d1b5102
Author: Dale Curtis <dalecurtis@chromium.org>
Date: Sat Sep 09 00:11:59 2017

Always pause background video-only media on desktop too.

Android has had this behavior for some time now. As of M62 we've
launched background optimizations for MSE, we can also enable
background pause support for video-only clips for src=.

BUG=663999,703411
TEST=experiment data looks good; ~98% of resume < 1s.

Change-Id: I8a2435579c7c996702c08f22ea398abc28e46cdf
Reviewed-on: https://chromium-review.googlesource.com/651237
Reviewed-by: Yuri Wiitala <miu@chromium.org>
Reviewed-by: Dan Sanders <sandersd@chromium.org>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#500749}
[modify] https://crrev.com/3f4935b98ff638e8f3332c70bf476d3e8d1b5102/media/blink/webmediaplayer_impl.cc
[modify] https://crrev.com/3f4935b98ff638e8f3332c70bf476d3e8d1b5102/media/blink/webmediaplayer_impl_unittest.cc

Comment 23 by avayvod@chromium.org, Oct 18 2017

Owner: mlamouri@chromium.org
Status: Untriaged (was: Started)
Assigning all my bugs to Mounir for him to triage and close/reassign later.

Comment 24 by mlamouri@chromium.org, Oct 24 2017

Owner: dalecur...@chromium.org
Re-assigning to dalecurtis@ as his team took over this project.

Comment 25 by mlamouri@chromium.org, Oct 25 2017

Components: -Blink>Media>Video

Comment 26 by yini...@chromium.org, Oct 30 2017

Status: Fixed (was: Untriaged)
as per c#22, this bug is fixed.

Comment 27 by dalecur...@chromium.org, Dec 14 2017

Labels: -Pri-1 -M-61 M-65 Pri-2
Status: Assigned (was: Fixed)
Was wondering where this went, still needs enabling for MSE.

Comment 28 by dalecur...@chromium.org, Dec 14 2017

Err, I mean SRC; it's already enabled for MSE.

Comment 29 by dalecur...@chromium.org, Dec 15 2017

Summary: Disable background video track for SRC= content to save resources. (was: Disable background video track to save resources.)

Comment 30 by dalecur...@chromium.org, Jan 12 2018

Labels: -M-65 M-66
Owner: tmathmeyer@chromium.org

Comment 31 by bugdroid1@chromium.org, Apr 13 2018

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/664c3ca7b7e7ca3bf634226663256a18df7552ec

commit 664c3ca7b7e7ca3bf634226663256a18df7552ec
Author: François Beaufort <beaufort.francois@gmail.com>
Date: Fri Apr 13 07:24:51 2018

[Picture-in-Picture] Disable background video tracks optimization.

This CL makes sure a video player in Picture-in-Picture doesn't get
paused because of background video tracks optimization.

Bug:  806249 , 663999
Change-Id: Ia3453000a9107d28974428c1ab004227370dc28f
Reviewed-on: https://chromium-review.googlesource.com/1008082
Reviewed-by: apacible <apacible@chromium.org>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/heads/master@{#550534}
[modify] https://crrev.com/664c3ca7b7e7ca3bf634226663256a18df7552ec/media/blink/webmediaplayer_impl.cc
[modify] https://crrev.com/664c3ca7b7e7ca3bf634226663256a18df7552ec/media/blink/webmediaplayer_impl_unittest.cc

Comment 32 by bugdroid1@chromium.org, Apr 17 2018

Project Member
Labels: merge-merged-testbranch
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/664c3ca7b7e7ca3bf634226663256a18df7552ec

commit 664c3ca7b7e7ca3bf634226663256a18df7552ec
Author: François Beaufort <beaufort.francois@gmail.com>
Date: Fri Apr 13 07:24:51 2018

[Picture-in-Picture] Disable background video tracks optimization.

This CL makes sure a video player in Picture-in-Picture doesn't get
paused because of background video tracks optimization.

Bug:  806249 , 663999
Change-Id: Ia3453000a9107d28974428c1ab004227370dc28f
Reviewed-on: https://chromium-review.googlesource.com/1008082
Reviewed-by: apacible <apacible@chromium.org>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/heads/master@{#550534}
[modify] https://crrev.com/664c3ca7b7e7ca3bf634226663256a18df7552ec/media/blink/webmediaplayer_impl.cc
[modify] https://crrev.com/664c3ca7b7e7ca3bf634226663256a18df7552ec/media/blink/webmediaplayer_impl_unittest.cc

Comment 33 by bugdroid1@chromium.org, Aug 23

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

commit d5a6baab5a827dd0d3a87ce445adf4dc30f8fce2
Author: Ted Meyer <tmathmeyer@chromium.org>
Date: Thu Aug 23 18:25:55 2018

Seek video track only when it is re-enabled

PipelineController
   (closure)   <----- calling this closure allows the rest of the track switch
       |              and seek queue to continue to happen.          ^
       |                                                             |
       v                                                             |
FFmpegDemuxer::OnSelectedVideoTrackChanged                           |
    (closure)  <----- closure is passed down, but this function      |
       |              toggles some stream bits and then passes       |
       |              the closure down to the seek.                  |
       |                                                             |
       v                                                             |
FFmpegDemuxer::SeekAnyEnabledVideoFrame                              |
    (closure)  <----- If there are no tracks to enable, we're        |
       |                done, and can call the closure    -----------|
       |                                                             |
       v                                                             |
FFmpegDemuxer::SeekInternal                                          |
    (closure)  <----- Otherwise, we keep state that we're enabling   |
       |              a track and seeking it. This state lets us     |
       |              know later that we should drop some audio      |
       |              frames.                                        |
       v                                                             |
  FFMPEG MAGIC                                                       |
   (closure)   <----- Push the callback into an ffmpeg callback      |
       |                                                             |
       |                                                             |
       v                                                             |
FFmpegDemuxer::FFmpegAfterSeekCallback                               |
    (closure)  <----- FFmpeg has moved it's file cursor back to      |
                      wherever the seek point was, and is now        |
                      reading the interleaved data from all          |
                      streams. The state set in                      |
                      SeekAnyEnabledVideoFrame lets us keep track    |
                      of which of these frames are actually          |
                      worth re-rendering; we drop the audio, play    |
                      the video, and since in-band text isn't        |
                      displayed, we just ignore it and let it        |
                      go out of sync.                                |
                      At this point, the closure is also called      |
                      and the pipeline is free do whatever. ---------|

Bug: 663999
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I30897e3f7daddd2a818af47475e20f049665236d
Reviewed-on: https://chromium-review.googlesource.com/1132678
Commit-Queue: Ted Meyer <tmathmeyer@chromium.org>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585553}
[modify] https://crrev.com/d5a6baab5a827dd0d3a87ce445adf4dc30f8fce2/media/filters/ffmpeg_demuxer.cc
[modify] https://crrev.com/d5a6baab5a827dd0d3a87ce445adf4dc30f8fce2/media/filters/ffmpeg_demuxer.h
[modify] https://crrev.com/d5a6baab5a827dd0d3a87ce445adf4dc30f8fce2/media/filters/ffmpeg_demuxer_unittest.cc

Comment 34 by tmathmeyer@chromium.org, Oct 2

I'm putting together some statistics for how the experiment has affected playback:

Battery drain on chromeos has a noticeable improvement:
https://uma.googleplex.com/variations?sid=27e68b5e0ce31dc0128d44227553765e

MTBR and Pipeline Status both look good/unchanged:
https://uma.googleplex.com/variations?sid=c14ba6f7204cbcf412cbde678af816e6

TimeToFirstFrame shows a ~15% regression:
https://uma.googleplex.com/variations?sid=7084bb97b4bb1ad9fb7979a7b6288a29

Comment 35 by bugdroid1@chromium.org, Jan 11

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9a041b9f3c8b8a530d77e6a53b56bca3db3186b2

commit 9a041b9f3c8b8a530d77e6a53b56bca3db3186b2
Author: Ted Meyer <tmathmeyer@chromium.org>
Date: Fri Jan 11 21:32:58 2019

Enable src= background track switching by default

Bug: 663999
Change-Id: Ib83d981bbb6cefa3de9f3af0ea50c2a99b8d6876
Reviewed-on: https://chromium-review.googlesource.com/c/1406149
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Ted Meyer <tmathmeyer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#622157}
[modify] https://crrev.com/9a041b9f3c8b8a530d77e6a53b56bca3db3186b2/media/base/media_switches.cc

Comment 36 by mlamouri@chromium.org, Jan 14

Cc: fbeaufort@chromium.org

Sign in to add a comment