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

Subtitle in Media3 not syncing properly with audio/video on ui #2050

Open
amit12kumardish opened this issue Jan 17, 2025 · 5 comments
Open
Assignees
Labels

Comments

@amit12kumardish
Copy link

amit12kumardish commented Jan 17, 2025

override fun onTracksChanged(tracks: Tracks) {
                    super.onTracksChanged(tracks)
                    for (group in tracks.groups) {
                        for (i in 0 until group.length) {
                            val format = group.getTrackFormat(i)
                            if (format.sampleMimeType == MimeTypes.APPLICATION_CEA608 || format.sampleMimeType == MimeTypes.APPLICATION_CEA708) {
                             Timber.d("onTracksChanged: %s", format.sampleMimeType)
                             val override = TrackSelectionOverride(group.mediaTrackGroup, i)
                             player?.let { player ->
                                 val parameters =
                                       player.trackSelectionParameters
                                      .buildUpon()
                                      .addOverride(override)
                                      .build()
                                  player.trackSelectionParameters = parameters
                                     }
                                }
                            }
                        }
                    }

i am able to see the tracks, but sometimes captions are not matching with audio.video, its lagging

@icbaker
Copy link
Collaborator

icbaker commented Jan 17, 2025

Please provide media we can use to reproduce the issue. Please either upload it here or send it to android-media-github@google.com with the subject Issue #2050. Please also update this issue to indicate you’ve done this.

@icbaker icbaker self-assigned this Jan 17, 2025
@amit12kumardish
Copy link
Author

amit12kumardish commented Jan 17, 2025 via email

@amit12kumardish
Copy link
Author

any updates

@amit12kumardish
Copy link
Author

one more observation, i can see same delay in vlc player too, for the same content, how can i fix it

@icbaker
Copy link
Collaborator

icbaker commented Jan 20, 2025

The media link above is not accessible to me.

one more observation, i can see same delay in vlc player too, for the same content, how can i fix it

This sounds like an issue with your media, rather than with ExoPlayer. I'm afraid we are not experts on preparing media, so we can't help you with how to fix the media.

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

No branches or pull requests

3 participants