Closed Bug 1285987 Opened 8 years ago Closed 8 years ago

HTML5 player on Twitch.tv freezes after a ~30 seconds

Categories

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

48 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla50
Tracking Status
platform-rel --- ?
firefox47 --- unaffected
firefox48 --- fixed
firefox49 --- fixed
firefox50 --- fixed

People

(Reporter: btbn, Assigned: jya)

References

Details

(Keywords: regression, Whiteboard: [platform-rel-Twitch])

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:48.0) Gecko/20100101 Firefox/48.0
Build ID: 20160706215822

Steps to reproduce:

After Updating from 47 to 48 beta, watching stream on Twitch.tv(Using the native HTML5 player, disable Flash to get it), some of the streams freeze after playing for 10~30 seconds.
I am testing e10s, so i tried disabling it. But even without e10s force-enabled this issue is still present.



Actual results:

Most streams seem to work mostly fine, but basically all of them show occasional stuttering and short freezes that weren't happening on 47 release.
A few of them, for example https://www.twitch.tv/dansgaming, freeze every time after playing for a short while.
When leaving the tab open the stream will play a few segments again after being frozen for a few minutes.
Looking at the Debug-Network-Console, the site constantly keeps loading the m3u8 playlist and video segments, even while the player is frozen.


Expected results:

The streams should play flawlessly like they did on 47.
[Tracking Requested - why for this release]:  Breaks video playback

I can reproduce the freeze on Nightly50.0a1[1].



[1]
https://hg.mozilla.org/mozilla-central/rev/aac8ff1024c553d9c92b85b8b6ba90f65de2ed08
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0 ID:20160712030234



Regression window:
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=ecdb77ae56812fff63dc9bd7633bc976b2813980&tochange=71a44348d3b75b475fa14c11720b069393602c38

Regressed by: Bug 1276184
Blocks: 1276184
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(lhenry)
Flags: needinfo?(jyavenard)
Flags: needinfo?(gchang)
Flags: needinfo?(dglastonbury)
Has Regression Range: no → yes
:jya is the expert here.
Flags: needinfo?(dglastonbury)
Assignee: nobody → jyavenard
Flags: needinfo?(jyavenard)
Priority: -- → P1
FWIW, I get freeze with other browsers too.
Flags: needinfo?(gchang)
FWIW, the twitch html5 player isn't public yet and the default player given when flash isn't enabled is broken (as per twitch people).

The proper html5 (in beta) would be accessed via http://player.twitch.tv/?volume=0.4&channel=dansgaming&mseDev

