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(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(AutoTransferJobToS3TestCase, 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.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 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='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)
    def setUp(self):
        super(CreateJobWithDeinterlacing, 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]
        )
        self.encoding_profile = create_encoding_profile(encoding_profile)
        self.manifests = ['m3u8', 'mpd']
    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']
示例#7
0
 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(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(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(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(CreateJobDrmTestCase, 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']
     self.drm_config = 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')
示例#12
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)
    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")
    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)
示例#15
0
    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
        ]
示例#16
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 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='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):
        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 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)
示例#21
0
    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(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)
示例#23
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)
示例#24
0
    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(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)
示例#26
0
 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,
            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(), '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)
    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(), '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.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(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(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)
        video_stream_config = VideoStreamConfig(default_stream_id=1, bitrate=512000,
                                                profile='', preset='', 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 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(CreateJobAudioOnlyTestCase, self).setUp()
     input_url = "http://bitbucketireland.s3.amazonaws.com/audiosample.mp3"
     input = Input(input_url)
     self.input = create_input(input)
     audio_stream_config = AudioStreamConfig(default_stream_id=0, bitrate=192000)
     encoding_profile = EncodingProfile('Audio Only Test Profile', [], [audio_stream_config])
     self.encoding_profile = create_encoding_profile(encoding_profile)
     self.manifests = ['m3u8', 'mpd']
 def setUp(self):
     super(CreateJobIncompleteDataTestCase, 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)
 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)
示例#36
0
    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(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 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 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):
        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(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)
示例#42
0
 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(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 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(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
     )
示例#46
0
 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 test_create_encoding_profile(self):

        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)

        self.assertEqual(encoding_profile_result.name, "API Test Profile")
    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)
示例#49
0
    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):
        super(CreateJobTestCase, self).setUp()
        input_url = 'http://bitbucketireland.s3.amazonaws.com/at_test/mono_streams.mkv'
        input = bitcodin.Input(input_url)
        self.input = bitcodin.create_input(input)

        audio_configs = [
            bitcodin.AudioStreamConfig(
                default_stream_id=0,
                bitrate=192000
            ),
            bitcodin.AudioStreamConfig(
                default_stream_id=1,
                bitrate=128000
            )
        ]

        video_stream_config = bitcodin.VideoStreamConfig(default_stream_id=0,
                                                         bitrate=512000,
                                                         profile='Main',
                                                         preset='premium',
                                                         height=480,
                                                         width=640)

        encoding_profile = bitcodin.EncodingProfile('API Merge Audio Multi Profile',
                                                    [video_stream_config],
                                                    audio_configs)

        self.encoding_profile = bitcodin.create_encoding_profile(encoding_profile)
        self.manifests = ['m3u8', 'mpd']

        merge_audio_channel_config12 = bitcodin.MergeAudioChannelConfig([1, 2])
        merge_audio_channel_config34 = bitcodin.MergeAudioChannelConfig([3, 4])

        self.merge_audio_channel_configs = [merge_audio_channel_config12, merge_audio_channel_config34]

        audio_meta_data12 = bitcodin.AudioMetaData(0, 'en', 'Channel 1 and 2 merged')
        audio_meta_data34 = bitcodin.AudioMetaData(1, 'en', 'Channel 3 and 4 merged')

        self.audio_meta_data = [audio_meta_data12, audio_meta_data34]
示例#51
0
 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):
        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']
示例#54
0
    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']
示例#55
0
 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)
    bitcodin.VideoStreamConfig(default_stream_id=0,
                               bitrate=500000,
                               profile='Main',
                               preset='premium',
                               height=272,
                               width=640))

audio_configs = [
    bitcodin.AudioStreamConfig(default_stream_id=0, bitrate=192000, rate=48000)
]

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)
                               bitrate=1000000,
                               profile='Main',
                               preset='premium',
                               height=480,
                               width=640))

# Configure audio representation
audio_configs = list()

# 256 kbps
audio_configs.append(
    bitcodin.AudioStreamConfig(default_stream_id=0, bitrate=256000))

live_profile = bitcodin.EncodingProfile('Live Stream profile', video_configs,
                                        audio_configs)
live_profile = bitcodin.create_encoding_profile(live_profile)

# Create live stream
stream_key = "stream"
time_shift = 120
live_stream = bitcodin.LiveStream("test live stream", stream_key,
                                  live_profile.encoding_profile_id, time_shift,
                                  output.output_id)

live_stream = bitcodin.create_live_instance(live_stream)

print(live_stream.to_json())

# Wait until live stream is running and ready

while live_stream.status != 'RUNNING':