-
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
Implement bitmap subtitle support #179
Comments
What's your actual use case for this? You're not actually sending text as bitmaps, presumably? |
This seems to be a good summary: https://codesequoia.wordpress.com/2011/12/15/ttml_dfxp_smptett/ |
@ojw28 The use case is support for DVB subtitles, as described in the article @ened links to. |
In the US at least, I don't think that delivering subtitles as bitmaps would meet FCC captioning requirements, which mandate that the user should be allowed to customize their visual appearance. Bitmap subtitles also wont scale well or look as nice as text rendered on the device, so it feels to me like this is something people should be looking to shift away from. Do you agree with the above? This doesn't necessarily mean we wont add support. I'm just trying to gauge where this is actually useful, and for how long it will remain useful. Thanks! |
IIRC DVB streams are commonly found in taxi TVs here in Asia. The "subtitles" serve information like weather, news, pictures or ads as a picture overlay. |
@ojw28 Bitmap subtitles are suboptimal for many reasons, true. I wouldn't expect any new standard to go for that solution. My impression is that it's widely used, and I couldn't talk my broadcasting customers out of requiring it for their streaming solution. I could do some research to see how widely spread it is and if new solutions are being deployed or planned, it that's useful? I've implemented this for a POC, using an older fork of ExoPlayer, by replacing the TTML parser[1], and using Android's BitmapFactory to create the PNG from the byte array from the base64 in the XML. An onBitmap callback was introduced in the player, akin to onText. The Subtitle/SubtitleHolder class could not be extended, though, and also had to be replaced. |
Just to add another point to this enhancement, but both DVD and BluRay disks use bitmap based subtitles (VOBSUB and PGS). Personally i'd love to see these handled from the Mp4Extractor and WebMExtractor's. |
With the latest ID3-parser fix, the XML data with the SMPTE-TT subtitles are sent to the player through the Id3MetadataListener interface. DemoPlayer#onId3Metadata listens for this event. |
Currently the ExoPlayer code assumes subtitles/text-tracks are always receive in text format (TTML). |
@ojw28 DVB standard is widespread in Europe and Asia. I agree that it is not the best solution for displaying subtitles, but standard is in use by majority of TV broadcasters. |
I already submitted a patch adding dvb subtitle support, as we use it El 1 ago. 2016 9:44 p. m., "GoranNSW" notifications@github.com escribió:
|
Did you take into account the mpeg-ts stream? |
Yep, our service is based on multicast rtp mp2t streams From: GoranNSW notifications@github.com Did you take into account the mpeg-ts stream? — |
Thank you for the info. Looking forward to try it. |
Thank you for your work and for letting me know. This is going to be more than useful, it is one of the main functions I need in my project. Thank you once again! |
Let me know if it works for you, we have only tested in our streams and while we are pretty sure that the subs decoding are implemented correctly (at least for the one area case) the signaling in the PMT of the TS packet could be problematic, we are not sure if there are more ways to signal the DVB subtitles, in the past we have had problems with the AC3 audio streams being signaled differently depending of the contributor. From: GoranNSW notifications@github.com Thank you for your work and for letting me know. This is going to be more than useful, it is one of the main functions I need in my project. Thank you once again! — |
I am sorry for such a long delay in response. I was working on one other project day and night. Here are two samples with working DVB subtitles in VLC player, although exoplayer doesn't support them: http://samples.ffmpeg.org/MPEG-VOB/transport/dvbsub/dvbsubtest.ts |
Have you tried the latest patches?, we have some problems with Android Studio without this: Also make sure that the fake eia-608 track is not activated The only remaining problem we have is that SimpleExoPlayer reload the stream when you enable one subtitle track, also make In any case, we will test your sample streams. regards, Sergio From: GoranNSW notifications@github.com I am sorry for such a long delay in response. I was working on one other project day and night. Here are two samples with working DVB subtitles in VLC player, although exoplayer doesn't support them: http://samples.ffmpeg.org/MPEG-VOB/transport/dvbsub/dvbsubtest.ts — |
You have an ancillary page in your subs and that´s not common in the case of one subtitle service per PID, I have to check if it´s supported in our decoder. From: "tresvecesseis@gmail.com" tresvecesseis@gmail.com Have you tried the latest patches?, we have some problems with Android Studio without this: Also make sure that the fake eia-608 track is not activated The only remaining problem we have is that SimpleExoPlayer reload the stream when you enable one subtitle track, also make In any case, we will test your sample streams. regards, Sergio From: GoranNSW notifications@github.com I am sorry for such a long delay in response. I was working on one other project day and night. Here are two samples with working DVB subtitles in VLC player, although exoplayer doesn't support them: http://samples.ffmpeg.org/MPEG-VOB/transport/dvbsub/dvbsubtest.ts — |
Subtitles are working with your patches, great job! I have to wait and catch when subs are actually displayed in streams I am using, tracks are found and displayed in text selection dialog. |
I have finally succeeded to catch subtitles shown in the stream in VLC player, but in exoplayer track is not visible in selection list, so subtitle can't be displayed. I sent an email with the sample on dev.exoplayer@gmail.com Edit: My mistake, I accidentally tried stream without your patch, now with your patch everything works excellent! |
@GoranNSW thanks for your testing but I'm confused with your comments, are the subtitles working with the demo application and the #1781 pull request? In any case. your published captures: http://samples.ffmpeg.org/MPEG-VOB/transport/dvbsub/dvbsubtest.ts are too short, and the second one have malformed TS packets,. Could you confirm if there are any remaining problems with DVB subtitles? Could you provide longer samples? regards. |
I am sorry for making confusion, subtitles are working with demo app and pull request #1781. Samples I earlier provided are found on the internet, and sample I sent an hour ago is actual sample I am using in my app. I can't post it here because of copyright material. There are no problems with subtitles, if I find them I will report my findings. |
I'm not related to google, my private email is tresvecesseis@gmail.com El 23 sept. 2016 7:43 p. m., "GoranNSW" notifications@github.com escribió:
|
I didn'k knew that, I sent you the sample if you want to test it |
Thanks, we only have streams of our own service and we will appreciate any El 23 sept. 2016 8:13 p. m., "GoranNSW" notifications@github.com escribió:
|
If you need more samples, for example with multiple audio tracks, I can send them to you. |
@tresvecesseis, does ExoPlayer crew going to include your DVB subtitles support patch into official ExoPlayer v2 branch? Could you, please, give some instructions how to apply this patch and then import this into existing project. |
It seems that the patch is not going to be integrated in exoplayer, they consider it a maintenance burden as the library is currently focused in OTT video support rather than IPTV or DTT, so they have put in place an mechanism to be able to implement custom elementary streams reader off-library and we are migrating our player to this API, you could do the same port with the published patch. From: Sergey Nikitin notifications@github.com @tresvecesseis, does ExoPlayer crew going to include your DVB subtitles support patch into official ExoPlayer v2 branch? Could you, please, give some instructions how to apply this patch and then import this into existing project. — |
Hi. We've had bandwidth to look at the TV case in a little more detail recently, so it might be a good time to re-assess this (no promises of course). @AquilesCanta - What do you think? The pull request is here: #1781 @tresvecesseis - Regarding the pull request, can you confirm the code is OK with respect to whatever Google CLA you've signed here and if so remove references to other projects from it? Thanks! |
I'll re-open #1583 and close this one; thanks! |
Currently the ExoPlayer code assumes subtitles/text-tracks are always representable as text.
The metadata stream of the transport stream may contain SMPTE-TT data, an extension of TTML that extends TTML with binary blobs, encoded in base64.
The base64 data are part of the TTML xml structure and may for example contain bitmap subtitles or be used to tunnel other formats, like CEA-608.
My suggestion is to implement SMPTE-TT + PNG support, including the display of the base64-decoded bitmap subtitles in the player.
The text was updated successfully, but these errors were encountered: