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.45k stars 335 forks source link

Add support to ARIB subtitles #911

Open saumarh opened 7 months ago

saumarh commented 7 months ago

While CEA-608/708 closed caption standards are used by the ATSC system in North America, DVB Subtitles / DVB Teletext defined in DVB standard are used in Europe and many parts of the world, Japan established its own TV broadcasting standard ISDB that includes a kind of caption service defined in ARIB STD-B24 by the Association of Radio Industries and Businesses (ARIB).

Brazil also adopted ISDB-T International for their broadcasting by establishing Brazilian version SBTVD / ISDB-Tb based on the Japanese standard, which has been widely used in South America countries and around the world. Brazilian version also includes a caption service for Latin languages defined in ABNT NBR 15606-1 which is modified from ARIB STD-B24 specification. Philippines also adopted ISDB-T International based on the Brazilian standards, but uses UTF-8 for caption encoding based on the Japansese specification ARIB STD-B24.

Though ISDB-based TV broadcasting has been operating for about 20 years, ARIB based caption is still lacking support in general players.

(above text copied from https://github.com/xqq/libaribcaption - this library is in use in ffmpeg and vlc projects)

Proposed solution

Create a subtitle decoder for ARIB subtitles and specify it when needed: DefaultExtractorsFactory extractorsFactory = new DefaultExtractorsFactory(); extractorsFactory.setTsSubtitleFormats(ImmutableList.of( // new Format.Builder().setSampleMimeType(MimeTypes.APPLICATION_ARIB).build(), new Format.Builder().setSampleMimeType(MimeTypes.APPLICATION_CEA608).build()));

Alternatives considered

Right now our player supports 2 implementations: libVLC and ExoPlayer. We're using VLC for multicast streams coming from a tuner-to-IP gateway. This gateway is just a bypass of tuner input. Resulting streams are untouched. VLC is able to decode ARIB subtitles.

ExoPlayer is in use for DRM protected content. We'd like to keep ExoPlayer as our only player implementation - reducing code maintenance and app size.

icbaker commented 7 months ago

Thanks for the request! Unfortunately we are unlikely to invest in adding support for this format because it's not really used in the digital & streaming formats that are the main focus of this library.

We would accept high quality PRs for this, but with some important caveats: