androidx / media

Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
https://developer.android.com/media/media3
Apache License 2.0
1.69k stars 404 forks source link

Subtitles not shown #1586

Closed javaboboApp closed 3 months ago

javaboboApp commented 3 months ago

Hi, we're experiencing an issue with our dash content where the subtitles intermittently appear and then disappear. Any insights or solutions would be appreciated.

This is the tt content:

<tt xmlns:ttp="http://www.w3.org/ns/ttml#parameter" xmlns:ebutts="urn:ebu:tt:style" xmlns="http://www.w3.org/ns/ttml"
    xmlns:ttm="http://www.w3.org/ns/ttml#metadata" xmlns:tts="http://www.w3.org/ns/ttml#styling"
    xmlns:smpte="http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt" ttp:cellResolution="40 24" xml:lang="en">
    <head>
        <smpte:information smpte:mode="Enhanced"/>
        <styling>
            <style xml:id="backgroundStyle" tts:fontFamily="proportionalSansSerif" tts:fontSize="18px"
                   tts:textAlign="center" tts:origin="0% 66%" tts:extent="100% 33%" tts:backgroundColor="rgba(0,0,0,0)"
                   tts:displayAlign="center"/>
            <style xml:id="speakerStyle" style="backgroundStyle" tts:color="white" tts:textOutline="black 1px"
                   tts:backgroundColor="transparent"/>
            <style xml:id="textStyle" tts:padding="0px" tts:fontSize="3rh" style="speakerStyle" tts:color="white"
                   tts:textOutline="none" tts:backgroundColor="black"/>
            <style xml:id="ttmlStyle" tts:fontFamily="monospaceSansSerif" tts:fontSize="80%"/>
            <style xml:id="style-1" tts:backgroundColor="black" tts:color="white" tts:displayAlign="center"
                   tts:extent="100% 33%" tts:fontFamily="proportionalSansSerif" tts:fontSize="18px" tts:origin="0% 66%"
                   tts:textAlign="center" tts:textOutline="none"/>
        </styling>
        <layout>
            <region xml:id="full" tts:origin="0% 0%" tts:extent="100% 100%" tts:zIndex="1"/>
            <region xml:id="speaker" style="speakerStyle" tts:zIndex="1"/>
            <region xml:id="background" style="backgroundStyle" tts:zIndex="0"/>
        </layout>
    </head>
    <body>
        <div>
            <!-- text-based TTML -->

            <p xml:id="s208394" region="speaker" begin="478477:06:27.200" end="478477:06:27.216">
                <span style="style-1">&gt;&gt; DOESN'T MATTER WHERE YOU PLAY
                    <br/>
                    IN
                </span>
            </p>
            <p xml:id="s208395" region="speaker" begin="478477:06:27.216" end="478477:06:27.316">
                <span style="style-1">&gt;&gt; DOESN'T MATTER WHERE YOU PLAY
                    <br/>
                    IN THE
                </span>
            </p>
            <p xml:id="s208396" region="speaker" begin="478477:06:27.316" end="478477:06:27.383">
                <span style="style-1">&gt;&gt; DOESN'T MATTER WHERE YOU PLAY
                    <br/>
                    IN THE WORLD,
                </span>
            </p>
            <p xml:id="s208397" region="speaker" begin="478477:06:27.383" end="478477:06:27.583">
                <span style="style-1">&gt;&gt; DOESN'T MATTER WHERE YOU PLAY
                    <br/>
                    IN THE WORLD, THE
                </span>
            </p>
            <p xml:id="s208398" region="speaker" begin="478477:06:27.583" end="478477:06:27.616">
                <span style="style-1">&gt;&gt; DOESN'T MATTER WHERE YOU PLAY
                    <br/>
                    IN THE WORLD, THE BRAZILIANS
                </span>
            </p>
            <p xml:id="s208399" region="speaker" begin="478477:06:27.616" end="478477:06:27.750">
                <span style="style-1">IN THE WORLD, THE BRAZILIANS</span>
            </p>
            <p xml:id="s208400" region="speaker" begin="478477:06:27.750" end="478477:06:27.783">
                <span style="style-1">IN THE WORLD, THE BRAZILIANS
                    <br/>
                    HAVE
                </span>
            </p>
            <p xml:id="s208401" region="speaker" begin="478477:06:27.783" end="478477:06:27.850">
                <span style="style-1">IN THE WORLD, THE BRAZILIANS
                    <br/>
                    HAVE A
                </span>
            </p>
            <p xml:id="s208402" region="speaker" begin="478477:06:27.850" end="478477:06:27.966">
                <span style="style-1">IN THE WORLD, THE BRAZILIANS
                    <br/>
                    HAVE A FAN
                </span>
            </p>
            <p xml:id="s208403" region="speaker" begin="478477:06:27.966" end="478477:06:28.083">
                <span style="style-1">IN THE WORLD, THE BRAZILIANS
                    <br/>
                    HAVE A FAN BASE
                </span>
            </p>
            <p xml:id="s208404" region="speaker" begin="478477:06:28.083" end="478477:06:28.183">
                <span style="style-1">IN THE WORLD, THE BRAZILIANS
                    <br/>
                    HAVE A FAN BASE THAT
                </span>
            </p>
            <p xml:id="s208405" region="speaker" begin="478477:06:28.183" end="478477:06:28.266">
                <span style="style-1">IN THE WORLD, THE BRAZILIANS
                    <br/>
                    HAVE A FAN BASE THAT SHOW
                </span>
            </p>
            <p xml:id="s208406" region="speaker" begin="478477:06:28.266" end="478477:06:28.800">
                <span style="style-1">IN THE WORLD, THE BRAZILIANS
                    <br/>
                    HAVE A FAN BASE THAT SHOW UP
                </span>
            </p>
        </div>
    </body>
