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

HLS / DASH support for forced subtitles #988

Closed
vish91 opened this issue Sep 15, 2021 · 7 comments · Fixed by #1020
Closed

HLS / DASH support for forced subtitles #988

vish91 opened this issue Sep 15, 2021 · 7 comments · Fixed by #1020
Labels
component: DASH The issue involves DASH output status: archived Archived and locked; will not be updated type: enhancement New feature or request

Comments

@vish91
Copy link
Contributor

vish91 commented Sep 15, 2021

Does shaka-packager support setting forces subtitles in HLS and DASH. Mainly DASH ?

In HLS it's the stream media tag FORCED
and in DASH its a ROLE forced-subtitles

Dash-Industry-Forum/DASH-IF-IOP#165

Dash-Industry-Forum/Ingest#40

Based on the first issue it looks like Shaka-player and ExoPlayer do support it for HLS and DASH

@kqyang kqyang added component: DASH The issue involves DASH output type: enhancement New feature or request labels Nov 17, 2021
@shaka-bot shaka-bot added this to the Backlog milestone Nov 17, 2021
@kqyang
Copy link
Contributor

kqyang commented Nov 17, 2021

That is not supported right now.

To support DASH forced-subtitles, a new role needs to be added. You can look at other roles to see how to add a new role, e.g. https://github.com/google/shaka-packager/search?q=kRoleCommentary.

To support HLS FORCED media tag, a new stream descriptor needs to be added. You can checkout hls_characteristics to see how to add support for a new stream descriptor: https://github.com/google/shaka-packager/search?q=hls_characteristics. We may use the same stream descriptor tag to signal DASH forced-subtitles too.

@vish91 Do you want to work on it?

@raestrada95
Copy link

@kqyang i am also interested in this function it would be great if you could implement it

@vish91
Copy link
Contributor Author

vish91 commented Jan 4, 2022

@kqyang for DASH I understood and made progress.
For HLS are you suggesting it should be a stream descriptor property like hls_characteristics and not a Media Playlist Tag property ?
Thinking because I see default and autoselect being defined as is_default and is_autoselect in
https://github.com/google/shaka-packager/blob/master/packager/hls/base/master_playlist.cc#L276
That will also help me decide what kind of data type I use if we decide to use it as a stream descriptor so like boolean vs enum string for YES/NO property values.

@kqyang
Copy link
Contributor

kqyang commented Jan 4, 2022

Yes, it needs to be a stream descriptor property. The media playlist tag property is derived internally in the code.

I think you can define it as a boolean and parse it in the same way as dash_only: https://github.com/google/shaka-packager/blob/master/packager/app/stream_descriptor.cc#L224

@vish91
Copy link
Contributor Author

vish91 commented Jan 5, 2022

@kqyang gotcha and if its a stream descriptor. Does it still need to be declared or set after parsing it in stream_descriptor.cc ? Like how the hls_characterisctics after parsing are still being set in media_playlist.cc and hls_notify_muxer_listener. Trying to gauge where the actual conversion would happen from when it's parsed as bool in stream_descriptor to where the media_playlist is getting created.
One more question: once we parse and define the FORCED flag as per spec we should also make sure that AUTOSELECT=YES always if the forced flag is set in the master_playlist.cc file ? Does that sound right ?

@kqyang
Copy link
Contributor

kqyang commented Jan 6, 2022

Does it still need to be declared or set after parsing it in stream_descriptor.cc ?

Yes, I suggest defining an accessor in media_playlist.h similar to characteristics() function.

One more question: once we parse and define the FORCED flag as per spec we should also make sure that AUTOSELECT=YES always if the forced flag is set in the master_playlist.cc file ? Does that sound right ?

I don't think we should set AUTOSELECT to YES for FORCED subtitles.

@defagos
Copy link

defagos commented Jun 30, 2023

I don't think we should set AUTOSELECT to YES for FORCED subtitles.

According to rule 5.11 of the HTTP Live Streaming (HLS) authoring specification for Apple devices forced subtitles SHOULD always have AUTOSELECT=YES.

joeyparrish pushed a commit that referenced this issue Feb 15, 2024
Closes #988

---------

Co-authored-by: Cosmin Stejerean <cstejerean@meta.com>
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Apr 15, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 15, 2024
@cosmin cosmin removed this from the Backlog milestone May 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: DASH The issue involves DASH output status: archived Archived and locked; will not be updated type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants