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

[MPEGTS] Special case when unrolled DTS and PTS diverge #1049

Closed
zdanek opened this issue Mar 17, 2022 · 0 comments · Fixed by #1050 or #1312
Closed

[MPEGTS] Special case when unrolled DTS and PTS diverge #1049

zdanek opened this issue Mar 17, 2022 · 0 comments · Fixed by #1050 or #1312
Labels
status: archived Archived and locked; will not be updated

Comments

@zdanek
Copy link
Contributor

zdanek commented Mar 17, 2022

System info

Operating System: all
Shaka Packager Version: 2.4.x

Issue and steps to reproduce the problem

mpeg-ts has 33bit timestamps. After reaching 2^33 it starts from (close to) 0 values. It's known in Shaka so during parsing mpeg-ts unrolling can occur. It happens when PTS and DTS are about to pass 2^33 boudary. Next values read from mpeg-ts are unrolled that is they are continued and incremented beyond 2^33 boundary for DTS to be monotonic increasing.

In very rare case there can be a situation when PTS is very close to 2^33 (right before passing the boudary) and PTS already passed so it has a value a bit above 0. This causes for mpeg-ts parser to unroll only DTS so it next values are very big (and above 2^33) and PTS remain small, right above 0. This causes lot's of problems including:

  • PTS - DTS is very big
  • PTS < DTS as PTS is close to 0 and DTS is more than 2^33

During mpeg-ts reading, in this special case PTS should be forced to unroll to maintain PTS close to DTS.

I've prepared a PR #1050 fixing this.

Packager Command:

Extra steps to reproduce the problem?
(1) Parse attached bear-640x360_ptszero_dtswraparound.ts

It has set DTS close to 2^33 and PTS a bit above 0. I had to attach zip as you did not enable 'ts' files.

What is the expected result?
Properly parse.

What happens instead?

<Please attach the input files or email to [email protected].>

joeyparrish added a commit that referenced this issue Oct 27, 2022
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Dec 26, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 26, 2022
sr1990 pushed a commit to sr1990/shaka-packager that referenced this issue Feb 18, 2023
sr1990 pushed a commit to sr1990/shaka-packager that referenced this issue Feb 18, 2023
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
Projects
None yet
1 participant