-
Notifications
You must be signed in to change notification settings - Fork 6k
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 to enhance rendering of Bitmap TTML subtitles ? #6950
Comments
What do you mean by 'enhanced'? It looks like maybe the subtitles in your media are just low resolution and you're seeing the resultant pixelation. There's no easy hook like you've described to mutate the cues just before they get displayed. I'm not sure whether it's something that would be generally useful, so I think we'd be hesitant to add it for this use-case specifically. A possible solution: You can register this custom decoder by creating a new implementation of class ImageEnhancingTtmlDecoder extends SimpleSubtitleDecoder {
TtmlDecoder delegate;
@Override
Subtitle decode(byte[] bytes, int length, boolean reset)
throws SubtitleDecoderException {
Subtitle subtitle = delegate.decde(bytes, length, reset);
return new ImageEnhancingTtmlSubtitle(subtitle);
}
}
class ImageEnhancingTtmlSubtitle implements Subtitle {
Subtitle delegate;
@Override
List<Cue> getCues(long timeUs) {
List<Cue> cues = delegate.getCues(timeUs);
return enhanceImageCues(cues);
}
} |
The subtitles are low resolution in some source I get, you're right. |
Ah interesting, thanks for pointing this out. I tried to reproduce this locally but it doesn't seem to make any difference to the bitmap subtitles I have access to. Could you provide the bitmap subtitles you're using to test this, so I can confirm the improvement? |
Stream URL provided via private message. |
Thanks for the test stream, I can see a significant improvement. I'll submit a change to enable this. |
issue:#6950 PiperOrigin-RevId: 307411067
This is now available in |
issue:#6950 PiperOrigin-RevId: 307411067
[REQUIRED] Searched documentation and issues
Searched in Exoplayer documentation, current and past issues #4657 and look had a look into SubtitleView.java
[REQUIRED] Question
I have lot of Dash streams with TTML tracks where subtitles are Bitmap, not text.
The subtitles are displayed as expected but the Bitmap rendering could be enhanced:
![image](https://user-images.githubusercontent.com/51912261/73913566-aa347100-48b7-11ea-8c55-a4252dabc7d9.png)
Is there a hook or a way to process the Cue containing those Bitmap before rendering those on screen?
I had a look into SubtitleView.onCues(List cues) method but I don't see how extend/override it when building the player:
I'm using exoplayer 2.11.1
The text was updated successfully, but these errors were encountered: