def setUp(self): super(CreateJobKeepAspectRatioTestCase, self).setUp() input_url = test_video_url input = Input(input_url) self.input = create_input(input) video_configs = list() video_configs.append( VideoStreamConfig(default_stream_id=0, bitrate=4800000, profile='Main', preset='premium', height=600, width=1920)) video_configs.append( VideoStreamConfig(default_stream_id=0, bitrate=2400000, profile='Main', preset='premium', width=1024)) video_configs.append( VideoStreamConfig(default_stream_id=0, bitrate=1200000, profile='Main', preset='premium', height=720)) audio_stream_config = AudioStreamConfig(default_stream_id=0, bitrate=192000) encoding_profile = EncodingProfile('API Test Profile', video_configs, [audio_stream_config]) self.encoding_profile = create_encoding_profile(encoding_profile) self.manifests = ['m3u8', 'mpd']
def setUp(self): super(CreateJobPlayreadyWidevineDrmTestCase, self).setUp() input_url = test_video_url input = Input(input_url) self.input = create_input(input) audio_stream_config = AudioStreamConfig(default_stream_id=0, bitrate=192000) video_stream_config = VideoStreamConfig(default_stream_id=0, bitrate=512000, profile='Main', preset='premium', height=480, width=640) encoding_profile = EncodingProfile('API Test Profile', [video_stream_config], [audio_stream_config]) self.encoding_profile = create_encoding_profile(encoding_profile) self.manifests = ['m3u8', 'mpd'] self.drm_config = PlayreadyWidevineCombinedDrmConfig( key='100b6c20940f779a4589152b57d2dacb', pssh= 'CAESEOtnarvLNF6Wu89hZjDxo9oaDXdpZGV2aW5lX3Rlc3QiEGZrajNsamFTZGZhbGtyM2oqAkhEMgA=', kid='eb676abbcb345e96bbcf616630f1a3da', la_url= 'http://playready.directtaps.net/pr/svc/rightsmanager.asmx?PlayRight=1&ContentKey=EAtsIJQPd5pFiRUrV9Layw==', lui_url=None, ds_id=None, custom_attributes=None, method='mpeg_cenc')
def setUp(self): super(CreateJobWithVideoCroppingTestCase, self).setUp() input_url = test_video_url input = Input(input_url) self.input = create_input(input) audio_stream_config = AudioStreamConfig( default_stream_id=0, bitrate=192000 ) video_stream_config = VideoStreamConfig( default_stream_id=0, bitrate=512000, profile='Main', preset='premium', height=480, width=640 ) cropping_config = CroppingConfig( top=100, bottom=100, left=5, right=50 ) encoding_profile = EncodingProfile( name='API Test Profile', video_stream_configs=[video_stream_config], audio_stream_configs=[audio_stream_config], cropping_config=cropping_config ) self.encoding_profile = create_encoding_profile(encoding_profile) self.manifests = ['m3u8', 'mpd']
def setUp(self): super(TransferJobToGCSTestCase, self).setUp() self.maxDiff = None input_url = test_video_url input = Input(input_url) self.input = create_input(input) audio_stream_config = AudioStreamConfig(default_stream_id=0, bitrate=192000) video_stream_config = VideoStreamConfig(default_stream_id=0, bitrate=512000, profile='Main', preset='premium', height=480, width=640) encoding_profile = EncodingProfile('API Test Profile', [video_stream_config], [audio_stream_config]) self.encoding_profile = create_encoding_profile(encoding_profile) self.manifests = ['m3u8', 'mpd'] job = Job( input_id=self.input.input_id, encoding_profile_id=self.encoding_profile.encoding_profile_id, manifest_types=self.manifests) self.job = create_job(job) output = GCSOutput(name='Python Test Output', access_key=gcs_output_config.get('accessKey'), secret_key=gcs_output_config.get('secretKey'), bucket=gcs_output_config.get('bucket'), prefix=gcs_output_config.get('prefix'), make_public=False) self.output = create_output(output)
def setUp(self): super(CreateJobWithWatermarkTestCase, self).setUp() input_url = test_video_url input = Input(input_url) self.input = create_input(input) audio_stream_config = AudioStreamConfig(default_stream_id=0, bitrate=192000) video_stream_config = VideoStreamConfig(default_stream_id=0, bitrate=512000, profile='Main', preset='premium', height=480, width=640) watermark_config = WatermarkConfig( image_url= 'http://bitdash-a.akamaihd.net/webpages/bitcodin/images/bitcodin-bitmovin-logo-small.png', bottom=200, right=100) encoding_profile = EncodingProfile( name='API Test Profile', video_stream_configs=[video_stream_config], audio_stream_configs=[audio_stream_config], watermark_config=watermark_config) self.encoding_profile = create_encoding_profile(encoding_profile) self.manifests = ['m3u8', 'mpd']
def setUp(self): super(CreateJobPlayreadyDrmInvalidConfigTestCase, self).setUp() input_url = test_video_url input = Input(input_url) self.input = create_input(input) audio_stream_config = AudioStreamConfig(default_stream_id=0, bitrate=192000) video_stream_config = VideoStreamConfig(default_stream_id=0, bitrate=512000, profile='Main', preset='premium', height=480, width=640) encoding_profile = EncodingProfile('API Test Profile', [video_stream_config], [audio_stream_config]) self.encoding_profile = create_encoding_profile(encoding_profile) self.manifests = ['m3u8', 'mpd'] self.drm_config = PlayreadyDrmConfig(k_id=None, key=None, key_seed=None, la_url=None, lui_url=None, ds_id=None, custom_attributes=None, method='mpeg_cenc')
def setUp(self): super(GetEncodingProfileListTestCase, self).setUp() audio_stream_config = AudioStreamConfig(default_stream_id=0, bitrate=192000) video_stream_config = VideoStreamConfig(default_stream_id=1, bitrate=512000, profile='Main', preset='premium', height=480, width=640) encoding_profile = EncodingProfile('API Test Profile', [video_stream_config], [audio_stream_config]) self.encoding_profile = create_encoding_profile(encoding_profile)
def runTest(self): audio_stream_config = AudioStreamConfig(default_stream_id=0, bitrate=192000) video_stream_config = VideoStreamConfig(default_stream_id=1, bitrate=512000, profile='Main', preset='premium', height=480, width=640) cropping_config = CroppingConfig(top=100, bottom=100, left=5, right=50) encoding_profile = EncodingProfile( name='API Test Profile', video_stream_configs=[video_stream_config], audio_stream_configs=[audio_stream_config], cropping_config=cropping_config) result = create_encoding_profile(encoding_profile) self.encoding_profile = result self.assertEquals(result.name, 'API Test Profile') self.assertEquals(result.video_stream_configs[0].default_stream_id, 1) self.assertEquals(result.video_stream_configs[0].bitrate, 512000) self.assertEquals(result.video_stream_configs[0].profile, 'Main') self.assertEquals(result.video_stream_configs[0].preset.lower(), 'standard') self.assertEquals(result.video_stream_configs[0].height, 480) self.assertEquals(result.video_stream_configs[0].width, 640) self.assertEquals(result.audio_stream_configs[0].default_stream_id, 0) self.assertEquals(result.audio_stream_configs[0].bitrate, 192000) self.assertEquals(result.cropping_config.top, 100) self.assertEquals(result.cropping_config.bottom, 100) self.assertEquals(result.cropping_config.left, 5) self.assertEquals(result.cropping_config.right, 50)
def setUp(self): super(AutoTransferJobToFTPTestCase, self).setUp() self.maxDiff = None input_url = test_video_url input = Input(input_url) self.input = create_input(input) audio_stream_config = AudioStreamConfig(default_stream_id=0, bitrate=192000) video_stream_config = VideoStreamConfig(default_stream_id=0, bitrate=512000, profile='Main', preset='premium', height=480, width=640) encoding_profile = EncodingProfile('API Test Profile', [video_stream_config], [audio_stream_config]) self.encoding_profile = create_encoding_profile(encoding_profile) self.manifests = ['m3u8', 'mpd'] self.ftp_configuration = { 'name': 'Python API Test FTP Output', 'host': ftp_output_config.get('host', None), 'username': ftp_output_config.get('username', None), 'password': ftp_output_config.get('password', None), 'passive': True } output = FTPOutput( name=self.ftp_configuration.get('name'), host=self.ftp_configuration.get('host'), basic_auth_user=self.ftp_configuration.get('username'), basic_auth_password=self.ftp_configuration.get('password'), passive=self.ftp_configuration.get('passive')) self.output = create_output(output)
def setUp(self): super(TransferJobToAzureTestCase, self).setUp() self.maxDiff = None input_url = test_video_url input = Input(input_url) self.input = create_input(input) audio_stream_config = AudioStreamConfig(default_stream_id=0, bitrate=192000) video_stream_config = VideoStreamConfig(default_stream_id=0, bitrate=512000, profile='Main', preset='premium', height=480, width=640) encoding_profile = EncodingProfile('API Test Profile', [video_stream_config], [audio_stream_config]) self.encoding_profile = create_encoding_profile(encoding_profile) self.manifests = ['m3u8', 'mpd'] job = Job( input_id=self.input.input_id, encoding_profile_id=self.encoding_profile.encoding_profile_id, manifest_types=self.manifests) self.job = create_job(job) output = AzureOutput( name='Azure Test Output Python', account_name=azure_output_config.get('accountName'), account_key=azure_output_config.get('accountKey'), container=azure_output_config.get('container'), prefix=azure_output_config.get('prefix')) self.output = create_output(output)
def setUp(self): super(GetJobTestCase, self).setUp() self.maxDiff = None input_url = test_video_url input = Input(input_url) self.input = create_input(input) audio_stream_config = AudioStreamConfig(default_stream_id=0, bitrate=192000) video_stream_config = VideoStreamConfig(default_stream_id=0, bitrate=512000, profile='Main', preset='premium', height=480, width=640) encoding_profile = EncodingProfile('API Test Profile', [video_stream_config], [audio_stream_config]) self.encoding_profile = create_encoding_profile(encoding_profile) self.manifests = ['m3u8', 'mpd'] job = Job( input_id=self.input.input_id, encoding_profile_id=self.encoding_profile.encoding_profile_id, manifest_types=self.manifests) self.job = create_job(job)
def setUp(self): super(CreateJobPlayreadyDrmTestCase, self).setUp() input_url = test_video_url input = Input(input_url) self.input = create_input(input) audio_stream_config = AudioStreamConfig(default_stream_id=0, bitrate=192000) video_stream_config = VideoStreamConfig(default_stream_id=0, bitrate=512000, profile='Main', preset='premium', height=480, width=640) encoding_profile = EncodingProfile('API Test Profile', [video_stream_config], [audio_stream_config]) self.encoding_profile = create_encoding_profile(encoding_profile) self.manifests = ['m3u8', 'mpd'] self.drm_config = PlayreadyDrmConfig( k_id='746573745f69645f4639465043304e4f', key=None, key_seed='XVBovsmzhP9gRIZxWfFta3VVRPzVEWmJsazEJ46I', la_url='http://playready.directtaps.net/pr/svc/rightsmanager.asmx', lui_url=None, ds_id=None, custom_attributes=None, method='mpeg_cenc')
def setUp(self): super(CreateJobWithMultipleAudioStreamsTestCase, self).setUp() input_url = test_video_url_multiple_audio_streams input = Input(input_url) self.input = create_input(input) audio_stream_config_0 = AudioStreamConfig(default_stream_id=0, bitrate=192000) audio_stream_config_1 = AudioStreamConfig(default_stream_id=1, bitrate=192000) video_stream_config = VideoStreamConfig(default_stream_id=0, bitrate=512000, profile='Main', preset='premium', height=480, width=640) encoding_profile = EncodingProfile( 'API Test Profile', [video_stream_config], [audio_stream_config_0, audio_stream_config_1]) self.encoding_profile = create_encoding_profile(encoding_profile) self.manifests = ['m3u8', 'mpd'] self.audio_meta_data = {} audio_stream_config_0_meta_data = AudioMetaData(0, 'de', 'Just Sound') audio_stream_config_1_meta_data = AudioMetaData( 1, 'en', 'Sound and Voice') self.audio_meta_data = [ audio_stream_config_0_meta_data, audio_stream_config_1_meta_data ]
def setUp(self): super(CreateJobWidevineDrmTestCase, self).setUp() input_url = test_video_url input = Input(input_url) self.input = create_input(input) audio_stream_config = AudioStreamConfig(default_stream_id=0, bitrate=192000) video_stream_config = VideoStreamConfig(default_stream_id=0, bitrate=512000, profile='Main', preset='premium', height=480, width=640) encoding_profile = EncodingProfile('API Test Profile', [video_stream_config], [audio_stream_config]) self.encoding_profile = create_encoding_profile(encoding_profile) self.manifests = ['m3u8', 'mpd'] self.drm_config = WidevineDrmConfig( provider='widevine_test', signing_key= '1ae8ccd0e7985cc0b6203a55855a1034afc252980e970ca90e5202689f947ab9', signing_iv='d58ce954203b7c9a9a9d467f59839249', request_url='http://license.uat.widevine.com/cenc/getcontentkey', content_id='746573745f69645f4639465043304e4f', method='mpeg_cenc')
def runTest(self): audio_stream_config = AudioStreamConfig(default_stream_id=0, bitrate=192000, rate=48000) video_stream_config = VideoStreamConfig(default_stream_id=1, bitrate=512000, profile='Main', preset='premium', height=480, width=640, rate=24) encoding_profile = EncodingProfile( name='API Test Profile', video_stream_configs=[video_stream_config], audio_stream_configs=[audio_stream_config]) result = create_encoding_profile(encoding_profile) self.encoding_profile = result self.assertEquals(result.name, 'API Test Profile') self.assertEquals(result.video_stream_configs[0].default_stream_id, 1) self.assertEquals(result.video_stream_configs[0].bitrate, 512000) self.assertEquals(result.video_stream_configs[0].profile, 'Main') self.assertEquals(result.video_stream_configs[0].preset.lower(), 'standard') self.assertEquals(result.video_stream_configs[0].height, 480) self.assertEquals(result.video_stream_configs[0].width, 640) self.assertEquals(result.audio_stream_configs[0].default_stream_id, 0) self.assertEquals(result.audio_stream_configs[0].bitrate, 192000)
def runTest(self): audio_stream_config = AudioStreamConfig(default_stream_id=0, bitrate=192000) video_stream_config = VideoStreamConfig(default_stream_id=1, bitrate=512000, profile='Mainerr', preset='nonexpreset', height=480, width=640) encoding_profile = EncodingProfile('API Test Profile X', [video_stream_config], [audio_stream_config]) with self.assertRaises(BitcodinBadRequestError): result = create_encoding_profile(encoding_profile)
def setUp(self): super(CreateJobTestCase, self).setUp() input_url = test_video_url input = Input(url=input_url, skip_analysis=True) self.input = create_input(input) audio_stream_config = AudioStreamConfig(default_stream_id=0, bitrate=192000) video_stream_config = VideoStreamConfig(default_stream_id=0, bitrate=512000, profile='Main', preset='premium', height=480, width=640) encoding_profile = EncodingProfile('API Test Profile', [video_stream_config], [audio_stream_config]) self.encoding_profile = create_encoding_profile(encoding_profile) self.manifests = ['m3u8', 'mpd']
def setUp(self): super(CreateJobInvalidDataTestCase, self).setUp() input_url = test_video_url input = Input(input_url) self.input = create_input(input) audio_stream_config = AudioStreamConfig(default_stream_id=0, bitrate=192000) video_stream_config = VideoStreamConfig(default_stream_id=0, bitrate=512000, profile='Main', preset='premium', height=480, width=640) encoding_profile = EncodingProfile('API Test Profile', [video_stream_config], [audio_stream_config]) self.encoding_profile = create_encoding_profile(encoding_profile)
def setUp(self): super(CreateJobWithSpecificSegmentLengthTestCase, self).setUp() input_url = test_video_url input = Input(input_url) self.input = create_input(input) audio_stream_config = AudioStreamConfig(default_stream_id=0, bitrate=192000) video_stream_config = VideoStreamConfig(default_stream_id=0, bitrate=512000, profile='Main', preset='premium', height=480, width=640) encoding_profile = EncodingProfile( name='API Test Profile', video_stream_configs=[video_stream_config], audio_stream_configs=[audio_stream_config], segment_length=2) self.encoding_profile = create_encoding_profile(encoding_profile) self.manifests = ['m3u8', 'mpd']
def setUp(self): super(TransferJobToS3TestCase, self).setUp() self.maxDiff = None input_url = test_video_url input = Input(input_url) self.input = create_input(input) audio_stream_config = AudioStreamConfig(default_stream_id=0, bitrate=192000) video_stream_config = VideoStreamConfig(default_stream_id=0, bitrate=512000, profile='Main', preset='premium', height=480, width=640) encoding_profile = EncodingProfile('API Test Profile', [video_stream_config], [audio_stream_config]) self.encoding_profile = create_encoding_profile(encoding_profile) self.manifests = ['m3u8', 'mpd'] job = Job( input_id=self.input.input_id, encoding_profile_id=self.encoding_profile.encoding_profile_id, manifest_types=self.manifests, speed='standard' ) self.job = create_job(job) self.s3_configuration = { 'name': 'Python API Test Output', 'host': s3_output_config.get('host', None), 'access_key': s3_output_config.get('access_key', None), 'secret_key': s3_output_config.get('secret_key', None), 'bucket': s3_output_config.get('bucket', None), 'prefix': s3_output_config.get('prefix', None), 'region': s3_output_config.get('region', None), 'make_public': False } output = S3Output( name=self.s3_configuration.get('name'), host=self.s3_configuration.get('host'), access_key=self.s3_configuration.get('access_key'), secret_key=self.s3_configuration.get('secret_key'), bucket=self.s3_configuration.get('bucket'), prefix=self.s3_configuration.get('prefix'), region=self.s3_configuration.get('region'), make_public=self.s3_configuration.get('make_public') ) self.output = create_output(output)
def runTest(self): audio_stream_config = AudioStreamConfig(default_stream_id=0, bitrate=192000) video_stream_config = VideoStreamConfig(default_stream_id=1, bitrate=512000, profile='Main', preset='premium', height=480, width=640) watermark_config = WatermarkConfig( image_url= 'http://bitdash-a.akamaihd.net/webpages/bitcodin/images/bitcodin-bitmovin-logo-small.png', bottom=200, right=100) encoding_profile = EncodingProfile( name='API Test Profile', video_stream_configs=[video_stream_config], audio_stream_configs=[audio_stream_config], watermark_config=watermark_config) result = create_encoding_profile(encoding_profile) self.encoding_profile = result self.assertEquals(result.name, 'API Test Profile') self.assertEquals(result.video_stream_configs[0].default_stream_id, 1) self.assertEquals(result.video_stream_configs[0].bitrate, 512000) self.assertEquals(result.video_stream_configs[0].profile, 'Main') self.assertEquals(result.video_stream_configs[0].preset.lower(), 'premium') self.assertEquals(result.video_stream_configs[0].height, 480) self.assertEquals(result.video_stream_configs[0].width, 640) self.assertEquals(result.audio_stream_configs[0].default_stream_id, 0) self.assertEquals(result.audio_stream_configs[0].bitrate, 192000) self.assertEquals( result.watermark_config.image, 'http://bitdash-a.akamaihd.net/webpages/bitcodin/images/bitcodin-bitmovin-logo-small.png' ) self.assertEquals(result.watermark_config.bottom, 200) self.assertEquals(result.watermark_config.right, 100)
def setUp(self): output = GCSOutput(name='Python Live GCS Output', access_key=gcs_output_config.get('accessKey'), secret_key=gcs_output_config.get('secretKey'), bucket=gcs_output_config.get('bucket'), prefix=gcs_output_config.get('prefix'), make_public=False) self.output = bitcodin.create_output(output) audio_stream_config = AudioStreamConfig(default_stream_id=0, bitrate=192000) video_stream_config = VideoStreamConfig(default_stream_id=1, bitrate=512000, profile='Main', preset='premium', height=480, width=640) encoding_profile = EncodingProfile('API Live Test Profile', [video_stream_config], [audio_stream_config]) self.encoding_profile = create_encoding_profile(encoding_profile) super(CreateLiveStreamTestCase, self).setUp()
def setUp(self): super(CreateJobAzureInputTestCase, self).setUp() input = AzureInput(account_name=azure_input_config.get('accountName'), account_key=azure_input_config.get('accountKey'), container=azure_input_config.get('container'), url=azure_input_config.get('url')) self.input = create_input(input) audio_stream_config = AudioStreamConfig(default_stream_id=0, bitrate=192000) video_stream_config = VideoStreamConfig(default_stream_id=0, bitrate=512000, profile='Main', preset='premium', height=480, width=640) encoding_profile = EncodingProfile('API Test Profile', [video_stream_config], [audio_stream_config]) self.encoding_profile = create_encoding_profile(encoding_profile) self.manifests = ['m3u8', 'mpd']
def setUp(self): super(CreateJobHLSEncryptionTestCase, self).setUp() input_url = test_video_url input = Input(input_url) self.input = create_input(input) audio_stream_config = AudioStreamConfig(default_stream_id=0, bitrate=192000) video_stream_config = VideoStreamConfig(default_stream_id=0, bitrate=512000, profile='Main', preset='premium', height=480, width=640) encoding_profile = EncodingProfile('API Test Profile', [video_stream_config], [audio_stream_config]) self.encoding_profile = create_encoding_profile(encoding_profile) self.manifests = ['m3u8', 'mpd'] self.hls_encryption_config = HLSEncryptionConfig( key='cab5b529ae28d5cc5e3e7bc3fd4a544d', method='SAMPLE-AES', iv='08eecef4b026deec395234d94218273d')
def setUp(self): super(CreateJobWidevineDrmInvalidConfigTestCase, self).setUp() input_url = test_video_url input = Input(input_url) self.input = create_input(input) audio_stream_config = AudioStreamConfig(default_stream_id=0, bitrate=192000) video_stream_config = VideoStreamConfig(default_stream_id=0, bitrate=512000, profile='Main', preset='premium', height=480, width=640) encoding_profile = EncodingProfile('API Test Profile', [video_stream_config], [audio_stream_config]) self.encoding_profile = create_encoding_profile(encoding_profile) self.manifests = ['m3u8', 'mpd'] self.drm_config = WidevineDrmConfig(provider=None, signing_key=None, signing_iv=None, request_url=None, content_id=None, method=None)
def setUp(self): super(CreateJobS3InputTestCase, self).setUp() input = S3Input(access_key=s3_input_config.get('access_key'), secret_key=s3_input_config.get('secret_key'), host=s3_input_config.get('host'), bucket=s3_input_config.get('bucket'), region=s3_input_config.get('region'), object_key=s3_input_config.get('object_key')) self.input = create_input(input) audio_stream_config = AudioStreamConfig(default_stream_id=0, bitrate=192000) video_stream_config = VideoStreamConfig(default_stream_id=0, bitrate=512000, profile='Main', preset='premium', height=480, width=640) encoding_profile = EncodingProfile('API Test Profile', [video_stream_config], [audio_stream_config]) self.encoding_profile = create_encoding_profile(encoding_profile) self.manifests = ['m3u8', 'mpd']