</tt>

and this is the manifest:

<MPD availabilityStartTime="2024-01-01T00:00:00.000000+00:00" id="0" minBufferTime="PT3S" minimumUpdatePeriod="PT3S" profiles="urn:mpeg:dash:profile:isoff-live:2011" publishTime="2024-08-01T10:39:10.000081+00:00" suggestedPresentationDelay="PT8S" timeShiftBufferDepth="PT1H48M55.266S" type="dynamic" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:mspr="urn:microsoft:playready" xmlns:scte35="urn:scte:scte35:2013:xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd">
    <BaseURL>https://live-m-01-rogers-cc-dev.akamaized.net/out/v1/r-dev/ch-02-dev-r-v2/dash-ch-02-dev-r-hd/</BaseURL>
    <Period id="1722502201666" start="PT5120H50M1.666S">
        <AdaptationSet contentType="video" id="360569923" mimeType="video/mp4" segmentAlignment="true">
            <ContentProtection cenc:default_KID="42073d37-afbf-3d50-9980-966f3fab8ba5" schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" xmlns:cenc="urn:mpeg:cenc:2013" />
            <ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed">
                <cenc:pssh xmlns:cenc="urn:mpeg:cenc:2013">AAAAcHBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAFAIARIQQgc9N6+/PVCZgJZvP6uLpSI4ZXlKaGMzTmxkRWxrSWpvaVVGSkZVRkpQUkMxRVFWTklMVU5JTFRBeUxVeEpWa1ZMUlZraWZRPT04AA==</cenc:pssh>
            </ContentProtection>
            <ContentProtection schemeIdUri="urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95">
                <cenc:pssh xmlns:cenc="urn:mpeg:cenc:2013">AAADWHBzc2gAAAAAmgTweZhAQoarkuZb4IhflQAAAzg4AwAAAQABAC4DPABXAFIATQBIAEUAQQBEAEUAUgAgAHgAbQBsAG4AcwA9ACIAaAB0AHQAcAA6AC8ALwBzAGMAaABlAG0AYQBzAC4AbQBpAGMAcgBvAHMAbwBmAHQALgBjAG8AbQAvAEQAUgBNAC8AMgAwADAANwAvADAAMwAvAFAAbABhAHkAUgBlAGEAZAB5AEgAZQBhAGQAZQByACIAIAB2AGUAcgBzAGkAbwBuAD0AIgA0AC4AMAAuADAALgAwACIAPgA8AEQAQQBUAEEAPgA8AFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBFAFkATABFAE4APgAxADYAPAAvAEsARQBZAEwARQBOAD4APABBAEwARwBJAEQAPgBBAEUAUwBDAFQAUgA8AC8AQQBMAEcASQBEAD4APAAvAFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBJAEQAPgBOAHoAMABIAFEAcgArAHYAVQBEADIAWgBnAEoAWgB2AFAANgB1AEwAcABRAD0APQA8AC8ASwBJAEQAPgA8AEwAQQBfAFUAUgBMAD4AaAB0AHQAcABzADoALwAvAGwAaQBjAC4AcwB0AGEAZwBpAG4AZwAuAGQAcgBtAHQAbwBkAGEAeQAuAGMAbwBtAC8AbABpAGMAZQBuAHMAZQAtAHAAcgBvAHgAeQAtAGgAZQBhAGQAZQByAGEAdQB0AGgALwBkAHIAbQB0AG8AZABhAHkALwBSAGkAZwBoAHQAcwBNAGEAbgBhAGcAZQByAC4AYQBzAG0AeAA8AC8ATABBAF8AVQBSAEwAPgA8AEwAVQBJAF8AVQBSAEwAPgBoAHQAdABwAHMAOgAvAC8AcABsAGEAeQByAGUAYQBkAHkALQB1AGkALgBlAHgAYQBtAHAAbABlAC4AYwBvAG0APAAvAEwAVQBJAF8AVQBSAEwAPgA8AEMASABFAEMASwBTAFUATQA+AGEANABtAFIAYQB4ADkARABvAC8AOAA9ADwALwBDAEgARQBDAEsAUwBVAE0APgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AA==</cenc:pssh>
                <mspr:pro xmlns:mspr="urn:microsoft:playready">OAMAAAEAAQAuAzwAVwBSAE0ASABFAEEARABFAFIAIAB4AG0AbABuAHMAPQAiAGgAdAB0AHAAOgAvAC8AcwBjAGgAZQBtAGEAcwAuAG0AaQBjAHIAbwBzAG8AZgB0AC4AYwBvAG0ALwBEAFIATQAvADIAMAAwADcALwAwADMALwBQAGwAYQB5AFIAZQBhAGQAeQBIAGUAYQBkAGUAcgAiACAAdgBlAHIAcwBpAG8AbgA9ACIANAAuADAALgAwAC4AMAAiAD4APABEAEEAVABBAD4APABQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsARQBZAEwARQBOAD4AMQA2ADwALwBLAEUAWQBMAEUATgA+ADwAQQBMAEcASQBEAD4AQQBFAFMAQwBUAFIAPAAvAEEATABHAEkARAA+ADwALwBQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsASQBEAD4ATgB6ADAASABRAHIAKwB2AFUARAAyAFoAZwBKAFoAdgBQADYAdQBMAHAAUQA9AD0APAAvAEsASQBEAD4APABMAEEAXwBVAFIATAA+AGgAdAB0AHAAcwA6AC8ALwBsAGkAYwAuAHMAdABhAGcAaQBuAGcALgBkAHIAbQB0AG8AZABhAHkALgBjAG8AbQAvAGwAaQBjAGUAbgBzAGUALQBwAHIAbwB4AHkALQBoAGUAYQBkAGUAcgBhAHUAdABoAC8AZAByAG0AdABvAGQAYQB5AC8AUgBpAGcAaAB0AHMATQBhAG4AYQBnAGUAcgAuAGEAcwBtAHgAPAAvAEwAQQBfAFUAUgBMAD4APABMAFUASQBfAFUAUgBMAD4AaAB0AHQAcABzADoALwAvAHAAbABhAHkAcgBlAGEAZAB5AC0AdQBpAC4AZQB4AGEAbQBwAGwAZQAuAGMAbwBtADwALwBMAFUASQBfAFUAUgBMAD4APABDAEgARQBDAEsAUwBVAE0APgBhADQAbQBSAGEAeAA5AEQAbwAvADgAPQA8AC8AQwBIAEUAQwBLAFMAVQBNAD4APAAvAEQAQQBUAEEAPgA8AC8AVwBSAE0ASABFAEEARABFAFIAPgA=</mspr:pro>
            </ContentProtection>
            <SegmentTemplate initialization="segment_$RepresentationID$_1076527255_init.mp4" media="segment_$RepresentationID$_$Number$.mp4" presentationTimeOffset="103350132096000" startNumber="1076563880" timescale="60000">
                <SegmentTimeline>
                    <S d="96000" r="4083" t="103350132288000" />
                </SegmentTimeline>
            </SegmentTemplate>
            <Representation bandwidth="1400000" codecs="avc1.4D4028" frameRate="30/1" height="432" id="video_i0_q2_432_v2" width="768" />
            <Representation bandwidth="600000" codecs="avc1.4D401E" frameRate="30/1" height="288" id="video_i1_q0_288_v2" width="512" />
            <Representation bandwidth="949952" codecs="avc1.4D4020" frameRate="30/1" height="360" id="video_i2_q1_360_v2" width="640" />
            <Representation bandwidth="2200000" codecs="avc1.4D4028" frameRate="30/1" height="576" id="video_i3_q3_576_v2" width="1024" />
            <Representation bandwidth="3449984" codecs="avc1.4D4028" frameRate="30/1" height="720" id="video_i4_q4_720_v2" width="1280" />
            <Representation bandwidth="4749952" codecs="avc1.640029" frameRate="60/1" height="720" id="video_i5_q5_720_v2" width="1280" />
            <Representation bandwidth="6000000" codecs="avc1.64002A" frameRate="60/1" height="1080" id="video_i6_q6_1080_v2" width="1920" />
        </AdaptationSet>
        <AdaptationSet contentType="audio" id="1628807692" lang="eng" mimeType="audio/mp4" segmentAlignment="true">
            <ContentProtection cenc:default_KID="42073d37-afbf-3d50-9980-966f3fab8ba5" schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" xmlns:cenc="urn:mpeg:cenc:2013" />
            <ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed">
                <cenc:pssh xmlns:cenc="urn:mpeg:cenc:2013">AAAAcHBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAFAIARIQQgc9N6+/PVCZgJZvP6uLpSI4ZXlKaGMzTmxkRWxrSWpvaVVGSkZVRkpQUkMxRVFWTklMVU5JTFRBeUxVeEpWa1ZMUlZraWZRPT04AA==</cenc:pssh>
            </ContentProtection>
            <ContentProtection schemeIdUri="urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95">
                <cenc:pssh xmlns:cenc="urn:mpeg:cenc:2013">AAADWHBzc2gAAAAAmgTweZhAQoarkuZb4IhflQAAAzg4AwAAAQABAC4DPABXAFIATQBIAEUAQQBEAEUAUgAgAHgAbQBsAG4AcwA9ACIAaAB0AHQAcAA6AC8ALwBzAGMAaABlAG0AYQBzAC4AbQBpAGMAcgBvAHMAbwBmAHQALgBjAG8AbQAvAEQAUgBNAC8AMgAwADAANwAvADAAMwAvAFAAbABhAHkAUgBlAGEAZAB5AEgAZQBhAGQAZQByACIAIAB2AGUAcgBzAGkAbwBuAD0AIgA0AC4AMAAuADAALgAwACIAPgA8AEQAQQBUAEEAPgA8AFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBFAFkATABFAE4APgAxADYAPAAvAEsARQBZAEwARQBOAD4APABBAEwARwBJAEQAPgBBAEUAUwBDAFQAUgA8AC8AQQBMAEcASQBEAD4APAAvAFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBJAEQAPgBOAHoAMABIAFEAcgArAHYAVQBEADIAWgBnAEoAWgB2AFAANgB1AEwAcABRAD0APQA8AC8ASwBJAEQAPgA8AEwAQQBfAFUAUgBMAD4AaAB0AHQAcABzADoALwAvAGwAaQBjAC4AcwB0AGEAZwBpAG4AZwAuAGQAcgBtAHQAbwBkAGEAeQAuAGMAbwBtAC8AbABpAGMAZQBuAHMAZQAtAHAAcgBvAHgAeQAtAGgAZQBhAGQAZQByAGEAdQB0AGgALwBkAHIAbQB0AG8AZABhAHkALwBSAGkAZwBoAHQAcwBNAGEAbgBhAGcAZQByAC4AYQBzAG0AeAA8AC8ATABBAF8AVQBSAEwAPgA8AEwAVQBJAF8AVQBSAEwAPgBoAHQAdABwAHMAOgAvAC8AcABsAGEAeQByAGUAYQBkAHkALQB1AGkALgBlAHgAYQBtAHAAbABlAC4AYwBvAG0APAAvAEwAVQBJAF8AVQBSAEwAPgA8AEMASABFAEMASwBTAFUATQA+AGEANABtAFIAYQB4ADkARABvAC8AOAA9ADwALwBDAEgARQBDAEsAUwBVAE0APgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AA==</cenc:pssh>
                <mspr:pro xmlns:mspr="urn:microsoft:playready">OAMAAAEAAQAuAzwAVwBSAE0ASABFAEEARABFAFIAIAB4AG0AbABuAHMAPQAiAGgAdAB0AHAAOgAvAC8AcwBjAGgAZQBtAGEAcwAuAG0AaQBjAHIAbwBzAG8AZgB0AC4AYwBvAG0ALwBEAFIATQAvADIAMAAwADcALwAwADMALwBQAGwAYQB5AFIAZQBhAGQAeQBIAGUAYQBkAGUAcgAiACAAdgBlAHIAcwBpAG8AbgA9ACIANAAuADAALgAwAC4AMAAiAD4APABEAEEAVABBAD4APABQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsARQBZAEwARQBOAD4AMQA2ADwALwBLAEUAWQBMAEUATgA+ADwAQQBMAEcASQBEAD4AQQBFAFMAQwBUAFIAPAAvAEEATABHAEkARAA+ADwALwBQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsASQBEAD4ATgB6ADAASABRAHIAKwB2AFUARAAyAFoAZwBKAFoAdgBQADYAdQBMAHAAUQA9AD0APAAvAEsASQBEAD4APABMAEEAXwBVAFIATAA+AGgAdAB0AHAAcwA6AC8ALwBsAGkAYwAuAHMAdABhAGcAaQBuAGcALgBkAHIAbQB0AG8AZABhAHkALgBjAG8AbQAvAGwAaQBjAGUAbgBzAGUALQBwAHIAbwB4AHkALQBoAGUAYQBkAGUAcgBhAHUAdABoAC8AZAByAG0AdABvAGQAYQB5AC8AUgBpAGcAaAB0AHMATQBhAG4AYQBnAGUAcgAuAGEAcwBtAHgAPAAvAEwAQQBfAFUAUgBMAD4APABMAFUASQBfAFUAUgBMAD4AaAB0AHQAcABzADoALwAvAHAAbABhAHkAcgBlAGEAZAB5AC0AdQBpAC4AZQB4AGEAbQBwAGwAZQAuAGMAbwBtADwALwBMAFUASQBfAFUAUgBMAD4APABDAEgARQBDAEsAUwBVAE0APgBhADQAbQBSAGEAeAA5AEQAbwAvADgAPQA8AC8AQwBIAEUAQwBLAFMAVQBNAD4APAAvAEQAQQBUAEEAPgA8AC8AVwBSAE0ASABFAEEARABFAFIAPgA=</mspr:pro>
            </ContentProtection>
            <Label>eng</Label>
            <SegmentTemplate initialization="segment_$RepresentationID$_1076527255_init.mp4" media="segment_$RepresentationID$_$Number$.mp4" presentationTimeOffset="82680105676800" startNumber="1076563880" timescale="48000">
                <SegmentTimeline>
                    <S d="76800" r="4083" t="82680105833600" />
                </SegmentTimeline>
            </SegmentTemplate>
            <Representation audioSamplingRate="48000" bandwidth="128000" codecs="mp4a.40.2" id="audio_en_v2">
                <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2" />
            </Representation>
        </AdaptationSet>
        <AdaptationSet codecs="stpp" contentType="application" id="1031613313" lang="eng" mimeType="application/mp4" segmentAlignment="true">
            <Label>eng</Label>
            <SegmentTemplate initialization="segment_$RepresentationID$_1076527255_init.mp4" media="segment_$RepresentationID$_$Number$.mp4" presentationTimeOffset="103350132096000" startNumber="1076563880" timescale="60000">
                <SegmentTimeline>
                    <S d="96000" r="4083" t="103350132288000" />
                </SegmentTimeline>
            </SegmentTemplate>
            <Representation bandwidth="0" id="caption_en_v2" />
        </AdaptationSet>
        <SupplementalProperty schemeIdUri="urn:scte:dash:utc-time" value="2024-08-01T08:50:04.800Z" />
    </Period>
    <UTCTiming schemeIdUri="urn:mpeg:dash:utc:direct:2014" value="2024-08-01T10:39:10.081Z" />
</MPD>

The request to get captions are being made but subtitles are not being shown (at least some time appear and after disappear.

I am using 1.3.1 version.

javaboboApp commented 3 months ago

issue was fixed on 1.4.0 version (looks working ok)