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

How do we enable subtitles baked in the .ts file? #6647

Open
KoningWouter opened this issue Aug 25, 2024 · 1 comment
Open

How do we enable subtitles baked in the .ts file? #6647

KoningWouter opened this issue Aug 25, 2024 · 1 comment
Labels

Comments

@KoningWouter
Copy link

What do you want to do with Hls.js?

We have a stream that has subtitles baked into the .ts file. So it doesn't have a subtitle track in the .m3u8 file.

Since there is a SubtitleStreamController we would think that subtitle tracks that are baked into the ts file (not in the m3u8 file) are supported. But we can't get it to work.

What have you tried so far?

In VLC we are able to select the subtitle track and get it to display.

We tried logging events:

hlsRef.current.on(Hls.Events.SUBTITLE_FRAG_PROCESSED, (event, data) => { console.log('subtitle frag processed'); }); hlsRef.current.on(Hls.Events.SUBTITLE_TRACK_LOADED, (event, data) => { console.log('subtitle track loaded'); }); hlsRef.current.on(Hls.Events.SUBTITLE_TRACK_LOADING, (event, data) => { console.log('subtitle track loading'); }); hlsRef.current.on(Hls.Events.SUBTITLE_TRACK_SWITCH, (event, data) => { console.log('subtitle track switched'); console.log(data); console.log(hlsRef.current.subtitleTracks.length); }); hlsRef.current.on(Hls.Events.SUBTITLE_TRACK_CLEARED, (event, data) => { console.log('subtitle track cleared'); }); hlsRef.current.on(Hls.Events.SUBTITLE_TRACK_UPDATED, (event, data) => { console.log('subtitle track updated'); }); hlsRef.current.on(Hls.Events.CUES_PARSED, (event, data) => { console.log('cues parsed'); }); hlsRef.current.on(Hls.Events.NON_NATIVE_TEXT_TRACKS_FOUND, (event, data) => { console.log('Non native text tracks found'); }, );

But none of these events fire.

Are subtitle tracks baked into the ts file supported by Hls.js and if not could anybody give us some clues on how to implement it?

@KoningWouter KoningWouter added Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. Question labels Aug 25, 2024
@robwalch
Copy link
Collaborator

robwalch commented Aug 26, 2024

SubtitleStreamController is responsible for loading WebVTT and IMSC1 subtitle segments only with the SubtitleTrackController responsible for selection of the media option playlists containing those segments.

608 captions (and all captions and subtitle cues) are handled by the TimelineController. 608 Captions are parsed on FRAG_PARSING_USERDATA and output to a "captions" TextTrack or via CUES_PARSED events depending on the renderTextTracksNatively option which defaults to true (output to TextTrack).

@robwalch robwalch removed the Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. label Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants