ExoPlayer
ExoPlayer copied to clipboard
Add support for TS Teletext subtitles
This PR adds support for Teletext subtitles in TS streams.
Some readings:
- EN 300 472 - V1.4.1 - Digital Video Broadcasting (DVB); Specification for conveying ITU-R System B Teletext in DVB bitstreams
- EN 300 468 - V1.16.1 - Digital Video Broadcasting (DVB); Specification for Service Information (SI) in DVB systems
- ETS 300 706 - Enhanced Teletext specification (good luck with this one)
You can test this PR with this sample file, its a dump of a French television channel stream "NRJ12" with 2 teletext tracks : https://drive.google.com/file/d/19ZYsoeUfH85gEilQkaAdLbPhC4CxhDEh/view?usp=sharing You can also compare the result in ExoPlayer with VLC which handles Teletext subs too.
Let me know if you need further info :)
Thanks for sending this - it's quite a large change, so I'm afraid you'll have to bear with me while I find the time to review it.
Do you have any test clips containing teletext subtitles that you could add to this PR? We could use them in:
-
TsExtractorTest
to ensure the track is extracted - Unit tests for the new
DvbTeletextDecoder
Do you have any test clips containing teletext subtitles that you could add to this PR? We could use them in:
* [`TsExtractorTest`](https://github.com/google/ExoPlayer/blob/dev-v2/library/extractor/src/test/java/com/google/android/exoplayer2/extractor/ts/TsExtractorTest.java) to ensure the track is extracted * Unit tests for the new `DvbTeletextDecoder`
3 samples, you click over to the right side of the page "Download"
https://cyberfile.is/Fbo
3 samples, you click over to the right side of the page "Download"
https://cyberfile.is/Fbo
This seems to just open repeated NSFW pop-ups, please upload these somewhere less dubious (I haven't been able to download them yet).
It also looks like these are going to be too large to be added to git and used for automated testing, but may be useful for manual testing. In order to for us to accept this PR we also need some very small sample files (<1MB each) (that can have any copyright assigned under the CLA you've signed) into a git commit and put directly in this PR (in this directory: https://github.com/google/ExoPlayer/tree/dev-v2/testdata/src/test/assets/media/ts).
It might also be good to write a DvbTeletextDecoderTest
- I recently started a Cea608DecoderTest
that might be a useful starting point: https://github.com/google/ExoPlayer/blob/dev-v2/library/extractor/src/test/java/com/google/android/exoplayer2/text/cea/Cea608DecoderTest.java
3 samples, you click over to the right side of the page "Download" https://cyberfile.is/Fbo
This seems to just open repeated NSFW pop-ups, please upload these somewhere less dubious (I haven't been able to download them yet).
It also looks like these are going to be too large to be added to git and used for automated testing, but may be useful for manual testing. In order to for us to accept this PR we also need some very small sample files (<1MB each) (that can have any copyright assigned under the CLA you've signed) into a git commit and put directly in this PR (in this directory: https://github.com/google/ExoPlayer/tree/dev-v2/testdata/src/test/assets/media/ts).
It might also be good to write a
DvbTeletextDecoderTest
- I recently started aCea608DecoderTest
that might be a useful starting point: https://github.com/google/ExoPlayer/blob/dev-v2/library/extractor/src/test/java/com/google/android/exoplayer2/text/cea/Cea608DecoderTest.java
Just as a note I'm trying to help with samples here, I'm not the owner of this topic.
With all respect for me I cannot see it's possible to have a raw sample under ~15-20mb with .ts format that includes teletext subtitles, I tried, unless somebody else knows a way and can contribute with ?
Here you go.
gdrive link. https://drive.google.com/file/d/1MOeoHCdQ4M9HIuItL-_vkfaYwwcFMsrt/view?usp=sharing
Do you have any test clips containing teletext subtitles that you could add to this PR? We could use them in:
TsExtractorTest
to ensure the track is extracted- Unit tests for the new
DvbTeletextDecoder
I have added a sample TS file containing Teletext subtitle only (no audio, no video), and I updated TsExtractorTest with a new test.
Hi @cdongieux, I'm really looking forward to this improvement :) I did some testing on my side with a MPEG-TS file and I can see that the subtitles appear for a few seconds and then disappear completely. I have attached a video of what I see. https://www.dropbox.com/s/6rx12iifbms6kq7/device-2022-11-29-092900.mp4?dl=0
This is the video file details: `General ID : 1 (0x1) Complete name : C:\Users\zolsen\Videos\239.1.1.16.ts Format : MPEG-TS File size : 2.47 GiB Duration : 1 h 59 min Overall bit rate mode : Variable Overall bit rate : 2 951 kb/s
Video ID : 161 (0xA1) Menu ID : 785 (0x311) Format : MPEG Video Format version : Version 2 Format profile : Main@Main Format settings : CustomMatrix / BVOP Format settings, BVOP : Yes Format settings, Matrix : Custom Format settings, GOP : Variable Codec ID : 2 Duration : 1 h 59 min Bit rate mode : Variable Bit rate : 2 288 kb/s Maximum bit rate : 2 332 kb/s Width : 720 pixels Height : 576 pixels Display aspect ratio : 16:9 Active Format Description : Full frame 16:9 image Frame rate : 25.000 FPS Standard : PAL Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Scan order : Top Field First Compression mode : Lossy Bits/(Pixel*Frame) : 0.221 Time code of first frame : 12:55:39:22 Time code source : Group of pictures header GOP, Open/Closed : Open Stream size : 1.92 GiB (78%)
Audio #1 ID : 81 (0x51) Menu ID : 785 (0x311) Format : MPEG Audio Format version : Version 1 Format profile : Layer 2 Codec ID : 3 Duration : 1 h 59 min Bit rate mode : Constant Bit rate : 256 kb/s Channel(s) : 2 channels Sampling rate : 48.0 kHz Frame rate : 41.667 FPS (1152 SPF) Compression mode : Lossy Delay relative to video : -488 ms Stream size : 220 MiB (9%) Language : English
Audio #2 ID : 82 (0x52) Menu ID : 785 (0x311) Format : MPEG Audio Format version : Version 1 Format profile : Layer 2 Codec ID : 3 Duration : 1 h 59 min Bit rate mode : Constant Bit rate : 256 kb/s Channel(s) : 2 channels Sampling rate : 48.0 kHz Frame rate : 41.667 FPS (1152 SPF) Compression mode : Lossy Delay relative to video : -488 ms Stream size : 220 MiB (9%) Language : English Language, more info : Visual impaired commentary Editorial classification : Visual impaired commentary Mix type : Independent
Text ID : 41 (0x29)-801 Menu ID : 785 (0x311) Format : Teletext Subtitle Language : English`
@cdongieux You got an update on this code?
@wazerstar sorry no, I didn't have time to check on this.
@google-admin @icbaker @cdongieux can we get this ticket migrated to https://github.com/androidx/media
Closing all PRs on this deprecated project. We are now unable to merge PRs from here. If you would like us to consider this change again please file a new PR on the media3 project: https://github.com/androidx/media/pulls