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

MP4 TTML segments with multiple samples are not correctly handled #8087

Closed
julijane opened this issue Feb 15, 2025 · 0 comments · Fixed by #8088
Closed

MP4 TTML segments with multiple samples are not correctly handled #8087

julijane opened this issue Feb 15, 2025 · 0 comments · Fixed by #8088
Labels
component: TTML The issue involves TTML subtitles specifically priority: P1 Big impact or workaround impractical; resolve before feature release type: bug Something isn't working correctly
Milestone

Comments

@julijane
Copy link
Contributor

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

If the problem is related to FairPlay, have you read the tutorial?

n/a

What version of Shaka Player are you using?

v4.13.2

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

Can you reproduce the issue with the latest code from main?
yes

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

If custom app, can you reproduce the issue using our demo app?
not tried, but as the issue is clearly not implemented handling logic, there is no need to

What browser and OS are you using?
Chrome on Linux, not that it matters.

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

What are the manifest and license server URIs?

n/a

What configuration are you using? What is the output of player.getNonDefaultConfiguration()?

n/a

What did you do?

Attempted to playback a DASH presentation which has a caption track where the segments have multiple samples. This is allowed as per ISO14496-12 and ISO23000-19. gpac creates such segments.

What did you expect to happen?
Subtitles to be displayed.

What actually happened?

Errors in the console about not being able to parse the TTML XML.

Are you planning to send a PR to fix it?
yes, the fix is already implemented.

@julijane julijane added the type: bug Something isn't working correctly label Feb 15, 2025
@shaka-bot shaka-bot added this to the v4.14 milestone Feb 15, 2025
julijane added a commit to julijane/shaka-player that referenced this issue Feb 15, 2025
Fixes shaka-project#8087

Implements handling of multiple samples in a segment. Also fixes the testdata for the multiple MDAT test, as the prior data was invalid (not conforming to ISO14496-12).
julijane added a commit to julijane/shaka-player that referenced this issue Feb 15, 2025
Fixes shaka-project#8087

Implements handling of multiple samples in a segment. Also fixes the testdata for the multiple MDAT test, as the prior data was invalid (not conforming to ISO14496-12).
@theodab theodab added component: TTML The issue involves TTML subtitles specifically priority: P1 Big impact or workaround impractical; resolve before feature release labels Feb 15, 2025
julijane added a commit to julijane/shaka-player that referenced this issue Feb 15, 2025
Fixes shaka-project#8087

Implements handling of multiple samples in a segment. Also fixes the testdata for the multiple MDAT test, as the prior data was invalid (not conforming to ISO14496-12).
julijane added a commit to julijane/shaka-player that referenced this issue Feb 17, 2025
Fixes shaka-project#8087

Implements handling of multiple samples in a segment. Also fixes the testdata for the multiple MDAT test, as the prior data was invalid (not conforming to ISO14496-12).
julijane added a commit to julijane/shaka-player that referenced this issue Feb 17, 2025
Fixes shaka-project#8087

Implements handling of multiple samples in a segment. Also fixes the testdata for the multiple MDAT test, as the prior data was invalid (not conforming to ISO14496-12).
avelad pushed a commit that referenced this issue Feb 17, 2025
Fixes #8087

Implements handling of multiple samples in a MP4/ISOBMFF/DASH TTML
segment/fragment. Such segments are allowed by ISO14496-12 and
ISO23000-19. gpac creates such segments. The prior code just treated the
full MDAT as one TTML XML document and tried to parse it in whole
without accounting for sample(s). A testcase is included which was
created by taking the testdata from ttml-segment.mp4 and splitting the
subtitles into two independent TTML-XML documents, which then were put
as individual samples.

The testdata for the prior existing multiple MDAT testcase was invalid.
It was created by taking the same ttml-segment.mp4 as a source and just
duplicating the MDAT box, but without then also fixing the TRUN box. The
duplicated data was thus not referenced. The test case still worked,
because the prior code did not look at the TRUN box and the sample
specification at all and just handled any full MDAT box = 1 sample. The
testdata was replaced with a new file, which is basically the same as
for the multiple samples case, but with the two samples split into two
MDAT boxes.
avelad pushed a commit that referenced this issue Feb 17, 2025
Fixes #8087

Implements handling of multiple samples in a MP4/ISOBMFF/DASH TTML
segment/fragment. Such segments are allowed by ISO14496-12 and
ISO23000-19. gpac creates such segments. The prior code just treated the
full MDAT as one TTML XML document and tried to parse it in whole
without accounting for sample(s). A testcase is included which was
created by taking the testdata from ttml-segment.mp4 and splitting the
subtitles into two independent TTML-XML documents, which then were put
as individual samples.

The testdata for the prior existing multiple MDAT testcase was invalid.
It was created by taking the same ttml-segment.mp4 as a source and just
duplicating the MDAT box, but without then also fixing the TRUN box. The
duplicated data was thus not referenced. The test case still worked,
because the prior code did not look at the TRUN box and the sample
specification at all and just handled any full MDAT box = 1 sample. The
testdata was replaced with a new file, which is basically the same as
for the multiple samples case, but with the two samples split into two
MDAT boxes.
joeyparrish pushed a commit that referenced this issue Feb 22, 2025
Fixes #8087

Implements handling of multiple samples in a MP4/ISOBMFF/DASH TTML
segment/fragment. Such segments are allowed by ISO14496-12 and
ISO23000-19. gpac creates such segments. The prior code just treated the
full MDAT as one TTML XML document and tried to parse it in whole
without accounting for sample(s). A testcase is included which was
created by taking the testdata from ttml-segment.mp4 and splitting the
subtitles into two independent TTML-XML documents, which then were put
as individual samples.

The testdata for the prior existing multiple MDAT testcase was invalid.
It was created by taking the same ttml-segment.mp4 as a source and just
duplicating the MDAT box, but without then also fixing the TRUN box. The
duplicated data was thus not referenced. The test case still worked,
because the prior code did not look at the TRUN box and the sample
specification at all and just handled any full MDAT box = 1 sample. The
testdata was replaced with a new file, which is basically the same as
for the multiple samples case, but with the two samples split into two
MDAT boxes.

Backported to v4.9.x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: TTML The issue involves TTML subtitles specifically priority: P1 Big impact or workaround impractical; resolve before feature release type: bug Something isn't working correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants