def setUp(self):
        super(TransferJobToFTPTestCase, self).setUp()
        self.maxDiff = None

        inputUrl = 'http://eu-storage.bitcodin.com/inputs/Sintel.2010.720p.mkv'
        input = Input(inputUrl)
        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='standard', 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(self.input.input_id, self.encoding_profile.encoding_profile_id, self.manifests)
        self.job = create_job(job)
        self.ftp_configuration = {
            'name': 'Python API Test FTP Output',
            'host': ftp_config.get('host', None),
            'username': ftp_config.get('username', None),
            'password': ftp_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 test_create_job(self):
        input_obj = bitcodin.Input(url="http://eu-storage.bitcodin.com/inputs/Sintel.2010.720p.mkv")
        input_result = bitcodin.create_input(input_obj)

        video_configs = list()
        video_config1 = bitcodin.VideoStreamConfig(
            default_stream_id=0, bitrate=1024000, profile="Main", preset="standard", height=768, width=1024
        )
        video_config2 = bitcodin.VideoStreamConfig(
            default_stream_id=1, bitrate=512000, profile="Main", preset="standard", height=480, width=640
        )
        video_configs.append(video_config1)
        video_configs.append(video_config2)

        audio_configs = list()
        audio_config = bitcodin.AudioStreamConfig(default_stream_id=0, bitrate=192000)
        audio_configs.append(audio_config)

        encoding_profile = bitcodin.EncodingProfile("API Test Profile", video_configs, audio_configs)
        encoding_profile_result = bitcodin.create_encoding_profile(encoding_profile)

        manifests = ["mpd", "m3u8"]

        job = bitcodin.Job(input_result.input_id, encoding_profile_result.encoding_profile_id, manifests)

        job_result = bitcodin.create_job(job)
        self.assertEqual(job_result.status, "Enqueued")
Exemplo n.º 4
0
    def test_create_job(self):
        input_obj = bitcodin.Input(url='http://users.skynet.be/fa046054/home/P22/track12.mp3')
        input_result = bitcodin.create_input(input_obj)

        video_configs = list()
        video_config1 = bitcodin.VideoStreamConfig(default_stream_id=0, bitrate=1024000, profile='Main',
                                                   preset='standard', height=768, width=1024)
        video_config2 = bitcodin.VideoStreamConfig(default_stream_id=1, bitrate=512000, profile='Main',
                                                   preset='standard', height=480, width=640)
        video_configs.append(video_config1)
        video_configs.append(video_config2)

        audio_configs = list()
        audio_config = bitcodin.AudioStreamConfig(default_stream_id=0, bitrate=192000)
        audio_configs.append(audio_config)

        encoding_profile = bitcodin.EncodingProfile('API Test Profile', [], audio_configs)
        encoding_profile_result = bitcodin.create_encoding_profile(encoding_profile)

        manifests = ['mpd', 'm3u8']

        job = bitcodin.Job(input_result.input_id, encoding_profile_result.encoding_profile_id, manifests, 'standard')

        job_result = bitcodin.create_job(job)
        self.assertEqual(job_result.status, 'Enqueued')
    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)
Exemplo n.º 6
0
    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(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)
Exemplo n.º 8
0
    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)
Exemplo n.º 9
0
 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(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=['m3u8', 'invalid']
     )
     with self.assertRaises(BitcodinBadRequestError):
         result = 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,
         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,
         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(self.input.input_id,
               self.encoding_profile.encoding_profile_id, self.manifests,
               'standard', self.drm_config)
     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)
Exemplo n.º 15
0
 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,
         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)
Exemplo n.º 18
0
 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):
     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)
Exemplo n.º 20
0
 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)
Exemplo n.º 21
0
 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):
     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',
         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 = bitcodin.Job(
         input_id=self.input.input_id,
         encoding_profile_id=self.encoding_profile.encoding_profile_id,
         manifest_types=self.manifests,
         speed='standard',
         merge_audio_channel_configs=self.merge_audio_channel_configs,
         audio_meta_data=self.audio_meta_data
     )
     self.job = bitcodin.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 setUp(self):
     super(GetJobListTestCase, self).setUp()
     inputUrl = "http://eu-storage.bitcodin.com/inputs/Sintel.2010.720p.mkv"
     input = Input(inputUrl)
     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="standard", 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(self.input.input_id, self.encoding_profile.encoding_profile_id, 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=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,
         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)
Exemplo n.º 28
0
 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 setUp(self):
        super(TransferJobToNonExistentOutputTestCase, self).setUp()
        self.maxDiff = None

        inputUrl = 'http://eu-storage.bitcodin.com/inputs/Sintel.2010.720p.mkv'
        input = Input(inputUrl)
        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='standard', 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(self.input.input_id, self.encoding_profile.encoding_profile_id, 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=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 setUp(self):
     super(GetJobListTestCase, 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']
     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)
Exemplo n.º 32
0
 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)
Exemplo n.º 33
0
    def test_create_drm_job(self):
        input_obj = bitcodin.Input(url="http://eu-storage.bitcodin.com/inputs/Sintel.2010.720p.mkv")
        input_result = bitcodin.create_input(input_obj)

        video_configs = list()
        video_config1 = bitcodin.VideoStreamConfig(
            default_stream_id=0, bitrate=1024000, profile="Main", preset="standard", height=768, width=1024
        )
        video_config2 = bitcodin.VideoStreamConfig(
            default_stream_id=1, bitrate=512000, profile="Main", preset="standard", height=480, width=640
        )
        video_configs.append(video_config1)
        video_configs.append(video_config2)

        audio_configs = list()
        audio_config = bitcodin.AudioStreamConfig(default_stream_id=0, bitrate=192000)
        audio_configs.append(audio_config)

        encoding_profile = bitcodin.EncodingProfile("API Test Profile", video_configs, audio_configs)
        encoding_profile_result = bitcodin.create_encoding_profile(encoding_profile)

        manifests = ["mpd", "m3u8"]

        drm_config = bitcodin.DrmConfig(
            system="widevine",
            provider="widevine_test",
            signing_key="1ae8ccd0e7985cc0b6203a55855a1034afc252980e970ca90e5202689f947ab9",
            signing_iv="d58ce954203b7c9a9a9d467f59839249",
            request_url="http://license.uat.widevine.com/cenc/getcontentkey",
            content_id="746573745f69645f4639465043304e4f",
            method="mpeg_cenc",
        )

        job = bitcodin.Job(
            input_id=input_result.input_id,
            encoding_profile_id=encoding_profile_result.encoding_profile_id,
            manifest_types=manifests,
            speed="standard",
            drm_config=drm_config,
        )

        job_result = bitcodin.create_job(job)
        self.assertEqual(job_result.status, "Enqueued")
    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)
encoding_profile_obj = bitcodin.EncodingProfile(
    name='API Test Profile',
    video_stream_configs=video_configs,
    audio_stream_configs=audio_configs)
encoding_profile_result = bitcodin.create_encoding_profile(
    encoding_profile_obj)

manifests = ['mpd', 'm3u8']

job = bitcodin.Job(
    input_id=input_result.input_id,
    encoding_profile_id=encoding_profile_result.encoding_profile_id,
    manifest_types=manifests,
    speed='standard',
    deinterlace=True)

try:
    job_result = bitcodin.create_job(job)
except Exception, e:
    print('Could not start job: %s' % e.message)
    print('API Response: %s' % e.error)
    sys.exit()

while job_result.status != 'Finished' and job_result.status != 'Error':
    job_result = bitcodin.get_job(job_result.job_id)
    print(job_result.to_json())
    sleep(5)

print(job_result.to_json())
print("Job Finished!")
audio_configs = [
    bitcodin.AudioStreamConfig(default_stream_id=0, bitrate=192000),
    bitcodin.AudioStreamConfig(default_stream_id=1, bitrate=192000)
]

encoding_profile_obj = bitcodin.EncodingProfile('API Test Profile Closed Captions', video_configs, audio_configs)
encoding_profile_result = bitcodin.create_encoding_profile(encoding_profile_obj)

manifests = ['mpd', 'm3u8']

audio_meta_data = [
    bitcodin.AudioMetaData(0, 'Spanish', 'es'),
    bitcodin.AudioMetaData(1, 'English', 'en')
]

video_meta_data = [
    bitcodin.VideoMetaData(0, 'Spanish', 'es')
]

job = bitcodin.Job(
    input_id=input_result.input_id,
    encoding_profile_id=encoding_profile_result.encoding_profile_id,
    manifest_types=manifests,
    speed='standard',
    extract_closed_captions=True,
    audio_meta_data=audio_meta_data,
    video_meta_data=video_meta_data
)

job_result = bitcodin.create_job(job)
 def runTest(self):
     job = Job(self.input.input_id, self.encoding_profile.encoding_profile_id, [])
     with self.assertRaises(BitcodinBadRequestError):
         result = create_job(job)