Add end to end tests for packed audio

Issue: #342.

Change-Id: Iaa890450615573da84b8934b2ba3ee3602d6fb74
This commit is contained in:
KongQun Yang 2018-05-17 17:58:34 -07:00
parent 5bb5a58b7f
commit b58753278c
31 changed files with 227 additions and 1 deletions

View File

@ -223,7 +223,9 @@ class PackagerAppTest(unittest.TestCase):
if base_ext in ['ts', 'mp4'] and descriptor == 'video':
stream.Append('iframe_playlist_name', output_file_name + '-iframe.m3u8')
requires_init_segment = segmented and base_ext not in ['ts', 'vtt']
requires_init_segment = segmented and base_ext not in [
'aac', 'ac3', 'ec3', 'ts', 'vtt'
]
output_file_path = os.path.join(self.tmp_dir, output_file_name)
@ -1061,6 +1063,27 @@ class PackagerFunctionalTest(PackagerAppTest):
self._GetFlags(encryption=True, output_hls=True))
self._CheckTestResults('avc-ts-with-encryption')
def testAvcTsAacPackedAudioWithEncryption(self):
# Currently we only support live packaging for ts.
streams = [
self._GetStream(
'audio',
output_format='aac',
segmented=True,
hls=True,
test_file='bear-640x360.ts'),
self._GetStream(
'video',
output_format='ts',
segmented=True,
hls=True,
test_file='bear-640x360.ts')
]
flags = self._GetFlags(encryption=True, output_hls=True)
self.assertPackageSuccess(streams, flags)
self._CheckTestResults('avc-ts-aac-packed-audio-with-encryption')
def testAvcTsWithEncryptionAndFairplay(self):
# Currently we only support live packaging for ts.
self.assertPackageSuccess(
@ -1085,6 +1108,27 @@ class PackagerFunctionalTest(PackagerAppTest):
self._GetFlags(encryption=True, output_hls=True))
self._CheckTestResults('avc-ac3-ts-with-encryption')
def testAvcTsAc3PackedAudioWithEncryption(self):
# Currently we only support live packaging for ts.
streams = [
self._GetStream(
'audio',
output_format='ac3',
segmented=True,
hls=True,
test_file='bear-640x360-ac3.ts'),
self._GetStream(
'video',
output_format='ts',
segmented=True,
hls=True,
test_file='bear-640x360-ac3.ts')
]
flags = self._GetFlags(encryption=True, output_hls=True)
self.assertPackageSuccess(streams, flags)
self._CheckTestResults('avc-ts-ac3-packed-audio-with-encryption')
def testAvcTsWithEncryptionExerciseEmulationPrevention(self):
self.encryption_key = 'ad7e9786def9159db6724be06dfcde7a'
# Currently we only support live packaging for ts.
@ -1247,6 +1291,26 @@ class PackagerFunctionalTest(PackagerAppTest):
self._GetFlags(encryption=True, output_hls=True))
self._CheckTestResults('ec3-and-hls-single-segment-mp4-encrypted')
def testEc3PackedAudioEncrypted(self):
streams = [
self._GetStream(
'audio',
output_format='ec3',
segmented=True,
hls=True,
test_file='bear-640x360-ec3.mp4'),
self._GetStream(
'video',
output_format='ts',
segmented=True,
hls=True,
test_file='bear-640x360-ec3.mp4')
]
flags = self._GetFlags(encryption=True, output_hls=True)
self.assertPackageSuccess(streams, flags)
self._CheckTestResults('ec3-packed-audio-encrypted')
def testHlsSingleSegmentMp4EncryptedAndAdCues(self):
self.assertPackageSuccess(
self._GetStreams(['audio', 'video'], hls=True),

View File

@ -0,0 +1,14 @@
#EXTM3U
#EXT-X-VERSION:6
## Generated with https://github.com/google/shaka-packager version <tag>-<hash>-<test>
#EXT-X-TARGETDURATION:2
#EXT-X-PLAYLIST-TYPE:VOD
#EXTINF:0.975,
bear-640x360-audio-1.aac
#EXT-X-DISCONTINUITY
#EXT-X-KEY:METHOD=SAMPLE-AES,URI="data:text/plain;base64,MTIzNDU2Nzg5MDEyMzQ1Ng==",IV=0x3334353637383930,KEYFORMAT="identity"
#EXTINF:0.998,
bear-640x360-audio-2.aac
#EXTINF:0.789,
bear-640x360-audio-3.aac
#EXT-X-ENDLIST

View File

@ -0,0 +1,17 @@
#EXTM3U
#EXT-X-VERSION:6
## Generated with https://github.com/google/shaka-packager version <tag>-<hash>-<test>
#EXT-X-TARGETDURATION:2
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-I-FRAMES-ONLY
#EXT-X-KEY:METHOD=SAMPLE-AES,URI="data:text/plain;base64,MTIzNDU2Nzg5MDEyMzQ1Ng==",IV=0x3334353637383930,KEYFORMAT="identity"
#EXTINF:1.001,
#EXT-X-BYTERANGE:15604@376
bear-640x360-video-1.ts
#EXTINF:1.001,
#EXT-X-BYTERANGE:18236@376
bear-640x360-video-2.ts
#EXTINF:0.667,
#EXT-X-BYTERANGE:19928@376
bear-640x360-video-3.ts
#EXT-X-ENDLIST

View File

@ -0,0 +1,14 @@
#EXTM3U
#EXT-X-VERSION:6
## Generated with https://github.com/google/shaka-packager version <tag>-<hash>-<test>
#EXT-X-TARGETDURATION:2
#EXT-X-PLAYLIST-TYPE:VOD
#EXTINF:1.001,
bear-640x360-video-1.ts
#EXT-X-DISCONTINUITY
#EXT-X-KEY:METHOD=SAMPLE-AES,URI="data:text/plain;base64,MTIzNDU2Nzg5MDEyMzQ1Ng==",IV=0x3334353637383930,KEYFORMAT="identity"
#EXTINF:1.001,
bear-640x360-video-2.ts
#EXTINF:0.734,
bear-640x360-video-3.ts
#EXT-X-ENDLIST

View File

@ -0,0 +1,9 @@
#EXTM3U
## Generated with https://github.com/google/shaka-packager version <tag>-<hash>-<test>
#EXT-X-MEDIA:TYPE=AUDIO,URI="bear-640x360-audio.m3u8",GROUP-ID="default-audio-group",NAME="stream_0",AUTOSELECT=YES,CHANNELS="2"
#EXT-X-STREAM-INF:BANDWIDTH=1154997,CODECS="avc1.64001e,mp4a.40.2",RESOLUTION=640x360,AUDIO="default-audio-group"
bear-640x360-video.m3u8
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=238897,CODECS="avc1.64001e",RESOLUTION=640x360,URI="bear-640x360-video-iframe.m3u8"

View File

@ -0,0 +1,14 @@
#EXTM3U
#EXT-X-VERSION:6
## Generated with https://github.com/google/shaka-packager version <tag>-<hash>-<test>
#EXT-X-TARGETDURATION:2
#EXT-X-PLAYLIST-TYPE:VOD
#EXTINF:0.975,
bear-640x360-ac3-audio-1.ac3
#EXT-X-DISCONTINUITY
#EXT-X-KEY:METHOD=SAMPLE-AES,URI="data:text/plain;base64,MTIzNDU2Nzg5MDEyMzQ1Ng==",IV=0x3334353637383930,KEYFORMAT="identity"
#EXTINF:1.010,
bear-640x360-ac3-audio-2.ac3
#EXTINF:0.801,
bear-640x360-ac3-audio-3.ac3
#EXT-X-ENDLIST

View File

@ -0,0 +1,17 @@
#EXTM3U
#EXT-X-VERSION:6
## Generated with https://github.com/google/shaka-packager version <tag>-<hash>-<test>
#EXT-X-TARGETDURATION:2
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-I-FRAMES-ONLY
#EXT-X-KEY:METHOD=SAMPLE-AES,URI="data:text/plain;base64,MTIzNDU2Nzg5MDEyMzQ1Ng==",IV=0x3334353637383930,KEYFORMAT="identity"
#EXTINF:1.001,
#EXT-X-BYTERANGE:15604@376
bear-640x360-ac3-video-1.ts
#EXTINF:1.001,
#EXT-X-BYTERANGE:18236@376
bear-640x360-ac3-video-2.ts
#EXTINF:0.667,
#EXT-X-BYTERANGE:19928@376
bear-640x360-ac3-video-3.ts
#EXT-X-ENDLIST

View File

@ -0,0 +1,14 @@
#EXTM3U
#EXT-X-VERSION:6
## Generated with https://github.com/google/shaka-packager version <tag>-<hash>-<test>
#EXT-X-TARGETDURATION:2
#EXT-X-PLAYLIST-TYPE:VOD
#EXTINF:1.001,
bear-640x360-ac3-video-1.ts
#EXT-X-DISCONTINUITY
#EXT-X-KEY:METHOD=SAMPLE-AES,URI="data:text/plain;base64,MTIzNDU2Nzg5MDEyMzQ1Ng==",IV=0x3334353637383930,KEYFORMAT="identity"
#EXTINF:1.001,
bear-640x360-ac3-video-2.ts
#EXTINF:0.734,
bear-640x360-ac3-video-3.ts
#EXT-X-ENDLIST

View File

@ -0,0 +1,9 @@
#EXTM3U
## Generated with https://github.com/google/shaka-packager version <tag>-<hash>-<test>
#EXT-X-MEDIA:TYPE=AUDIO,URI="bear-640x360-ac3-audio.m3u8",GROUP-ID="default-audio-group",NAME="stream_0",AUTOSELECT=YES,CHANNELS="2"
#EXT-X-STREAM-INF:BANDWIDTH=1216576,CODECS="avc1.64001e,ac-3",RESOLUTION=640x360,AUDIO="default-audio-group"
bear-640x360-ac3-video.m3u8
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=238897,CODECS="avc1.64001e",RESOLUTION=640x360,URI="bear-640x360-ac3-video-iframe.m3u8"

View File

@ -0,0 +1,14 @@
#EXTM3U
#EXT-X-VERSION:6
## Generated with https://github.com/google/shaka-packager version <tag>-<hash>-<test>
#EXT-X-TARGETDURATION:2
#EXT-X-PLAYLIST-TYPE:VOD
#EXTINF:1.010,
bear-640x360-ec3-audio-1.ec3
#EXT-X-DISCONTINUITY
#EXT-X-KEY:METHOD=SAMPLE-AES,URI="data:text/plain;base64,MTIzNDU2Nzg5MDEyMzQ1Ng==",IV=0x3334353637383930,KEYFORMAT="identity"
#EXTINF:1.010,
bear-640x360-ec3-audio-2.ec3
#EXTINF:0.731,
bear-640x360-ec3-audio-3.ec3
#EXT-X-ENDLIST

View File

@ -0,0 +1,17 @@
#EXTM3U
#EXT-X-VERSION:6
## Generated with https://github.com/google/shaka-packager version <tag>-<hash>-<test>
#EXT-X-TARGETDURATION:2
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-I-FRAMES-ONLY
#EXT-X-KEY:METHOD=SAMPLE-AES,URI="data:text/plain;base64,MTIzNDU2Nzg5MDEyMzQ1Ng==",IV=0x3334353637383930,KEYFORMAT="identity"
#EXTINF:1.001,
#EXT-X-BYTERANGE:15604@376
bear-640x360-ec3-video-1.ts
#EXTINF:1.001,
#EXT-X-BYTERANGE:18236@376
bear-640x360-ec3-video-2.ts
#EXTINF:0.667,
#EXT-X-BYTERANGE:19928@376
bear-640x360-ec3-video-3.ts
#EXT-X-ENDLIST

View File

@ -0,0 +1,14 @@
#EXTM3U
#EXT-X-VERSION:6
## Generated with https://github.com/google/shaka-packager version <tag>-<hash>-<test>
#EXT-X-TARGETDURATION:2
#EXT-X-PLAYLIST-TYPE:VOD
#EXTINF:1.001,
bear-640x360-ec3-video-1.ts
#EXT-X-DISCONTINUITY
#EXT-X-KEY:METHOD=SAMPLE-AES,URI="data:text/plain;base64,MTIzNDU2Nzg5MDEyMzQ1Ng==",IV=0x3334353637383930,KEYFORMAT="identity"
#EXTINF:1.001,
bear-640x360-ec3-video-2.ts
#EXTINF:0.734,
bear-640x360-ec3-video-3.ts
#EXT-X-ENDLIST

View File

@ -0,0 +1,9 @@
#EXTM3U
## Generated with https://github.com/google/shaka-packager version <tag>-<hash>-<test>
#EXT-X-MEDIA:TYPE=AUDIO,URI="bear-640x360-ec3-audio.m3u8",GROUP-ID="default-audio-group",NAME="stream_0",AUTOSELECT=YES,CHANNELS="2"
#EXT-X-STREAM-INF:BANDWIDTH=1216653,CODECS="avc1.64001e,ec-3",RESOLUTION=640x360,AUDIO="default-audio-group"
bear-640x360-ec3-video.m3u8
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=238897,CODECS="avc1.64001e",RESOLUTION=640x360,URI="bear-640x360-ec3-video-iframe.m3u8"