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

Multiple simultaneous PGS subtitles #7458

Open
ebr11 opened this issue Jun 2, 2020 · 6 comments
Open

Multiple simultaneous PGS subtitles #7458

ebr11 opened this issue Jun 2, 2020 · 6 comments

Comments

@ebr11
Copy link

ebr11 commented Jun 2, 2020

[REQUIRED] Use case description

The same type of content that would usually use SSA subtitles for multiple subs at once appears to also be authored with PGS subs in this same manner. Exo has the same problem with these that it used to have with SSA/ASS before recently fixed/enhanced. When two subs are to be displayed, the net effect is that one sub flashes and goes away and then nothing is displayed.

Proposed solution

Can the same solution from #6320 be applied to PGS subs?

@andrewlewis
Copy link
Collaborator

@icbaker Please could you take a look?

@icbaker
Copy link
Collaborator

icbaker commented Jun 2, 2020

PgsSubtitle looks to be different to SSA (which is generally decoded from a single text file with all the cues in it). In PGS it seems each Subtitle object comes from a single sample - likely from an MKV file.

Our existing sample data for this doesn't have simultaneous cues - do you have a clip that demonstrates the problem you could share here, or email to dev.exoplayer@gmail.com (subject: "Issue #7458")? Once I can reproduce the behaviour you're seeing I can have a look at how hard it would be to support this.

@ebr11
Copy link
Author

ebr11 commented Jun 2, 2020

Link to sample content has been sent. Thanks.

@icbaker
Copy link
Collaborator

icbaker commented Jun 2, 2020

Thanks for the sample content, I'm able to see behaviour similar to what you describe.

@ebr11
Copy link
Author

ebr11 commented Jun 2, 2020

Thanks very much. While you're looking at PGS rendering, the ability to properly render dual-layer PGS would be much appreciated (just shows outlines now). Let me know if you would like a new issue on that.

@icbaker
Copy link
Collaborator

icbaker commented Jun 3, 2020

Please file a new issue for the dual-layer PGS.

I'm afraid we don't have the time to work on either of these issues immediately, so I can't say when they'll get done. We'd welcome pull requests for either.

If that's something you're interested in taking a look at, PgsDecoder doesn't line up with this summary of the PGS format in a few ways I've spotted so far, some of which are probably related to this:

  • Doesn't read the 'Number of Composition Objects' from the PCS -> I think this is the most important
  • Assumes each END section (type=0x80) is preceded by a single Cue, whereas it seems there can be multiple Objects (i.e. Cues) before each END.
  • Doesn't read Window Definition Segments at all.

The sample media you've provided has multiple composition objects in the same PCS but we only read info about the first one (and we skip important stuff like the object ID).

To support all this properly in PgsDecoder probably requires a fairly significant refactor, because a lot of its code is structured on a single-object-per-sample assumption.

(PgsDecoder refers to the PCS as the 'identifier segment' in case you're trying to line up the code and the spec).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants