Update end to end test with vpx packaging

Change-Id: I70886693b5ad7d4c52170e57901c2437eba69214
This commit is contained in:
KongQun Yang 2016-01-08 16:18:52 -08:00
parent b4e9b5ac2b
commit 4b111a030e
13 changed files with 116 additions and 8 deletions

View File

@ -104,6 +104,24 @@ class PackagerAppTest(unittest.TestCase):
self._DiffGold(self.output[2], 'subtitle-english-golden.vtt') self._DiffGold(self.output[2], 'subtitle-english-golden.vtt')
self._DiffGold(self.mpd_output, 'bear-640x360-avt-golden.mpd') self._DiffGold(self.mpd_output, 'bear-640x360-avt-golden.mpd')
def testPackageVp8Webm(self):
self.packager.Package(
self._GetStreams(['video'],
output_format='webm',
test_files=['bear-640x360.webm']),
self._GetFlags())
self._DiffGold(self.output[0], 'bear-640x360-vp8-golden.webm')
self._DiffGold(self.mpd_output, 'bear-640x360-vp8-webm-golden.mpd')
def testPackageVp9Webm(self):
self.packager.Package(
self._GetStreams(['video'],
output_format='webm',
test_files=['bear-320x240-vp9.webm']),
self._GetFlags())
self._DiffGold(self.output[0], 'bear-320x240-vp9-golden.webm')
self._DiffGold(self.mpd_output, 'bear-320x240-vp9-webm-golden.mpd')
def testPackageWithEncryption(self): def testPackageWithEncryption(self):
self.packager.Package( self.packager.Package(
self._GetStreams(['audio', 'video']), self._GetStreams(['audio', 'video']),
@ -120,6 +138,24 @@ class PackagerAppTest(unittest.TestCase):
self._DiffGold(self.output[0], 'bear-640x360-hevc-v-cenc-golden.mp4') self._DiffGold(self.output[0], 'bear-640x360-hevc-v-cenc-golden.mp4')
self._DiffGold(self.mpd_output, 'bear-640x360-hevc-v-cenc-golden.mpd') self._DiffGold(self.mpd_output, 'bear-640x360-hevc-v-cenc-golden.mpd')
def testPackageVp8Mp4WithEncryption(self):
self.packager.Package(
self._GetStreams(['video'],
output_format='mp4',
test_files=['bear-640x360.webm']),
self._GetFlags(encryption=True))
self._DiffGold(self.output[0], 'bear-640x360-vp8-cenc-golden.mp4')
self._DiffGold(self.mpd_output, 'bear-640x360-vp8-cenc-golden.mpd')
def testPackageVp9Mp4WithEncryption(self):
self.packager.Package(
self._GetStreams(['video'],
output_format='mp4',
test_files=['bear-320x240-vp9.webm']),
self._GetFlags(encryption=True))
self._DiffGold(self.output[0], 'bear-320x240-vp9-cenc-golden.mp4')
self._DiffGold(self.mpd_output, 'bear-320x240-vp9-cenc-golden.mpd')
def testPackageWithEncryptionAndRandomIv(self): def testPackageWithEncryptionAndRandomIv(self):
self.packager.Package( self.packager.Package(
self._GetStreams(['audio', 'video']), self._GetStreams(['audio', 'video']),
@ -277,7 +313,11 @@ class PackagerAppTest(unittest.TestCase):
self._AssertStreamInfo(self.output[0], 'is_encrypted: true') self._AssertStreamInfo(self.output[0], 'is_encrypted: true')
self._AssertStreamInfo(self.output[1], 'is_encrypted: true') self._AssertStreamInfo(self.output[1], 'is_encrypted: true')
def _GetStreams(self, stream_descriptors, live=False, test_files=None): def _GetStreams(self,
stream_descriptors,
output_format='mp4',
live=False,
test_files=None):
if test_files is None: if test_files is None:
test_files = ['bear-640x360.mp4'] test_files = ['bear-640x360.mp4']
streams = [] streams = []
@ -299,18 +339,20 @@ class PackagerAppTest(unittest.TestCase):
output_prefix)) output_prefix))
self.output.append(output_prefix) self.output.append(output_prefix)
else: else:
output = '%s.%s' % (output_prefix, output = '%s.%s' % (
self._GetExtension(stream_descriptor)) output_prefix,
stream = 'input=%s,stream=%s,output=%s' self._GetExtension(stream_descriptor, output_format))
streams.append(stream % (test_file, stream_descriptor, output)) stream = 'input=%s,stream=%s,format=%s,output=%s'
streams.append(stream %
(test_file, stream_descriptor, output_format, output))
self.output.append(output) self.output.append(output)
return streams return streams
def _GetExtension(self, stream_descriptor): def _GetExtension(self, stream_descriptor, output_format):
# TODO(rkuroiwa): Support ttml. # TODO(rkuroiwa): Support ttml.
if stream_descriptor == 'text': if stream_descriptor == 'text':
return 'vtt' return 'vtt'
return 'mp4' return output_format
def _GetFlags(self, def _GetFlags(self,
encryption=False, encryption=False,
@ -364,7 +406,8 @@ class PackagerAppTest(unittest.TestCase):
def _DiffGold(self, test_output, golden_file_name): def _DiffGold(self, test_output, golden_file_name):
golden_file = os.path.join(self.golden_file_dir, golden_file_name) golden_file = os.path.join(self.golden_file_dir, golden_file_name)
if test_env.options.test_update_golden_files: if test_env.options.test_update_golden_files:
if not filecmp.cmp(test_output, golden_file): if not os.path.exists(golden_file) or not filecmp.cmp(test_output,
golden_file):
print 'Updating golden file: ', golden_file_name print 'Updating golden file: ', golden_file_name
shutil.copyfile(test_output, golden_file) shutil.copyfile(test_output, golden_file)
else: else:

Binary file not shown.

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--Generated with https://github.com/google/edash-packager version <tag>-<hash>-<test>-->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd" xmlns:cenc="urn:mpeg:cenc:2013" minBufferTime="PT2S" type="static" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" mediaPresentationDuration="PT2.7060000896453857S">
<Period>
<AdaptationSet id="0" contentType="video" width="320" height="240" frameRate="1000000/33000" subsegmentAlignment="true" par="16:9">
<Representation id="0" bandwidth="210593" codecs="vp09.00.00.08.00.01.00.00" mimeType="video/mp4" sar="427:320" width="320" height="240" frameRate="1000000/33000">
<ContentProtection value="cenc" schemeIdUri="urn:mpeg:dash:mp4protection:2011" cenc:default_KID="31323334-3536-3738-3930-313233343536"/>
<ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed">
<cenc:pssh>AAAAMHBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAABAxMjM0NTY3ODkwMTIzNDU2</cenc:pssh>
</ContentProtection>
<BaseURL>output_video.mp4</BaseURL>
<SegmentBase indexRange="1039-1094" timescale="1000000">
<Initialization range="0-1038"/>
</SegmentBase>
</Representation>
</AdaptationSet>
</Period>
</MPD>

Binary file not shown.

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--Generated with https://github.com/google/edash-packager version <tag>-<hash>-<test>-->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd" xmlns:cenc="urn:mpeg:cenc:2013" minBufferTime="PT2S" type="static" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" mediaPresentationDuration="PT2.7059998512268066S">
<Period>
<AdaptationSet id="0" contentType="video" width="320" height="240" frameRate="1000000/33000" par="16:9">
<Representation id="0" bandwidth="205399" codecs="vp9" mimeType="video/webm" sar="427:320" width="320" height="240" frameRate="1000000/33000">
<BaseURL>output_video.webm</BaseURL>
<SegmentBase indexRange="69443-69476" timescale="1000000">
<Initialization range="0-290"/>
</SegmentBase>
</Representation>
</AdaptationSet>
</Period>
</MPD>

Binary file not shown.

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--Generated with https://github.com/google/edash-packager version <tag>-<hash>-<test>-->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd" xmlns:cenc="urn:mpeg:cenc:2013" minBufferTime="PT2S" type="static" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" mediaPresentationDuration="PT2.7060000896453857S">
<Period>
<AdaptationSet id="0" contentType="video" width="640" height="360" frameRate="1000000/33000" subsegmentAlignment="true" par="16:9">
<Representation id="0" bandwidth="344796" codecs="vp08.00.00.08.01.01.00.00" mimeType="video/mp4" sar="1:1" width="640" height="360" frameRate="1000000/33000">
<ContentProtection value="cenc" schemeIdUri="urn:mpeg:dash:mp4protection:2011" cenc:default_KID="31323334-3536-3738-3930-313233343536"/>
<ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed">
<cenc:pssh>AAAAMHBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAABAxMjM0NTY3ODkwMTIzNDU2</cenc:pssh>
</ContentProtection>
<BaseURL>output_video.mp4</BaseURL>
<SegmentBase indexRange="1007-1062" timescale="1000000">
<Initialization range="0-1006"/>
</SegmentBase>
</Representation>
</AdaptationSet>
</Period>
</MPD>

Binary file not shown.

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--Generated with https://github.com/google/edash-packager version <tag>-<hash>-<test>-->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd" xmlns:cenc="urn:mpeg:cenc:2013" minBufferTime="PT2S" type="static" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" mediaPresentationDuration="PT2.7059998512268066S">
<Period>
<AdaptationSet id="0" contentType="video" width="640" height="360" frameRate="1000000/33000" par="16:9">
<Representation id="0" bandwidth="339004" codecs="vp8" mimeType="video/webm" sar="1:1" width="640" height="360" frameRate="1000000/33000">
<BaseURL>output_video.webm</BaseURL>
<SegmentBase indexRange="114634-114668" timescale="1000000">
<Initialization range="0-292"/>
</SegmentBase>
</Representation>
</AdaptationSet>
</Period>
</MPD>

View File

@ -3,6 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
bear-320x240.webm - WebM encode of bear.1280x720.mp4 resized to 320x240. bear-320x240.webm - WebM encode of bear.1280x720.mp4 resized to 320x240.
bear-320x240-vp9.webm - Same as above, but with vp9 codec.
no_streams.webm - Header, Info, & Tracks element from bear-320x240.webm slightly corrupted so it looks no_streams.webm - Header, Info, & Tracks element from bear-320x240.webm slightly corrupted so it looks
like there are no tracks. like there are no tracks.
nonzero-start-time.webm - Has the same headers as bear-320x240.webm but the first cluster of this file nonzero-start-time.webm - Has the same headers as bear-320x240.webm but the first cluster of this file

Binary file not shown.