Consider DASH stream descriptor field "roles" for WebVTT text streams. (#740)
Fixes #708.
This commit is contained in:
parent
4bfa603b52
commit
fbcc8f31e3
|
@ -677,6 +677,11 @@ class PackagerFunctionalTest(PackagerAppTest):
|
||||||
self._GetStream('video'),
|
self._GetStream('video'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
streams += self._GetStreams(
|
||||||
|
['text'],
|
||||||
|
test_files=['bear-english.vtt'],
|
||||||
|
dash_roles='caption')
|
||||||
|
|
||||||
self.assertPackageSuccess(streams, self._GetFlags(output_dash=True))
|
self.assertPackageSuccess(streams, self._GetFlags(output_dash=True))
|
||||||
self._CheckTestResults('audio-video-with-accessibilities-and-roles')
|
self._CheckTestResults('audio-video-with-accessibilities-and-roles')
|
||||||
|
|
||||||
|
|
10
packager/app/test/testdata/audio-video-with-accessibilities-and-roles/bear-english-text.vtt
vendored
Normal file
10
packager/app/test/testdata/audio-video-with-accessibilities-and-roles/bear-english-text.vtt
vendored
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
WEBVTT
|
||||||
|
|
||||||
|
STYLE
|
||||||
|
::cue { color:lime }
|
||||||
|
|
||||||
|
00:00:00.000 --> 00:00:00.800
|
||||||
|
Yup, that's a bear, eh.
|
||||||
|
|
||||||
|
00:00:01.000 --> 00:00:04.700
|
||||||
|
He 's... um... doing bear-like stuff.
|
|
@ -2,18 +2,24 @@
|
||||||
<!--Generated with https://github.com/google/shaka-packager version <tag>-<hash>-<test>-->
|
<!--Generated with https://github.com/google/shaka-packager version <tag>-<hash>-<test>-->
|
||||||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" minBufferTime="PT2S" type="static" mediaPresentationDuration="PT2.7360665798187256S">
|
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" minBufferTime="PT2S" type="static" mediaPresentationDuration="PT2.7360665798187256S">
|
||||||
<Period id="0">
|
<Period id="0">
|
||||||
<AdaptationSet id="0" contentType="video" width="640" height="360" frameRate="30000/1001" subsegmentAlignment="true" par="16:9">
|
<AdaptationSet id="0" contentType="text" subsegmentAlignment="true">
|
||||||
<Representation id="0" bandwidth="973483" codecs="avc1.64001e" mimeType="video/mp4" sar="1:1">
|
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="caption"/>
|
||||||
|
<Representation id="0" bandwidth="256" mimeType="text/vtt">
|
||||||
|
<BaseURL>bear-english-text.vtt</BaseURL>
|
||||||
|
</Representation>
|
||||||
|
</AdaptationSet>
|
||||||
|
<AdaptationSet id="1" contentType="video" width="640" height="360" frameRate="30000/1001" subsegmentAlignment="true" par="16:9">
|
||||||
|
<Representation id="1" bandwidth="973483" codecs="avc1.64001e" mimeType="video/mp4" sar="1:1">
|
||||||
<BaseURL>bear-640x360-video.mp4</BaseURL>
|
<BaseURL>bear-640x360-video.mp4</BaseURL>
|
||||||
<SegmentBase indexRange="859-926" timescale="30000">
|
<SegmentBase indexRange="859-926" timescale="30000">
|
||||||
<Initialization range="0-858"/>
|
<Initialization range="0-858"/>
|
||||||
</SegmentBase>
|
</SegmentBase>
|
||||||
</Representation>
|
</Representation>
|
||||||
</AdaptationSet>
|
</AdaptationSet>
|
||||||
<AdaptationSet id="1" contentType="audio" subsegmentAlignment="true">
|
<AdaptationSet id="2" contentType="audio" subsegmentAlignment="true">
|
||||||
<Accessibility schemeIdUri="urn:tva:metadata:cs:AudioPurposeCS:2007" value="1"/>
|
<Accessibility schemeIdUri="urn:tva:metadata:cs:AudioPurposeCS:2007" value="1"/>
|
||||||
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="alternate"/>
|
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="alternate"/>
|
||||||
<Representation id="1" bandwidth="133334" codecs="mp4a.40.2" mimeType="audio/mp4" audioSamplingRate="44100">
|
<Representation id="2" bandwidth="133334" codecs="mp4a.40.2" mimeType="audio/mp4" audioSamplingRate="44100">
|
||||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
|
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
|
||||||
<BaseURL>bear-640x360-audio.mp4</BaseURL>
|
<BaseURL>bear-640x360-audio.mp4</BaseURL>
|
||||||
<SegmentBase indexRange="793-860" timescale="44100">
|
<SegmentBase indexRange="793-860" timescale="44100">
|
||||||
|
|
|
@ -402,6 +402,12 @@ bool StreamInfoToTextMediaInfo(const StreamDescriptor& stream_descriptor,
|
||||||
text_media_info->set_bandwidth(kDefaultTextBandwidth);
|
text_media_info->set_bandwidth(kDefaultTextBandwidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!stream_descriptor.dash_roles.empty()) {
|
||||||
|
for (const auto& dash_role : stream_descriptor.dash_roles) {
|
||||||
|
text_media_info->add_dash_roles(dash_role);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue