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

VTT in MP4: samples with multiple VTTCue box not rendered correctly #1266

Closed
kqyang opened this issue Feb 1, 2018 · 4 comments
Closed

VTT in MP4: samples with multiple VTTCue box not rendered correctly #1266

kqyang opened this issue Feb 1, 2018 · 4 comments
Assignees
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@kqyang
Copy link
Contributor

kqyang commented Feb 1, 2018

NOTE: For bugs, if you delete this template, we will send it again and ask you to fill it out.

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

Yes

What version of Shaka Player are you using?:

I am using the public demo app.

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

Yes.

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

Yes.

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

demo app.

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

What browser and OS are you using?:

Chrome on Linux.

What are the manifest and license server URIs?:

Segmented VTT in MP4:
https://storage.googleapis.com/wvtemp/kqyang/vtt5/bunny_live.mpd

VTT in text file:
https://storage.googleapis.com/wvtemp/kqyang/vtt5/bunny_vod.mpd

(NOTE: you can send the URIs to shaka-player-issues@google.com instead, but please use GitHub and the template for the rest)
(NOTE: a copy of the manifest text or an attached manifest will not be enough to reproduce your issue, and we will ask you to send a URI instead)

What did you do?

Play: https://shaka-player-demo.appspot.com/demo/#asset=https://storage.googleapis.com/wvtemp/kqyang/vtt5/bunny_live.mpd;lang=en-US;build=uncompiled

What did you expect to happen?

Render "WebVtt testing Line 1 (1.0 - 8.5)" and "WebVtt testing Line 2 (1.0 - 8.5)" from 1s to 8.5s and render "WebVtt testing (5.0 - 12.5)" from 5s to 12.5s.

What actually happened?

Seeing "WebVtt testing Line 1 (1.0 - 8.5)" from 1s to 8.5s and "WebVtt testing Line 2 (1.0 - 8.5)" from 8.5s to 12.5s.

The text version works. The streams work in dash.js as well although with line 1 and line 2 reversed.

Here is the contents of the VTT file in text:

WEBVTT

1
00:00:01.000 --> 00:00:08.500
WebVtt testing Line 1 (1.0 - 8.5)

2
00:00:01.000 --> 00:00:08.500
WebVtt testing Line 2 (1.0 - 8.5)

3
00:00:05.000 --> 00:00:12.500
WebVtt testing (5.0 - 12.5)
@TheModMaker
Copy link
Contributor

It looks like the MP4 text segment contains a trun box that contains 3 samples but there are 6 vttc boxes. I have only looked at the spec a little, but it seems that they should be the same and we assume that they are. If that is not the case, how are we supposed to map the vttc cue to a sample time?

@kqyang
Copy link
Contributor Author

kqyang commented Feb 1, 2018

Yes, exactly, the cues in the same sample does have identical time. Right now, the second cue is not shown in Shaka Player.

@TheModMaker
Copy link
Contributor

So the problem is that we just parse the mdat as a box structure and then associate the vttc boxes we see with the trun. What we should be doing is using the trun to find the samples and then parse just the sample. Then we should treat multiple vttc in the sample as having the same time.

@TheModMaker TheModMaker added type: bug Something isn't working correctly and removed needs triage labels Feb 1, 2018
@TheModMaker TheModMaker added this to the v2.4.0 milestone Feb 1, 2018
@theodab theodab assigned theodab and unassigned michellezhuogg Mar 22, 2018
shaka-bot pushed a commit that referenced this issue Mar 27, 2018
Previously, we would read each individual VTTC and VTTE box in the
MDAT and associate them with durations in the TRUN. This worked for a
lot of content, but if sampleSize is defined in the TRUN, a duration
might refer to multiple VTTC boxes.

This changes the VTT in mp4 reader to parse the MDAT based on the TRUN,
to account for such situations.

For the moment, this only accounts for a single MDAT, and assumes that
the MDAT contains nothing but vttc or vtte boxes, listed in order.

Issue #1266

Change-Id: I56e310d085abdda16e968761ed3b4fd0cc5e24d0
@theodab theodab closed this as completed Mar 27, 2018
joeyparrish pushed a commit that referenced this issue Mar 29, 2018
Previously, we would read each individual VTTC and VTTE box in the
MDAT and associate them with durations in the TRUN. This worked for a
lot of content, but if sampleSize is defined in the TRUN, a duration
might refer to multiple VTTC boxes.

This changes the VTT in mp4 reader to parse the MDAT based on the TRUN,
to account for such situations.

For the moment, this only accounts for a single MDAT, and assumes that
the MDAT contains nothing but vttc or vtte boxes, listed in order.

Backported to v2.3.x

Issue #1266

Change-Id: I56e310d085abdda16e968761ed3b4fd0cc5e24d0
@joeyparrish
Copy link
Member

Fix cherry-picked to v2.3.5.

@shaka-project shaka-project locked and limited conversation to collaborators May 26, 2018
@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
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

6 participants