8000 Allow applications to modify subtitle offsets during playback · Issue #1976 · androidx/media · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Allow applications to modify subtitle offsets during playback #1976

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

Open
pawaom opened this issue Dec 14, 2024 · 3 comments
Open

Allow applications to modify subtitle offsets during playback #1976

pawaom opened this issue Dec 14, 2024 · 3 comments

Comments

@pawaom
Copy link
pawaom commented Dec 14, 2024

How can we sync subtitles for Delay

Suppose we have a video and subtitles in Srt format

Now the video plays with the subtitle but the subtitles are delayed by say 30 second to the actual video how can we adjust the subtitles to sync with the actual video

We have used the following code to display the subtitles

val mediaItem: MediaItem  = MediaItem.Builder()
                    .setUri(uri)
                    .setSubtitleConfigurations(
                        listOf(
                            MediaItem. SubtitleConfiguration.Builder(
                                subtitleUri)

                                    .setMimeType (MimeTypes. APPLICATION_SUBRIP) // The correct MIME type for you
                                    .setLanguage ("en")
                                    .setSelectionFlags(C.SELECTION_FLAG_DEFAULT)

                    .build())) .build()
                mediaItemsList.add(mediaItem)

Also int the above code we have the language set to english how can we set it to the "Default" language of the device or one selected by the user for the App.

@icbaker
Copy link
Collaborator
icbaker commented Dec 16, 2024

The sync part of this question is a duplicate of google/ExoPlayer#854.

I'm going to close that one and leave this one open as it's on our new issue tracker.


Also int the above code we have the language set to english how can we set it to the "Default" language of the device or one selected by the user for the App.

I'm not sure I understand this question - surely the language a subtitle file is in depends on the file itself, not the user's selected device language. If you don't know what language a subtitle file is in, you can leave SubtitleConfiguration.language unset.

@icbaker icbaker marked this as a duplicate of google/ExoPlayer#854 Dec 16, 2024
@icbaker icbaker changed the title How can we sync subtitles for Delay Allow applications to modify subtitle offsets during playback Dec 16, 2024
@sheepster1
Copy link
sheepster1 commented Jan 18, 2025

@pawaom Did you mange to find a way to delay the subtitles? Im trying to do the same thing.

Edit:
For more context. I'm trying to add subtitle delay in the jellyfin androidtv project. Here is the relevant file.
I have tried looking into multiple documents ways online, but they all seem to be deprecated and not recommended anymore.

I understand there is no SubtitleConfiguration option to do that, so I tried using merging and clipping sources to separate video from subtitle media sources. but this adds an issue with unsupported srt files in the new pipeline from what i can tell.

@MeirArani
Copy link

Also chiming in on @sheepster1 's behalf since I'm very interested in doing the same thing. I think its a crucial feature in many many use cases, as I'm finding myself using subtitle offsets nearly every time I load up a video stream.

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

No branches or pull requests

4 participants
0