androidx / media

Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
https://developer.android.com/media/media3
Apache License 2.0
1.73k stars 414 forks source link

Are CEA708 captions supported in HLS? #630

Closed RicFlinn closed 1 year ago

RicFlinn commented 1 year ago

I have an HLS stream that uses MPEG2 transport stream A/V segments, and the video segments include embedded closed captions. The captions are CEA708, but of course they include the embedded 608 captions as well.

When I play the stream with ExoPlayer and enable the text track, it appears to only be displaying the 608 captions. Available tracks show only a single text track:

[ ] Track:0, id=1/8194, mimeType=application/cea-608, supported=YES

Is there a way to tell ExoPlayer to use the 708 captions? If I remember right, with progressive media the app could use a custom TsExtractor that would force use of 708 captions, but I don't see a way to do this with HLS.

Here's a short self-contained HLS stream which has 708 and 608 captions in the video segments, if it's helpful: https://1drv.ms/u/s!Ar-5IRkcwwk9gdgWBtMcsYNU-p_TVQ?e=URL5Ov

icbaker commented 1 year ago

The HLS manifest provided doesn't declare a CLOSED-CAPTIONS attribute, so ExoPlayer doesn't know how to find the CEA-708 captions. Setting this and INSTREAM-ID as described in RFC 8216 should allow ExoPlayer to detect the CEA-708 captions.

RicFlinn commented 1 year ago

Thanks, this is what I needed (and somehow missed before).