media icon indicating copy to clipboard operation
media copied to clipboard

Does Exoplayer support Tag/Label for subtitles names inside of DASH .mpd manifest?

Open Crazyvod00 opened this issue 1 year ago • 4 comments

Hi guys, as the title suggests, I would like to know if exoplayer supports tag/label for subtitle names.

Using an exoplayer based app I can set both forced and normal subtitles in the DASH manifest. Unfortunately, however, I cannot find a way to split subtitles by name in case they have the same language. Here an example of my subtitles part inside the mpd.

    <AdaptationSet mimeType="text/vtt" lang="it" accessibility="main" forced="true" default="true">
        <Representation id="forced" bandwidth="8000">
            <BaseURL>URL.vtt</BaseURL>
        </Representation>
    </AdaptationSet>
    <AdaptationSet mimeType="text/vtt" lang="it" accessibility="main" forced="false" default="false">
        <Representation id="regular" bandwidth="8000">
            <BaseURL>URL.vtt</BaseURL>
        </Representation>
    </AdaptationSet>
    

In case it is not yet available, is it possible to support a tag/label to index different subs by name in the future?

Now for example I have as output for subtitles:

None Italiano (automatically detected because they are forced) Italiano

The target would be instead: None Italiano - Forced Italiano - Regular

Perhaps the solution already exists but I am ignorant and do not know how to find it.

Crazyvod00 avatar Apr 26 '24 14:04 Crazyvod00

The target would be instead: None Italiano - Forced Italiano - Regular

If you're inspecting a Format object, you can determine whether it corresponds to the 'Regular' or 'Forced' case by inspecting Format.selectionFlags, e.g.:

if ((format.selectionFlags & SELECTION_FLAG_FORCED) != 0) {
  // The format is for the 'forced' subtitles
}

See also:

  • https://developer.android.com/reference/androidx/media3/common/Format#selectionFlags()
  • https://developer.android.com/reference/androidx/media3/common/C.SelectionFlags

If you're not inspecting a Format object, I'm not sure exactly what you're asking - please could you add a bit more information/context?

icbaker avatar Apr 26 '24 15:04 icbaker

I want to know if exoplayer supports any kind of tags (forced, regular, commentary, SDH, CC - closed captions, Hearing Impaired) about subtitles for dash mpds. I would like to see the kind of subs on the app. Now I can only see the language

None Italiano Italiano

but not the type of the subs

Example:

None Italiano - Forced Italiano - Regular Inglese - CC Inglese - Commentary Spagnolo - SDH Spagnolo - Forced

I thought Representation id=“XXX” might somehow be the correct way to show the tag, but I was wrong.

Crazyvod00 avatar Apr 26 '24 16:04 Crazyvod00

You can also inspect Format.roleFlags for some of those parameters you've listed.

I think my answer above resolves your question - possibly combined with being able to customize track names in the UI?

If you still have questions, please can you add some more detail.

icbaker avatar Apr 26 '24 16:04 icbaker

Hey @Crazyvod00. We need more information to resolve this issue but there hasn't been an update in 14 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot avatar May 16 '24 01:05 google-oss-bot

Since there haven't been any recent updates here, I am going to close this issue.

@Crazyvod00 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

google-oss-bot avatar May 27 '24 01:05 google-oss-bot