New issue
Advanced search Search tips

Issue 599210 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

playing HTML5 video using MSE, the currentTime can get ahead of the displayed frame

Reported by aqu...@amazon.com, Mar 30 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36

Example URL:
see attached HTML

Steps to reproduce the problem:
1. Download the attached bugreport.html
2. Prepare a streamable 4K h264 video as bugreport.mp4. Here are the steps I followed on OS X (the content’s license prevents me from sharing the resulting file): 
   a. Download http://hwcdn.net/j9t9v3v5/cds/Foreman_H264.mp4 
   b. Download FreeMonoBold.ttf from http://www.fonts2u.com/free-monospaced-bold.font and unzip it. 
   c. Install ffmpeg with freetype support: brew install ffmpeg --with-freetype 
   d. Run: ffmpeg -y -i Foreman_H264.mp4 -vf "drawtext=x=0:y=0:fontcolor=white:fontsize=72:fontfile=FreeMono/FreeMonoBold.ttf:text='%{pts\:flt}':box=1:boxcolor=black" -movflags "empty_moov+default_base_moof+frag_keyframe" bugreport.mp4 
3. Run an HTTP server: python -m SimpleHTTPServer 8000 
4. Open: http://localhost:8000/bugreport.html 
5. Watch both videos play at 16x speed. The top video plays using a regular “src” URL, the bottom uses Media Source Extensions. The video’s reported currentTime is shown above each video. When using SimpleHTTPServer, sometimes the top video will stop playing because the server doesn’t properly support HTTP range requests, but that is irrelevant to this issue, and reloading the page usually works around it.

What is the expected behavior?
Both videos should behave like the non-MSE video: when playback lags, the currentTime does not advance, so that it’s always close to the timestamp displayed in the video (or slightly behind).

What went wrong?
The currentTime of the MSE video races ahead of the displayed video frame, so that it reaches t=10 seconds while the video is still at t=2 seconds.

Did this work before? N/A 

Is it a problem with Flash or HTML5? HTML5

Does this work in other browsers? Yes 

Chrome version: 49.0.2623.87  Channel: n/a
OS Version: OS X 10.11.4
Flash Version: Shockwave Flash 21.0 r0

Firefox 45.0 behaves correctly on OS X and Ubuntu.

Playing videos at high speed makes it easier to reproduce the issue, but we’ve seen the same issue playing higher-resolution videos at 1x speed. We’ve reproduced the issue on OS X (with and without GPU decoding), Ubuntu (without GPU decoding), and Windows (without GPU decoding).
 
bugreport.html
3.1 KB View Download

Comment 1 by rsesek@chromium.org, Mar 30 2016

Components: Blink>Media>Video
Cc: chcunningham@chromium.org wolenetz@chromium.org



Comment 3 by aqu...@amazon.com, Apr 1 2016

Not sure if this is related, but we've also observed that currentTime doesn't stop advancing when waiting for more data. If we set the mediaSource duration, add the first chunk, then don't add any further chunks, currentTime continues to advance past the end of first chunk, but my understanding of the MSE spec is that playback should suspend until more chunks are added or endOfStream is called. Firefox waits as expected.
That's intentional, video is allowed to lag audio by up to 3 seconds. Previous experimentation has found this is watch time positive for Netflix and YouTube; the speculation being that users are much more sensitive to audio drop outs than video and in most cases the video recovers w/ in the 3 second window.

Comment 6 by aqu...@amazon.com, Apr 2 2016

I'm not reporting a bug with audio; this bug manifests with videos that have no audio track at all. When playback is lagging we see differences of much more than 3 seconds; using bugreport.html the maximum difference between the currentTime and the displayed frame is 8 seconds, and it appears that the difference can become arbitrarily large if the video is long enough. Likewise for the issue of currentTime running past the end of buffered content.

Comment 7 by aqu...@amazon.com, Apr 2 2016

The fact that the behavior is so different for the same bytes played via MSE and not also makes me doubt this is related to the video underflow threshold.
Hmm, w/ no audio track time should stop immediately.
Cc: -wolenetz@chromium.org
Owner: wolenetz@chromium.org
Status: Assigned (was: Unconfirmed)
give to wolenetz@ to start investigation.
@#10,  bug 509010  is specific to the fork of the Chrome media pipeline for Android. WebMediaPlayerAndroid, for instance, isn't involved in Chrome for Mac.

I'll take a look soon to see what's going on here (on non-Android).
Labels: Needs-BlinkMediaTriage
Components: -Internals>Media -Blink>Media>Video Internals>Media>Source
Labels: -Needs-BlinkMediaTriage
Cc: -chcunningham@chromium.org wolenetz@chromium.org
Owner: chcunningham@chromium.org
Chris, can you take a look please.

Sign in to add a comment