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 runTest(self): job = Job( input_id=self.input.input_id, encoding_profile_id=self.encoding_profile.encoding_profile_id, manifest_types=['m3u8', 'invalid']) with self.assertRaises(BitcodinBadRequestError): result = create_job(job)
def setUp(self): super(TransferJobToFTPTestCase, 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) 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(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 runTest(self): job = Job( input_id=self.input.input_id, encoding_profile_id=self.encoding_profile.encoding_profile_id, manifest_types=self.manifests, output_id=self.output.output_id) self.job = create_job(job) self.wait_until_job_finished(self.job.job_id)
def runTest(self): job = Job( input_id=self.input.input_id, encoding_profile_id=self.encoding_profile.encoding_profile_id, manifest_types=self.manifests, speed='standard', drm_config=self.drm_config) with self.assertRaises(BitcodinBadRequestError): self.job = create_job(job)
def runTest(self): 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) self.assertEquals(self.job.input.input_id, job.inputId) self.assertEquals(self.job.input.url, self.input.url) self.assertEquals(self.job.encoding_profiles[0].encoding_profile_id, job.encodingProfileId) self.wait_until_job_finished(self.job.job_id)
def runTest(self): 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.assertEquals(self.job.input.input_id, job.inputId) self.assertEquals(self.job.input.url, self.input.url) self.assertEquals(self.job.encoding_profiles[0].encoding_profile_id, job.encodingProfileId) self.assertEquals(len(self.job.input.media_configurations), 0) self.wait_until_job_finished(self.job.job_id)
def runTest(self): self.assertEqual(self.encoding_profile.segment_length, 2) 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.assertEquals(self.job.input.input_id, job.inputId) self.assertEquals(self.job.input.url, self.input.url) self.assertEquals(self.job.encoding_profiles[0].encoding_profile_id, job.encodingProfileId) self.wait_until_job_finished(self.job.job_id)
def runTest(self): job = Job( input_id=self.input.input_id, encoding_profile_id=self.encoding_profile.encoding_profile_id, manifest_types=self.manifests, speed='standard', deinterlace=True) self.job = create_job(job) self.assertEquals(self.job.input.input_id, job.inputId) self.assertEquals(self.job.input.url, self.input.url) self.assertEquals(self.job.encoding_profiles[0].encoding_profile_id, job.encodingProfileId) self.assertEquals(self.job.deinterlace, job.deinterlace) self.wait_until_job_finished(self.job.job_id)
def runTest(self): 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) self.assertEquals(self.job.input.input_id, job.inputId) self.assertEquals(self.job.input.url, self.input.url) self.assertEquals(self.job.encoding_profiles[0].encoding_profile_id, job.encodingProfileId) thumbnail_request = ThumbnailRequest(job_id=self.job.job_id, height=320, position=30) thumbnail = create_thumbnail(thumbnail_request) self.assertNotEqual(thumbnail.thumbnail_url, None)
def runTest(self): 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.assertEquals(self.job.input.input_id, job.inputId) self.assertEquals(self.job.input.url, self.input.url) self.assertEquals(self.job.encoding_profiles[0].encoding_profile_id, job.encodingProfileId) self.assertEquals(self.encoding_profile.cropping_config.top, 100) self.assertEquals(self.encoding_profile.cropping_config.bottom, 100) self.assertEquals(self.encoding_profile.cropping_config.left, 5) self.assertEquals(self.encoding_profile.cropping_config.right, 50) self.wait_until_job_finished(self.job.job_id)
def runTest(self): 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.assertEquals(self.job.input.input_id, job.inputId) self.assertEquals(self.job.input.url, self.input.url) self.assertEquals( self.encoding_profile.watermark_config.image, 'http://bitdash-a.akamaihd.net/webpages/bitcodin/images/bitcodin-bitmovin-logo-small.png' ) self.assertEquals(self.encoding_profile.watermark_config.bottom, 200) self.assertEquals(self.encoding_profile.watermark_config.right, 100) self.assertEquals(self.job.encoding_profiles[0].encoding_profile_id, job.encodingProfileId) self.wait_until_job_finished(self.job.job_id)
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)