hls.js icon indicating copy to clipboard operation
hls.js copied to clipboard

hls.js seems not support 708 closed captions but 608 only

Open featheast opened this issue 1 year ago • 6 comments

What do you want to do with Hls.js?

I'd like to ask if 708 captions are actually supported by hls.js.

The main reason I'm asking here is comparing to 708, 608 is not able to display non-Latin based languages. And I did find hls.js is not the only one having this issue, Bitmovin player seems not able to show the same 708 captions as well. But since it's displaying fine for VHS (VideoJS), I am more wondering if there is a reason for 708 getting ignored, or any specific configs controls the behavior here.

Plus 708 captions can support more than 4, but there is no such configuration within hls.js similar to captionsTextTrack1Label , which is up to 4 only and seems only applied to 608 captions, even though the Doc is showing for CEA-708 caption tracks.

I can share the source link separately if that is helpful. But below are things I have tried:

With HLS sources (both Vod & Live) where both 608 and 708 caption tracks are embedded, it appears only 608 captions will be able to select and display on the player, while 708 ones will be ignored.

For the same sources, if I load into VHS (VideoJS) page: https://videojs-http-streaming.netlify.app/, I am able to see the captions for both 608s and 708s.

Attached a couple screenshots for the closed caption selector to show the difference: VHS: Screenshot 2024-10-06 at 7 19 19 PM Hls.js Screenshot 2024-10-06 at 7 19 52 PM

Here is an output from the MediaInfo to outlining the Text Tracks: Screenshot 2024-10-06 at 7 21 35 PM

And I have also tried to use ccextractor to confirm those captions are able to be extracted and exported into srt files separately.

What have you tried so far?

No response

featheast avatar Oct 06 '24 08:10 featheast

HLS.js only supports 608 captions tracks with some support for 708 characters.

robwalch avatar Oct 06 '24 13:10 robwalch

Hi @robwalch, thanks for the reply. Is this something on the roadmap for hls.js to support? Also I'm a bit confused about the concept of "support for 708 characters", and how does the flag enableCEA708Captions from the API.md mean here, if 708 caption tracks are not supported?

featheast avatar Oct 06 '24 22:10 featheast

It's not on the HLS.js roadmap but we'd gladly accept a contribution that adds support.

robwalch avatar Oct 06 '24 23:10 robwalch

I was going to report on this. Wowza has just turned on 708 caption injection but there isn't a consolidated way to get players to support it. I reported to Shaka to enable P16 control codes for two byte character parsing.

I don't see how it's parsing G0 and G1 captions and the control codes. It needs its own parser on top of 608 ?

https://github.com/shaka-project/shaka-player/pull/7837

my original ticket

https://github.com/shaka-project/shaka-player/issues/7829

The java code showing how 708 caption parsing works and supports 2 byte charsets.

https://android.googlesource.com/platform/frameworks/base/+/master/media/java/android/media/Cea708CaptionRenderer.java#326

danrossi avatar Jan 20 '25 09:01 danrossi

Please file feature requests and/or bug reports with sample assets you need support for, including expected and actual outcomes.

robwalch avatar Jan 20 '25 20:01 robwalch

Hi @robwalch I have a CE-708 stream for non-Latin-1 languages. https://mtoczko.github.io/hls-test-streams/test-cea708-p16/playlist.m3u8 https://mtoczko.github.io/hls-test-streams/test-cea708-p16/captions.txt

mtoczko avatar Jan 23 '25 13:01 mtoczko