Skip to content

fix: skip DTG1 packets in parseSei #330

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

Closed
wants to merge 5 commits into from

Conversation

JulianDomingo
Copy link
Contributor

Atypical streams containing 2+ SEI NAL payloads of type 0x04 (CEA-708 caption content) in the sei_rbsp (specifically a DTG1 payload preceding a GA94 payload) fail to display captions in this scenario, as the current logic results in parseSei() prematurely returning with the DTG1 payload.

By checking for the user ID within parseSei, mux.js can continue iterating through the sei_rbsp for the GA94 payload.

Atypical streams containing 2+ SEI NAL payloads of type 0x04 (CEA-708 caption content) in the sei_rbsp, specifically a DTG1 payload preceding a GA94 payload, fail to display captions as mux.js returns prematurely with the DTG1 payload.
By checking for the user ID within this function, mux.js can continue iterating over the sei_rbsp for the GA94.
@joeyparrish
Copy link
Contributor

Shaka Player is also interested in this PR.

@joeyparrish
Copy link
Contributor

@gesinger, could you look at this PR when you have time? This is another fix we'd like to have in our next release of Shaka Player, if possible.

@gkatsev
Copy link
Member

gkatsev commented Apr 9, 2020

Looking at the netlify build, I can see that 608 captions continue to work in bipbop but I don't quite understand what's happening.
A test would be helpful as well.

@gkatsev
Copy link
Member

gkatsev commented Apr 9, 2020

looking at the spec and re-reading the description and code again, I guess what's happening is that we're only accounting for sei packets in the AFD format and exit early but it's possible that in ATSC streams, there's more data that we should parse through and then exit on the GA94 payload? At the same time, we don't want to accumulate the extra payloads because they won't be caption data. Am I understanding it correctly?
Feel free to point me at the appropriate specs and what not.

@JulianDomingo
Copy link
Contributor Author

I don't believe mux.js would accumulate extra payloads with this change (the returned payload wouldn't contain non-caption data).
The intention is to have mux.js ensure it always returns the GA94 payload in the scenario where a stream contains both an sei packet of AFD and ATSC format. Currently, mux.js expects the stream to contain only one sei packet format. For example, mux.js would return the AFD payload if it appears first in the stream since it only checks for payload type 0x04 ("USER_DATA_REGISTERED_ITU_T_T35"). Visually:
... -> AFD_data (parseSei() stops here and returns) -> ATSC1_data -> ...
but should be:
... -> AFD_data (skip) -> ATSC1_data (parseSei() stops here and returns) -> ...

Spec-wise I don't see any issues, but this PR stemmed from an internal report where streams didn't display captions, and after running it through a media analyzer, they all contained both an AFD and ATSC sei packet. With the PR, captions were displayed properly.

@gkatsev
Copy link
Member

gkatsev commented Apr 10, 2020

Thanks! It does seem like it's correct, I was asking about the specs mostly because I have very little knowledge on this subject matter.
Adding a test like https://github.com/videojs/mux.js/blob/master/test/caption-stream.test.js#L56-L91 would be super helpful, if you can.

Atypical streams containing 2+ SEI NAL payloads of type 0x04 (CEA-708 caption content) in the sei_rbsp, specifically a DTG1 payload preceding a GA94 payload, fail to display captions as mux.js returns prematurely with the DTG1 payload.
By checking for the user ID within this function, mux.js can continue iterating over the sei_rbsp for the GA94.
@JulianDomingo
Copy link
Contributor Author

Sorry, please refer to #333 instead.

shaka-bot pushed a commit to shaka-project/shaka-player that referenced this pull request Apr 14, 2020
This gets us a fix for a closed caption parsing issue described in
videojs/mux.js#330 and fixed in videojs/mux.js#333:

> Atypical streams containing 2+ SEI NAL payloads of type 0x04
> (CEA-708 caption content) in the sei_rbsp (specifically a DTG1
> payload preceding a GA94 payload) fail to display captions in this
> scenario, as the current logic results in parseSei() prematurely
> returning with the DTG1 payload.
>
> By checking for the user ID within parseSei, mux.js can continue
> iterating through the sei_rbsp for the GA94 payload.

Change-Id: I9d90419643279a1273187e0354b5e991cd609ba2
joeyparrish added a commit to shaka-project/shaka-player that referenced this pull request Apr 22, 2020
This gets us a fix for a closed caption parsing issue described in
videojs/mux.js#330 and fixed in videojs/mux.js#333:

> Atypical streams containing 2+ SEI NAL payloads of type 0x04
> (CEA-708 caption content) in the sei_rbsp (specifically a DTG1
> payload preceding a GA94 payload) fail to display captions in this
> scenario, as the current logic results in parseSei() prematurely
> returning with the DTG1 payload.
>
> By checking for the user ID within parseSei, mux.js can continue
> iterating through the sei_rbsp for the GA94 payload.

Backported to v2.5.x

Change-Id: I9d90419643279a1273187e0354b5e991cd609ba2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants