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

[BUG]: 608/708 captions in HLS source not recognized by the player #3766

Closed
TylerBKrumme opened this issue May 13, 2024 · 11 comments · Fixed by #3882 or #3913
Closed

[BUG]: 608/708 captions in HLS source not recognized by the player #3766

TylerBKrumme opened this issue May 13, 2024 · 11 comments · Fixed by #3882 or #3913

Comments

@TylerBKrumme
Copy link

Version

^6.0.0-beta.8

What platforms are you having the problem on?

Android

Architecture

Old architecture

What happened?

608/708 captions within an HLS source aren't recognized by the player, onTextTracks never triggers.

Reproduction

repository link

Reproduction

Ran on an android emulator on a windows PC.

Step to reproduce this bug are:
Set up a basic app with the player, with HLS sources enabled.
Set source to an HLS playlist with embedded 608/708 captions
608/708 tracks are never found, onTextTracks never triggers

@freeboub
Copy link
Collaborator

@TylerBKrumme any sample video you can share ?

@TylerBKrumme
Copy link
Author

@freeboub
Copy link
Collaborator

Thank you for the sample !
I tested with sample exoplayer app I don't see any text tracks also. I think the issue comes from the video..

Here is the logcat output of the sample which displaying all tracks. I don't see any CEA 608 / 708 tracks..

05-14 09:24:47.570 23389 23389 D EventLogger: tracks [eventTime=0.84, mediaPos=0.00, window=0, period=0
05-14 09:24:47.570 23389 23389 D EventLogger:   group [
05-14 09:24:47.570 23389 23389 D EventLogger:     [X] Track:0, id=0, mimeType=video/avc, container=application/x-mpegURL, bitrate=3000663, codecs=avc1.640028, res=1920x1080, fps=29.97, supported=YES
05-14 09:24:47.570 23389 23389 D EventLogger:     [ ] Track:1, id=1, mimeType=video/avc, container=application/x-mpegURL, bitrate=520475, codecs=avc1.640028, res=1920x1080, roleFlags=[trick-play], supported=YES
05-14 09:24:47.571 23389 23389 D EventLogger:     [X] Track:2, id=2, mimeType=video/avc, container=application/x-mpegURL, bitrate=1913443, codecs=avc1.4d4028, res=1280x720, fps=29.97, supported=YES
05-14 09:24:47.571 23389 23389 D EventLogger:     [ ] Track:3, id=3, mimeType=video/avc, container=application/x-mpegURL, bitrate=169897, codecs=avc1.4d4028, res=1280x720, roleFlags=[trick-play], supported=YES
05-14 09:24:47.571 23389 23389 D EventLogger:     [X] Track:4, id=4, mimeType=video/avc, container=application/x-mpegURL, bitrate=1344595, codecs=avc1.4d401f, res=854x480, fps=29.97, supported=YES
05-14 09:24:47.571 23389 23389 D EventLogger:     [ ] Track:5, id=5, mimeType=video/avc, container=application/x-mpegURL, bitrate=117475, codecs=avc1.4d401f, res=854x480, roleFlags=[trick-play], supported=YES
05-14 09:24:47.572 23389 23389 D EventLogger:     [X] Track:6, id=6, mimeType=video/avc, container=application/x-mpegURL, bitrate=762307, codecs=avc1.4d401e, res=640x360, fps=29.97, supported=YES
05-14 09:24:47.572 23389 23389 D EventLogger:     [ ] Track:7, id=7, mimeType=video/avc, container=application/x-mpegURL, bitrate=72682, codecs=avc1.4d401e, res=640x360, roleFlags=[trick-play], supported=YES
05-14 09:24:47.572 23389 23389 D EventLogger:     [X] Track:8, id=8, mimeType=video/avc, container=application/x-mpegURL, bitrate=487655, codecs=avc1.4d400c, res=284x160, fps=29.97, supported=YES
05-14 09:24:47.572 23389 23389 D EventLogger:     [ ] Track:9, id=9, mimeType=video/avc, container=application/x-mpegURL, bitrate=37265, codecs=avc1.4d400c, res=284x160, roleFlags=[trick-play], supported=YES
05-14 09:24:47.572 23389 23389 D EventLogger:   ]
05-14 09:24:47.572 23389 23389 D EventLogger:   group [
05-14 09:24:47.572 23389 23389 D EventLogger:     [X] Track:0, id=0, mimeType=audio/mp4a-latm, container=application/x-mpegURL, codecs=mp4a.40.2, supported=YES
05-14 09:24:47.572 23389 23389 D EventLogger:   ]
05-14 09:24:47.572 23389 23389 D EventLogger:   group [
05-14 09:24:47.572 23389 23389 D EventLogger:     [X] Track:0, id=ID3, mimeType=application/id3, supported=YES
05-14 09:24:47.572 23389 23389 D EventLogger:   ]
05-14 09:24:47.572 23389 23389 D EventLogger:   Metadata [
05-14 09:24:47.572 23389 23389 D EventLogger:     HlsTrackMetadataEntry
05-14 09:24:47.572 23389 23389 D EventLogger:   ]
05-14 09:24:47.572 23389 23389 D EventLogger: ]

@freeboub
Copy link
Collaborator

I will close the issue as it is either a stream issue or an exoplayer issue. (cannot be fixed in this repo)
Notice that I was able to display subtitles with bitmovin sample player: https://bitmovin.com/demos/stream-test?format=hls&manifest=https%3A%2F%2Fapi.v3.invintus.com%2FStreamURI%2Fhls%2F1000000000%2F2024051020%2Fmedia.m3u8

May need to be tripple check and investigated with exoplayer sample

@TylerBKrumme
Copy link
Author

TylerBKrumme commented May 30, 2024

@freeboub
Hey, we were able to find the solution to this, .setAllowChunklessPreparation(false) exoplayer/hls#disabling-chunkless to false on the HLS Media Source Factory

By editing react-native-video/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java in node_modules, we were able to register & display our 608/708 captions.

case CONTENT_TYPE_HLS:
    if (!BuildConfig.USE_EXOPLAYER_HLS) {
        DebugLog.e("Exo Player Exception", "HLS is not enabled!");
        throw new IllegalStateException("HLS is not enabled!");
    }

    mediaSourceFactory = new HlsMediaSource.Factory(
        mediaDataSourceFactory
    ).setAllowChunklessPreparation(false);
    break;

A prop or build opt that can be used to set .setAllowChunklessPreparation would fix this issue.

@freeboub freeboub reopened this Jun 7, 2024
@freeboub
Copy link
Collaborator

freeboub commented Jun 7, 2024

I propose to add a new prop:
source.textTracksAllowChunklessPreparation to enable this feature

@freeboub
Copy link
Collaborator

freeboub commented Jun 7, 2024

I just created a pull request to integrate the feature: #3882.
Can you please test it ?

@TylerBKrumme
Copy link
Author

@freeboub Hey, Just got a chance to test it and it doesn't appear to work. Setting source like:

source={{ 
  uri: "https://api.v3.invintus.com/StreamURI/hls/1000000000/2024051020/media.m3u8",
  textTracksAllowChunklessPreparation: false,
}}

@freeboub freeboub reopened this Jun 10, 2024
@freeboub
Copy link
Collaborator

Reopen, let me double check

@freeboub
Copy link
Collaborator

@TylerBKrumme Finnally review the behavior, Can you test this PR please ? #3913

@freeboub
Copy link
Collaborator

Fix merged for 6.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants