google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.7k stars 6.02k forks source link

Can't get subtitles language codes for DASH #2335

Closed PavelGP closed 7 years ago

PavelGP commented 7 years ago
<?xml version="1.0" encoding="UTF-8"?>
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="dynamic" availabilityStartTime="2011-03-01T00:00:10Z" minimumUpdatePeriod="PT2.0S" minBufferTime="PT2.0S" publishTime="2017-01-16T09:56:24Z" timeShiftBufferDepth="PT2M" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd">
   <Period start="PT0S" id="1">
      <AdaptationSet mimeType="video/mp4" startWithSAP="1" segmentAlignment="true">
         <ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" />
         <ContentProtection schemeIdUri="urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95" />
         <ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" />
         <SegmentTemplate timescale="10000000" presentationTimeOffset="0" media="$RepresentationID$/Segment-$Time$.m4v" initialization="$RepresentationID$/init.m4i">
            <SegmentTimeline>
               <S t="1856228609457555" d="20000000" r="59" />
            </SegmentTimeline>
         </SegmentTemplate>
         <Representation width="320" height="180" frameRate="25" codecs="avc1.42801f" scanType="progressive" id="stream_0" bandwidth="2000000" />
      </AdaptationSet>
      <AdaptationSet mimeType="audio/mp4" startWithSAP="1" lang="eng" segmentAlignment="true">
         <ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" />
         <ContentProtection schemeIdUri="urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95" />
         <ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" />
         <SegmentTemplate timescale="10000000" presentationTimeOffset="0" media="$RepresentationID$/Segment-$Time$.m4a" initialization="$RepresentationID$/init.m4i">
            <SegmentTimeline>
               <S t="1856228609495333" d="20053333" />
               <S t="1856228629548666" d="20053334" />
               <S t="1856228649602000" d="20053333" />
               <S t="1856228669655333" d="19840000" />
               <S t="1856228689495333" d="20053333" />
               <S t="1856228709548666" d="20053334" />
               <S t="1856228729602000" d="20053333" />
               <S t="1856228749655333" d="19840000" />
               <S t="1856228769495333" d="20053333" />
               <S t="1856228789548666" d="20053334" />
               <S t="1856228809602000" d="20053333" />
               <S t="1856228829655333" d="19840000" />
               <S t="1856228849495333" d="20053333" />
               <S t="1856228869548666" d="20053334" />
               <S t="1856228889602000" d="20053333" />
               <S t="1856228909655333" d="19840000" />
               <S t="1856228929495333" d="20053333" />
               <S t="1856228949548666" d="20053334" />
               <S t="1856228969602000" d="20053333" />
               <S t="1856228989655333" d="19840000" />
               <S t="1856229009495333" d="20053333" />
               <S t="1856229029548666" d="20053334" />
               <S t="1856229049602000" d="20053333" />
               <S t="1856229069655333" d="19840000" />
               <S t="1856229089495333" d="20053333" />
               <S t="1856229109548666" d="20053334" />
               <S t="1856229129602000" d="20053333" />
               <S t="1856229149655333" d="19840000" />
               <S t="1856229169495333" d="20053333" />
               <S t="1856229189548666" d="20053334" />
               <S t="1856229209602000" d="20053333" />
               <S t="1856229229655333" d="19840000" />
               <S t="1856229249495333" d="20053333" />
               <S t="1856229269548666" d="20053334" />
               <S t="1856229289602000" d="20053333" />
               <S t="1856229309655333" d="19840000" />
               <S t="1856229329495333" d="20053333" />
               <S t="1856229349548666" d="20053334" />
               <S t="1856229369602000" d="20053333" />
               <S t="1856229389655333" d="19840000" />
               <S t="1856229409495333" d="20053333" />
               <S t="1856229429548666" d="20053334" />
               <S t="1856229449602000" d="20053333" />
               <S t="1856229469655333" d="19840000" />
               <S t="1856229489495333" d="20053333" />
               <S t="1856229509548666" d="20053334" />
               <S t="1856229529602000" d="20053333" />
               <S t="1856229549655333" d="19840000" />
               <S t="1856229569495333" d="20053333" />
               <S t="1856229589548666" d="20053334" />
               <S t="1856229609602000" d="20053333" />
               <S t="1856229629655333" d="19840000" />
               <S t="1856229649495333" d="20053333" />
               <S t="1856229669548666" d="20053334" />
               <S t="1856229689602000" d="20053333" />
               <S t="1856229709655333" d="19840000" />
               <S t="1856229729495333" d="20053333" />
               <S t="1856229749548666" d="20053334" />
               <S t="1856229769602000" d="20053333" />
               <S t="1856229789655333" d="19840000" />
            </SegmentTimeline>
         </SegmentTemplate>
         <Representation audioSamplingRate="48000" codecs="mp4a.40.2" id="stream_1" bandwidth="96000" />
      </AdaptationSet>
      <AdaptationSet mimeType="application/mp4" startWithSAP="1" lang="swe" segmentAlignment="true">
         <SegmentTemplate timescale="10000000" presentationTimeOffset="0" media="$RepresentationID$/Segment-$Time$.m4s" initialization="$RepresentationID$/init.m4i">
            <SegmentTimeline>
               <S t="1856228644060000" d="20000000" r="59" />
            </SegmentTimeline>
         </SegmentTemplate>
         <Representation codecs="stpp" id="stream_2" bandwidth="15000" />
      </AdaptationSet>
   </Period>
</MPD>

for this manifest I COULD NOT SEE subtitles language codes in demo app v.2.1.1

<?xml version="1.0" encoding="UTF-8"?>
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="dynamic" availabilityStartTime="2011-03-01T00:00:10Z" minimumUpdatePeriod="PT2.0S" minBufferTime="PT2.0S" publishTime="2017-01-16T09:59:14Z" timeShiftBufferDepth="PT2M" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd">
   <Period start="PT0S" id="1">
      <AdaptationSet mimeType="video/mp4" startWithSAP="1" segmentAlignment="true">
         <SegmentTemplate timescale="10000000" presentationTimeOffset="0" media="$RepresentationID$/Segment-$Time$.m4v" initialization="$RepresentationID$/init.m4i">
            <SegmentTimeline>
               <S t="1856230340045111" d="20000000" r="59" />
            </SegmentTimeline>
         </SegmentTemplate>
         <Representation width="320" height="180" frameRate="25" codecs="avc1.42801f" scanType="progressive" id="stream_0" bandwidth="432000" />
         <Representation width="480" height="270" frameRate="25" codecs="avc1.42801f" scanType="progressive" id="stream_1" bandwidth="1188000" />
         <Representation width="640" height="360" frameRate="25" codecs="avc1.4d401f" scanType="progressive" id="stream_2" bandwidth="2160000" />
      </AdaptationSet>
      <AdaptationSet mimeType="audio/mp4" startWithSAP="1" lang="eng" segmentAlignment="true">
         <SegmentTemplate timescale="10000000" presentationTimeOffset="0" media="$RepresentationID$/Segment-$Time$.m4a" initialization="$RepresentationID$/init.m4i">
            <SegmentTimeline>
               <S t="1856230340106222" d="20053333" r="1" />
               <S t="1856230380212888" d="19840000" />
               <S t="1856230400052888" d="20053334" />
               <S t="1856230420106222" d="20053333" r="1" />
               <S t="1856230460212888" d="19840000" />
               <S t="1856230480052888" d="20053334" />
               <S t="1856230500106222" d="20053333" r="1" />
               <S t="1856230540212888" d="19840000" />
               <S t="1856230560052888" d="20053334" />
               <S t="1856230580106222" d="20053333" r="1" />
               <S t="1856230620212888" d="19840000" />
               <S t="1856230640052888" d="20053334" />
               <S t="1856230660106222" d="20053333" r="1" />
               <S t="1856230700212888" d="19840000" />
               <S t="1856230720052888" d="20053334" />
               <S t="1856230740106222" d="20053333" r="1" />
               <S t="1856230780212888" d="19840000" />
               <S t="1856230800052888" d="20053334" />
               <S t="1856230820106222" d="20053333" r="1" />
               <S t="1856230860212888" d="19840000" />
               <S t="1856230880052888" d="20053334" />
               <S t="1856230900106222" d="20053333" r="1" />
               <S t="1856230940212888" d="19840000" />
               <S t="1856230960052888" d="20053334" />
               <S t="1856230980106222" d="20053333" r="1" />
               <S t="1856231020212888" d="19840000" />
               <S t="1856231040052888" d="20053334" />
               <S t="1856231060106222" d="20053333" r="1" />
               <S t="1856231100212888" d="19840000" />
               <S t="1856231120052888" d="20053334" />
               <S t="1856231140106222" d="20053333" r="1" />
               <S t="1856231180212888" d="19840000" />
               <S t="1856231200052888" d="20053334" />
               <S t="1856231220106222" d="20053333" r="1" />
               <S t="1856231260212888" d="19840000" />
               <S t="1856231280052888" d="20053334" />
               <S t="1856231300106222" d="20053333" r="1" />
               <S t="1856231340212888" d="19840000" />
               <S t="1856231360052888" d="20053334" />
               <S t="1856231380106222" d="20053333" r="1" />
               <S t="1856231420212888" d="19840000" />
               <S t="1856231440052888" d="20053334" />
               <S t="1856231460106222" d="20053333" r="1" />
               <S t="1856231500212888" d="19840000" />
               <S t="1856231520052888" d="20053334" />
            </SegmentTimeline>
         </SegmentTemplate>
         <Representation audioSamplingRate="48000" codecs="mp4a.40.2" id="stream_3" bandwidth="96000" />
      </AdaptationSet>
      <AdaptationSet mimeType="application/mp4" startWithSAP="1" lang="dan" segmentAlignment="true">
         <SegmentTemplate timescale="10000000" presentationTimeOffset="0" media="$RepresentationID$/Segment-$Time$.m4s" initialization="$RepresentationID$/init.m4i">
            <SegmentTimeline>
               <S t="1856230341050000" d="20000000" r="59" />
            </SegmentTimeline>
         </SegmentTemplate>
         <Representation codecs="wvtt" id="stream_6" bandwidth="15000" />
      </AdaptationSet>
      <AdaptationSet mimeType="application/mp4" startWithSAP="1" lang="fin" segmentAlignment="true">
         <SegmentTemplate timescale="10000000" presentationTimeOffset="0" media="$RepresentationID$/Segment-$Time$.m4s" initialization="$RepresentationID$/init.m4i">
            <SegmentTimeline>
               <S t="1856230321050000" d="20000000" r="59" />
            </SegmentTimeline>
         </SegmentTemplate>
         <Representation codecs="wvtt" id="stream_7" bandwidth="15000" />
      </AdaptationSet>
      <AdaptationSet mimeType="application/mp4" startWithSAP="1" lang="nor" segmentAlignment="true">
         <SegmentTemplate timescale="10000000" presentationTimeOffset="0" media="$RepresentationID$/Segment-$Time$.m4s" initialization="$RepresentationID$/init.m4i">
            <SegmentTimeline>
               <S t="1856230321050000" d="20000000" r="59" />
            </SegmentTimeline>
         </SegmentTemplate>
         <Representation codecs="wvtt" id="stream_5" bandwidth="15000" />
      </AdaptationSet>
      <AdaptationSet mimeType="application/mp4" startWithSAP="1" lang="swe" segmentAlignment="true">
         <SegmentTemplate timescale="10000000" presentationTimeOffset="0" media="$RepresentationID$/Segment-$Time$.m4s" initialization="$RepresentationID$/init.m4i">
            <SegmentTimeline>
               <S t="1856230321050000" d="20000000" r="59" />
            </SegmentTimeline>
         </SegmentTemplate>
         <Representation codecs="wvtt" id="stream_4" bandwidth="15000" />
      </AdaptationSet>
   </Period>
</MPD>

Streams are under VPN.

I have debugged and found that something wrong with parsing manifest logic for mimeType=application/mp4 and codecs=wvtt and for some other cases too. DashManifestParser.buildFormat() returns format with empty language in case mimeType=application/mp4 and codecs=wvtt. Why?

PavelGP commented 7 years ago

Could you please give us time estimate, when do you fix bug? We should know how to plan our time and if we should make any workaround for current realization.

ojw28 commented 7 years ago

This should be fixed on dev-v2 as a side effect of https://github.com/google/ExoPlayer/commit/7f967f305718bc2c9ee679fdd7d014eccef0356b. There will be one further cleanup change, but that wont affect functionality.