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

Embedded captions not consistently displaying #10175

Closed
RicFlinn opened this issue Apr 11, 2022 · 2 comments
Closed

Embedded captions not consistently displaying #10175

RicFlinn opened this issue Apr 11, 2022 · 2 comments
Assignees
Labels

Comments

@RicFlinn
Copy link

RicFlinn commented Apr 11, 2022

I'm playing various MPEG2/TS streams using ProgressiveMediaSource. These streams have embedded CEA-608 and/or 708 captions, but not all of the streams display captions with ExoPlayer. I've ran them through other media players and verified they display captions.

I'm not attempting to modify the caption display at all, just enable them with default settings. I'm using a track selector:

DefaultTrackSelector trackSelector = new DefaultTrackSelector(this);
trackSelector.setParameters(
		trackSelector.buildUponParameters()
				.setPreferredTextLanguage("en")
				.setSelectUndeterminedTextLanguage(true)
);

Works great for some streams, and for DASH with TTML subtitles, but not for all streams with embedded 708 captions. Do I need more steps to enable CEA captioning?

I'm using ExoPlayer v 2.16.1; I tried 2.17.1 as well.

@icbaker
Copy link
Collaborator

icbaker commented Apr 13, 2022

This is likely due to the track not being detected by the TsExtractor. If you add an EventLogger with your TrackSelector (or use our demo app) you will see the tracks that have been found logged to logcat.

You may find that the files that ExoPlayer doesn't find subtitle tracks in aren't declaring the tracks in a way that ExoPlayer can detect. We used to create a subtitle track for all TS files due to this ambiguity, but stopped in 6d0696a (included in 2.12.0). As explained in the release notes change in that commit, you can enable the output by passing a non-empty list of Format objects when constructing a DefaultTsPayloadReaderFactory, probably a list like:

ImmutableList.of(
    Format.Builder()
        .setSampleMimeType(MimeTypes.APPLICATION_CEA608)
        .build())

If that doesn't resolve the problem, please provide the media samples you're not seeing subtitles for so we can investigate further. Please either upload them here or send to dev.exoplayer@gmail.com using a subject in the format Issue #10175. Please also update this issue to indicate you’ve done this.

@RicFlinn
Copy link
Author

Thanks @icbaker, it's just as you suspected. Using a custom DefaultTsPayloadReaderFactory seems to have resolved the issue in all of the streams I've tested so far. Calling this one done.

@google google locked and limited conversation to collaborators Jun 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants