Closed Bug 1516754 Opened 5 years ago Closed 5 years ago

YouTube video is buffering forever after using the seek bar (VP9 videos)

Categories

(Core :: Audio/Video: Playback, defect, P2)

64 Branch
defect

Tracking

()

VERIFIED FIXED
mozilla67
Tracking Status
firefox-esr60 66+ verified
firefox64 --- wontfix
firefox65 --- wontfix
firefox66 + verified
firefox67 + verified

People

(Reporter: okazki98, Assigned: kinetik)

References

()

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0

Steps to reproduce:

1. Open https://www.youtube.com/watch?v=p9hoAyx3-0I
2. Seek the video beyond the buffered range. 
*3. If it's working okay reload the page and try the 2nd step again. 


Actual results:

Most of the times the video does not continue playback and shows the "loading" animation forever.
Here's how I reproduced it on my machine: https://www.youtube.com/watch?v=i5n1jkDHDyY
Media info: https://pastebin.com/TUvSJuYm


Expected results:

Continue playback normally, just like other browsers do (Edge, Chromium).
I can confirm the endless buffering with Firefox 66 nightly and with Firefox 64 on windows 10
Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core
Flags: needinfo?(jyavenard)
What additional information should be provided?
Ci by(In reply to okazki from comment #2)
> What additional information should be provided?

None, just ni? Myself to remember to look at it asap.
Flags: needinfo?(jyavenard)
Doesn't look like a regression, goes back to 2016-02-01.

User reports:
https://www.reddit.com/r/firefox/comments/aamg9p/infinite_buffering_in_youtube/  (1 day ago)
https://www.reddit.com/r/firefox/comments/a9ddvx/youtube_videos_stop_caching_after_i_use_the_seek/ (4 days ago)
https://www.reddit.com/r/firefox/comments/9rvsd6/youtube_stops_buffering_videos_when_skipping/  (2 months ago)
https://www.reddit.com/r/firefox/comments/8aalgc/youtube_gets_stuck_buffering_when_i_skip_too_far/  (8 months ago)

Note that it's easier to reproduce when seeking immediately when the scrub bar first appears.

Seeking again shows console error:

> AbortError: The operation was aborted.

Fails on Ubuntu 18.10 with ffvpx, ffmpeg and libvpx decoders.
Fails on Windows 10 with ffvpx and libvpx decoders.
Works when webm disabled causing fallback to avc1.
Status: UNCONFIRMED → NEW
Ever confirmed: true

Test case to reproduce.

Assignee: nobody → jyavenard

In the test case above, modifying player.js and setting BREAK_PLAYBACK to false will make playback succeed.

The difference is how video.webm is added. If we add the first 87355 bytes it will successfully demux 160 vp9 frames. If instead you use the first 90355 bytes then nothing is demuxed and the NS_ERROR_DOM_MEDIA_END_OF_STREAM is returned instead.

:kinetik, could you have a look? this is likely due to nestegg.

Thank you

Flags: needinfo?(kinetik)

Investigating.

Assignee: jyavenard → kinetik
Status: NEW → ASSIGNED
Flags: needinfo?(kinetik)

Check that we can resume after appening a partial media segment header and calling abort().

Depends on D18651

Attachment #9041383 - Attachment description: Bug 1516754 - Reset Pending Input Buffer during Reset Parser State Algorithm. r?kinetik → Bug 1516754 - P1. Reset Pending Input Buffer during Reset Parser State Algorithm. r?kinetik
Pushed by jyavenard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/eae0092a3307
P1. Reset Pending Input Buffer during Reset Parser State Algorithm. r=kinetik
https://hg.mozilla.org/integration/autoland/rev/79aae5cc0934
P2. Add mochitest. r=drno
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67

Comment on attachment 9041383 [details]
Bug 1516754 - P1. Reset Pending Input Buffer during Reset Parser State Algorithm. r?kinetik

Beta/Release Uplift Approval Request

Feature/Bug causing the regression

None

User impact if declined

Intermittent stall when seeking in a YouTube video (And could be others too)

Is this code covered by automated tests?

Yes

Has the fix been verified in Nightly?

No

Needs manual test from QE?

No

If yes, steps to reproduce

The STR are provided in the description, a simple web page narrowing the case was created.

List of other uplifts needed

None

Risk to taking this patch

Low

Why is the change risky/not risky? (and alternatives if risky)

A silly oversight, what's amazing though is that it ever worked.

If there's a dot release made, I'd be keen to have it uplifted there too. such a silly bug

String changes made/needed

one

ESR Uplift Approval Request

If this is not a sec:{high,crit} bug, please state case for ESR consideration

Hugely popular site not working as it should

User impact if declined

Intermittent stall when seeking in a YouTube video (And could be others too)

Fix Landed on Version

67

Risk to taking this patch

Low

Why is the change risky/not risky? (and alternatives if risky)

A silly oversight, what's amazing though is that it ever worked.

String or UUID changes made by this patch

Attachment #9041383 - Flags: approval-mozilla-esr60?
Attachment #9041383 - Flags: approval-mozilla-beta?

Tested on 67.0a1 (build: 20190206095431). Seems to be working as expected now.

I can also confirm that the bug is fixed for me with the latest Nightly build. I tried skipping manually and with time markers and it worked just fine with two formerly affected Youtube videos which are recordings of originally live streamed events.

Thanks for the verification, Viktor and okazi!

Status: RESOLVED → VERIFIED

Comment on attachment 9041383 [details]
Bug 1516754 - P1. Reset Pending Input Buffer during Reset Parser State Algorithm. r?kinetik

Fix for video stalling, verified in Nightly.
Let's uplift for beta 6.

Attachment #9041383 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

(In reply to Jean-Yves Avenard [:jya] from comment #13)

A silly oversight, what's amazing though is that it ever worked.

I'm a bit surprised that we haven't ever gotten any dupes reported if this was such a widespread issue. Are VP9 videos that uncommon? Just trying to rectify what seems on its face to be a severe issue with the lack of reports we've gotten to date which would seem to indicate that it's not one users have hit in practice.

Flags: needinfo?(jyavenard)

(In reply to Ryan VanderMeulen [:RyanVM] from comment #20)

(In reply to Jean-Yves Avenard [:jya] from comment #13)

A silly oversight, what's amazing though is that it ever worked.

I'm a bit surprised that we haven't ever gotten any dupes reported if this was such a widespread issue. Are VP9 videos that uncommon? Just trying to rectify what seems on its face to be a severe issue with the lack of reports we've gotten to date which would seem to indicate that it's not one users have hit in practice.

Let me add my perspective as a user who was affected by this bug: I noticed this several months ago when I tried to skip in a video which was originally live streamed. It didn't work, so I reloaded the page and then it worked if I remember correctly, so I didn't think about it any more. Only some weeks ago when skipping in another video (which also was originally live streamed) didn't work again, I thought about this being a bug that I should file, but at this time the bug had already been filed. And I was hit by this bug again a few days ago and was confused because I thought it had been fixed, and then I noticed that I was using Firefox 65 which doesn't have the fix.

So maybe "luck" (reloading the page helps) and laziness of users (at least my own laziness) have led to this bug not being filed for a long time. Now that it is fixed I would really like to see a fix for ESR too, and maybe a fix in another point release for Firefox 65 if that is planned.

(In reply to Ryan VanderMeulen [:RyanVM] from comment #20)

(In reply to Jean-Yves Avenard [:jya] from comment #13)

A silly oversight, what's amazing though is that it ever worked.

I'm a bit surprised that we haven't ever gotten any dupes reported if this was such a widespread issue. Are VP9 videos that uncommon?

This is a pretty old issue. But up until now, whenever I was running into this bug, I was blaming YouTube for it. I was experimenting for a pretty long time hoping to discover a workaround, until I noticed that this was happening only when using VP9 videos.
I might be wrong, but I seem to recall that Firefox wasn't playing VP9 videos on YouTube by default until the ~60 version. Or maybe that was specific to my previous hardware.

Just trying to rectify what seems on its face to be a severe issue with the lack of reports we've gotten to date which would seem to indicate that it's not one users have hit in practice.

Many users may not run into this issue very frequently because of the way they use YouTube or the PC overall.
On the other hand, I usually prefer to navigate as fast as possible within a page. So this may be a reason I was bumping into the issue more frequently and thus became more frustrated by this behavior (enough to fill the bug). Now I am to live with regret that I didn't file a bug earlier.

I concur with what okazki wrote. This issue has been reported for a while, mainly in forums or reddit. We've had some bugs report but we never could action it. until now.

Flags: needinfo?(jyavenard)

Comment on attachment 9041383 [details]
Bug 1516754 - P1. Reset Pending Input Buffer during Reset Parser State Algorithm. r?kinetik

Thanks for the feedback. Given how simple the fix is, this sounds like an annoying-enough issue with a major site to justify taking. Approved for 60.6esr.

Attachment #9041383 - Flags: approval-mozilla-esr60? → approval-mozilla-esr60+
Flags: qe-verify+
QA Whiteboard: [qa-triaged]

I managed to reproduce the issue using an older version of nightly (2018-12-29) on Windows 10 x64.
I retested everything using Firefox 66.0 and esr 60.6.0 on Windows 10 x64, Ubuntu 18.04 x64 and macOS 10.13. The bug is not reproducing anymore.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: