Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playback freezes for DASH VOD stream with captions enabled #2094

Closed
vpunjabi opened this issue Aug 9, 2019 · 11 comments
Closed

Playback freezes for DASH VOD stream with captions enabled #2094

vpunjabi opened this issue Aug 9, 2019 · 11 comments
Assignees
Labels
component: captions/subtitles The issue involves captions or subtitles status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@vpunjabi
Copy link

vpunjabi commented Aug 9, 2019

Have you read the FAQ and checked for duplicate open issues?
Yes

What version of Shaka Player are you using?
2.5.4

Can you reproduce the issue with our latest release version?
Yes

Can you reproduce the issue with the latest code from master?
NA

Are you using the demo app or your own custom app?
Demo

If custom app, can you reproduce the issue using our demo app?
Yes

What browser and OS are you using?
Chrome on MacOS

For embedded devices (smart TVs, etc.), what model and firmware version are you using?
NA

What are the manifest and license server URIs?
Sent separately

What did you do?

  1. Extract media url from json file. Content is DRM protected (widevine).
  2. Open Demo app, go to Custom content and enter use media url from step 1.
  3. Play content and enable captions.
  4. Seek to around 6 minutes into the clip.
  5. Notice that playback gets stuck at 6:23.

What did you expect to happen?

  1. Playback should continue to play past 6:23 whether captions are enabled or not.
  2. Ad at 6:23 would play before switching back to content at 6:24.

What actually happened?

  1. When captions are disabled stream continues to play even after 6:23. If captions are enabled stream gets stuck at 6:23 and no new segments are downloaded after segment 93.
  2. Ads are not DRM protected but content is. After 6:23 ad should play but ad is skipped.
@TheJohnBowers
Copy link
Contributor

I have a demo stream that can reproduce this here: https://shaka-player-demo.appspot.com/demo/#audiolang=en-US;textlang=en-US;uilang=en-US;asset=https://content.uplynk.com/299ca57da2d04bdaa28c3c643467b3a1.mpd?prettydash=1&vcodec=avc;license=https://content.uplynk.com/wv;panel=CUSTOM%20CONTENT;build=uncompiled -- It appears to be a problem with CC608 embedded in FMP4 and then playing across period boundaries. In the above example the second period starts at 22 seconds. So if you play back and turn captions on, the playback hangs at 22 seconds. If you leave captions turned off it is fine. If you turn captions on after 22 seconds, playback works fine until a new period is hit. The error I see in the console is Assertion failed: All MediaStates should need the same Period or be performing updates.

@TheModMaker
Copy link
Contributor

I've confirmed the bug with your asset. We have a "fake" stream for embedded text tracks that we use for the track list and StreamingEngine basically ignores it. Unfortunately it causes problems with Period transitions since it won't try to switch Periods (since it doesn't have any). So the text stream is not getting updated but the other streams are waiting for a Period transition.

We are currently flattening Periods, and this will probably help with that. So we will probably be waiting to see if this error persists after that change.

@TheModMaker TheModMaker added type: bug Something isn't working correctly component: captions/subtitles The issue involves captions or subtitles and removed needs triage labels Aug 14, 2019
@TheModMaker TheModMaker added this to the v2.6 milestone Aug 14, 2019
@AnilPadi
Copy link

Can you please let us know when is the release date for 2.6 Shaka Player? We are looking for this fix as this is breaking our current playback when the captions are turned on.

@AnilPadi
Copy link

Any update, please?

@theodab
Copy link
Contributor

theodab commented Aug 23, 2019

At the moment the v2.6 milestone is 58% complete. We haven't set any hard and fast due date for it, so all I can say is it probably won't be for a little while.
For this issue in specific, we are currently working on flattening periods, as @TheModMaker mentioned. Once that is out, if it fixes your problem, you could build from source, instead of waiting for v2.6

@joeyparrish
Copy link
Member

@AnilPadi, if we can fix this bug without the period flattening feature in v2.6, we could cherry-pick that fix to v2.5.x. We are about to release v2.5.5 either today or possibly Monday, so the earliest you might see a fix for this issue would be v2.5.6 after that.

@joeyparrish
Copy link
Member

This could be a duplicate of #2075. @AnilPadi, @TheJohnBowers, could you please test the fix suggested by @sath33sh in that issue?

diff --git a/lib/media/streaming_engine.js b/lib/media/streaming_engine.js
index 2b8840cf..e6d04b1d 100644
--- a/lib/media/streaming_engine.js
+++ b/lib/media/streaming_engine.js
@@ -1406,6 +1406,14 @@ shaka.media.StreamingEngine.prototype.update_ = function(mediaState) {
   // of SegmentReferences as an indicator to determine Period boundaries
   // because a SegmentIndex can provide SegmentReferences outside its Period.
   mediaState.needPeriodIndex = needPeriodIndex;
+  if (mediaState.type == ContentType.VIDEO) {
+    // Update needPeriodIndex of text stream if it is CEA closed captions
+    const textState = this.mediaStates_.get(ContentType.TEXT);
+    if (textState && textState.stream.mimeType ==
+          shaka.util.MimeUtils.CLOSED_CAPTION_MIMETYPE) {
+      textState.needPeriodIndex = needPeriodIndex;
+    }
+  }
   if (needPeriodIndex != currentPeriodIndex) {
     shaka.log.debug(logPrefix,
                     'need Period ' + needPeriodIndex,

@AnilPadi
Copy link

@joeyparrish.

Thanks for your response. Basically, we would like to have cherry-picked for 2.5.x that way we can ask the CAF receiver team to have this fix included and then we can consume this fix on Chromecast. Currently, we are waiting for CEA-608 closed captions to work on Live and VOD for about a year. Can you please integrate this once @TheJohnBowers confirms.

@joeyparrish
Copy link
Member

If we can confirm the fix suggested by @sath33sh, we could maybe integrate it into v2.5.5, but definitely by v2.5.6. I am coordinating updates with the CAF team.

TheModMaker added a commit that referenced this issue Aug 23, 2019
Since embedded text tracks are not "real" tracks, we need to ignore them
when handling Period transitions.  This ensures that the other streams
will handle the transition instead of waiting for the text stream to get
updated.

Fixes #2075
Fixes #2094

Change-Id: I2c7c92cb04795edb3f7695677ee6745bad3f4471
@joeyparrish
Copy link
Member

Good news! This was fixed today and the fix will be in v2.5.5.

@AnilPadi
Copy link

Thanks we will test and let you know.

@shaka-project shaka-project locked and limited conversation to collaborators Oct 22, 2019
@TheModMaker TheModMaker self-assigned this Feb 27, 2020
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: captions/subtitles The issue involves captions or subtitles status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

7 participants