I get no freeze there. Can you confirm that it works for you ?
Flags: needinfo?(alice0775)
(In reply to Jean-Yves Avenard [:jya] from comment #4)
> FWIW, the twitch html5 player isn't public yet and the default player given
> when flash isn't enabled is broken (as per twitch people).
> 
> The proper html5 (in beta) would be accessed via
> http://player.twitch.tv/?volume=0.4&channel=dansgaming&mseDev
> 
> I get no freeze there. Can you confirm that it works for you ?

I watched the video about 10 minutes,
Yes, I can confirm that the video works on Nightly50.0a1(2016-07-12) without any problem.
Flags: needinfo?(alice0775)
I can't reproduce the problem with the provided URL. Please provide exact steps to reproduce (STR). including what you did to disable flash.

as for me https://www.twitch.tv/dansgaming doesn't even start if flash isn't installed and using the proper html5 player plays just fine.

Otherwise, I'll close this bug as invalid. thanks
Flags: needinfo?(btbn)
(In reply to Jean-Yves Avenard [:jya] from comment #6)
> I can't reproduce the problem with the provided URL. Please provide exact
> steps to reproduce (STR). including what you did to disable flash.
> 
> as for me https://www.twitch.tv/dansgaming doesn't even start if flash isn't
> installed and using the proper html5 player plays just fine.
> 
> Otherwise, I'll close this bug as invalid. thanks

It need to disable "Mixed contents block protection" from padlock icon in LocationBar. 
(or setting security.mixed_content.block_active_content = false from about config)
Then WFM with Nightly 50 with either the default URL (flash disabled) or using http://player.twitch.tv/?volume=0.4&channel=dansgaming&mseDev on either windows 10 or mac 10.11.

debugging shows that at no stage is the code changed by bug 1276184 hit... so I'm not sure how that could have caused to appear in the regression range.

Alice0075 how certain are you for your regression range?
(In reply to Jean-Yves Avenard [:jya] from comment #8)
> Then WFM with Nightly 50 with either the default URL (flash disabled) or
> using http://player.twitch.tv/?volume=0.4&channel=dansgaming&mseDev on
> either windows 10 or mac 10.11.

Yep, I cannot reproduce the problem using URL of comment#0 on Beta48b7, Nightly50.0a1 and on the bad build too..., it's weird.
Okey, I remove tracking flag and change status to UNCONFIRMED.
No longer blocks: 1276184
Status: NEW → UNCONFIRMED
Ever confirmed: false
Keywords: regression
my guess is that twitch fixed the default html5 player that had the problem following my discussion with them yesterday.
so we're not being served the same player anymore.

There's likely a regression anyway so I will ask them if it's possible to access to the player that was used when this bug was reported.
Flags: needinfo?(btbn)
The player at http://player.twitch.tv/?volume=0.4&channel=dansgaming&mseDev works flawlessly for me.
The one at https://www.twitch.tv/dansgaming still shows the occasional freezes and video artifacts, didn't have a full freeze today yet, but the video is definitely troubled.

Opening the player.twitch.tv one via https complains about missing Flash and plays audio-only.
Which can be workarounded by adding &html5: https://player.twitch.tv/?volume=0.4&channel=dansgaming&mseDev&html5

All I did to get the HTML5 player on the main website was completely uninstalling flash from my PC(Windows 10 x64, running Firefox 64 bit version).
It should be noted that I am logged in and a Turbo Subscriber. Logging out and/or opening the site in a private window results in the player not working with a black screen, also for the player.twitch.tv one.
Can't test if Turbo is required, but they mentioned in a recent blog post that the new HTML5 player will be rolled out for Turbo-Users only(as it can't play ads yet I'd guess): https://blog.twitch.tv/coming-soon-html5-video-player-beta-cdb94b026a8c

Also, for me it's no longer required to disable security.mixed_content.block_active_content, the playlist and segments are all served via https while I'm logged in.

Now the interesting thing:
https://player.twitch.tv/?volume=0.4&channel=dansgaming&mseDev&html5 shows the same freezes and artifacts for me as the player on the main site. Changing https to http makes it play flawlessly.
(In reply to btbn from comment #12)
> The player at http://player.twitch.tv/?volume=0.4&channel=dansgaming&mseDev
> works flawlessly for me.
> The one at https://www.twitch.tv/dansgaming still shows the occasional
> freezes and video artifacts, didn't have a full freeze today yet, but the
> video is definitely troubled.

that's was to be expected with the old html5 player as the data being fed was incorrect, video artifacts were normal.

> 
> Opening the player.twitch.tv one via https complains about missing Flash and
> plays audio-only.
> Which can be workarounded by adding &html5:
> https://player.twitch.tv/?volume=0.4&channel=dansgaming&mseDev&html5

html5 is the old player and shouldn't be used. You should use mseDev instead
With mseDev the player only works via http as of yet. They probably didn't update it for their now https capable CDN. Strange thing is that it does download the video segments via https.

So it seems like the main website also still uses that older player, which is where the issues come from.

I just confirmed that all of those "bad players" work perfectly fine in Firefox 47 though.
Tested with the following URLs, while being logged in as Turbo-User:
https://www.twitch.tv/dansgaming
https://player.twitch.tv/?volume=0.4&channel=dansgaming&html5
https://player.twitch.tv/?volume=0.4&channel=dansgaming
http://player.twitch.tv/?volume=0.4&channel=dansgaming

In Firefox 47.0.1 they play fine, with no visible artifacts or freezes, even after several minutes.
In Firefox 48.0b7 I almost immediately get artifacts, and after ~30 seconds it starts freezing, until it eventually freezes completely after a few minutes.

The only one that works fine in 48 is http://player.twitch.tv/?volume=0.4&channel=dansgaming&mseDev

So I'm not sure if this is a valid regression in Firefox if it's known that their older HTML5 player provides broken data.
It did work fine in 47 though, and some change in 48 broke it.
ooooh, I now get it. if you are using the old player, all video frames are incorrectly tagged as keyframes.

Change in bug 1276184 introduces a workaround that if a keyframe is seen, it assumes it's a new block of data and search where to insert that new block. This completely breaks GOP detection (seeing that a GOP is now incorrectly assumed to be a single video frame)

Now that makes sense... would also explain why you're seeing the video corruption as frames as incorrectly re-ordered.

I'm going to write a workaround so that the fix introduced in bug 1276184 is narrowed only to the case that had the original bug (webm container)
Mind you, the data is buggy anyway. Will work with live stream and only if the user never attempts to seek
Some invalid streams incorrectly tag all frames as keyframes, which cause the frames to be inserted in the wrong order in the trackbuffer.

Review commit: https://reviewboard.mozilla.org/r/63924/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/63924/
Attachment #8770507 - Flags: review?(gsquelart)
Blocks: 1276184
platform-rel: --- → ?
Whiteboard: [platform-rel-Twitch]
Comment on attachment 8770507 [details]
Bug 1285987: Narrow the workaround added in bug 1276184 to only be effective with webm.

https://reviewboard.mozilla.org/r/63924/#review61118
Attachment #8770507 - Flags: review?(gsquelart) → review+
Pushed by jyavenard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fa68522872c7
Narrow the workaround added in bug 1276184 to only be effective with webm. r=gerald
Comment on attachment 8770507 [details]
Bug 1285987: Narrow the workaround added in bug 1276184 to only be effective with webm.

Approval Request Comment
[Feature/regressing bug #]:1276184
[User impact if declined]: some streams will stop playing (in particular Amazon live streams and twitch.tv). While invalid, those streams played okayish before. Now they won't play at all.
[Describe test coverage new/current, TreeHerder]: manual tests.
[Risks and why]: can't think of any. It's a partial revert of the regressing bug, limiting the conditions in which the workaround was applied (and will currently be strictly limited to YouTube)
[String/UUID change made/needed]: none
Attachment #8770507 - Flags: approval-mozilla-beta?
Attachment #8770507 - Flags: approval-mozilla-aurora?
Once we verify this fix on Nightly I do think we should uplift to aurora and beta.
https://hg.mozilla.org/mozilla-central/rev/fa68522872c7
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
Flags: qe-verify+
Hi Cornel,
Can you help to find someone to verify this on nightly?
Flags: needinfo?(cornel.ionce)
I don't think there's much to verify. The html5 player in use at the time the bug was reported is no longer in use. The new one doesn't have the bug.
Comment on attachment 8770507 [details]
Bug 1285987: Narrow the workaround added in bug 1276184 to only be effective with webm.

This patch fixes a regression which how we deal with invalid data provided by player. Take it in 48 beta 9 and aurora.
Attachment #8770507 - Flags: approval-mozilla-beta?
Attachment #8770507 - Flags: approval-mozilla-beta+
Attachment #8770507 - Flags: approval-mozilla-aurora?
Attachment #8770507 - Flags: approval-mozilla-aurora+
Removing the qe+ and ni? flags, per Comment 25.
Flags: qe-verify+
Flags: needinfo?(cornel.ionce)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: