Exemplo n.º 1
0
    def setup_dcp_link_ov(self):
        """ Setup the link VF to OV check and run for each assets . """
        if not self.ov_path:
            return

        self.run_check(self.check_link_ov_coherence)
        for cpl in self.dcp._list_cpl:
            for essence, asset in list_cpl_assets(cpl):
                self.run_check(self.check_link_ov_asset, asset, essence)
Exemplo n.º 2
0
    def run_checks(self):
        for cpl in self.dcp._list_cpl:
            checks = self.find_check('subtitle_cpl')
            assets = list_cpl_assets(cpl,
                                     filters='Subtitle',
                                     required_keys=['Path'])

            [self.run_checks_prepare(checks, cpl, asset) for asset in assets]

        return self.check_executions
Exemplo n.º 3
0
    def cpl_link_assets(self):
        """ Link assets for each reel with actual files in the package. """
        # TODO : For Multi CPL package, what to choose if there are both
        # OV / VF?
        self.package_type = 'OV'

        for cpl in self._list_cpl:
            for _, asset in list_cpl_assets(cpl):
                asset_id = asset['Id']
                if asset_id in self._list_asset:
                    asset['Path'] = self._list_asset[asset_id]
                else:
                    self.package_type = 'VF'
Exemplo n.º 4
0
    def run_checks(self):
        for source in self.dcp._list_cpl:

            asset_checks = self.find_check('atmos_cpl')
            [self.run_check(
                check, source, asset, message="{} (Asset {})".format(
                    source['FileName'], asset[1].get('Path', asset[1]['Id'])))
             for asset in list_cpl_assets(
                source, filters='AuxData', required_keys=['Probe'])
             if asset[1]['Schema'] == 'Atmos'
             for check in asset_checks]

        return self.check_executions
Exemplo n.º 5
0
    def run_checks(self):
        for source in self.dcp._list_cpl:
            asset_checks = self.find_check('atmos_cpl')
            [self.run_check(check, source, asset,
             stack=[
                 source['FileName'],
                 asset[1].get('Path') or asset[1]['Id']])
             for asset in list_cpl_assets(
                source, filters='AuxData', required_keys=['Probe'])
             if asset[1]['Schema'] == 'Atmos'
             for check in asset_checks]

        return self.checks
Exemplo n.º 6
0
    def run_checks(self):
        for source in self.dcp._list_cpl:
            checks = self.find_check('cpl')
            [self.run_check(check, source, message=source['FileName'])
             for check in checks]

            asset_checks = self.find_check('assets_cpl')
            [self.run_check(
                check, source, asset, message="{} (Asset {})".format(
                    source['FileName'], asset[1].get('Path', asset[1]['Id'])))
             for asset in list_cpl_assets(source)
             for check in asset_checks]

        return self.check_executions
Exemplo n.º 7
0
    def cpl_link_assets(self):
        """ Link assets for each reel with actual files in the package. """
        self.package_type = 'OV'

        for cpl in self._list_cpl:
            for _, asset in list_cpl_assets(cpl):
                asset_id = asset['Id']
                asset['Path'] = ''
                asset['AbsolutePath'] = ''

                if asset_id in self._list_asset:
                    asset['Path'] = self._list_asset[asset_id]
                    asset['AbsolutePath'] = os.path.join(
                        self.path, self._list_asset[asset_id])
                else:
                    self.package_type = 'VF'
Exemplo n.º 8
0
    def run_checks(self):
        for source in self.dcp._list_cpl:
            asset_stack = [source['FileName']]

            checks = self.find_check('cpl')
            [self.run_check(check, source, stack=asset_stack)
             for check in checks]

            asset_checks = self.find_check('assets_cpl')
            [self.run_check(check, source, asset,
             stack=asset_stack + [
                 asset[1].get('Path') or asset[1]['Id']])
             for asset in list_cpl_assets(source)
             for check in asset_checks]

        return self.checks
Exemplo n.º 9
0
    def run_checks(self):
        for cpl in self.dcp._list_cpl:
            assets = list_cpl_assets(
                cpl, filters=['Subtitle', 'ClosedCaption'],
                required_keys=['Path'])

            for asset in assets:
                stack = [cpl['FileName'], asset[1].get('Path', asset[1]['Id'])]

                checks = self.find_check('subtitle_dcp')
                [self.run_check(check, cpl, asset, stack=stack) for check in checks]

                checks = self.find_check('subtitle_cpl')
                self.run_checks_prepare(checks, cpl, asset)

        return self.checks
Exemplo n.º 10
0
    def run_checks(self):
        for source in self.dcp._list_cpl:
            asset_checks = self.find_check('sound_cpl')
            [
                self.run_check(check,
                               source,
                               asset,
                               stack=[
                                   source['FileName'], asset[1].get('Path')
                                   or asset[1]['Id']
                               ])
                for asset in list_cpl_assets(
                    source, filters='Sound', required_keys=['Probe'])
                for check in asset_checks
            ]

        return self.check_executions
Exemplo n.º 11
0
    def run_checks(self):
        for source in self.dcp._list_cpl:
            asset_stack = []

            asset_checks = self.find_check('picture_cpl')
            [
                self.run_check(check,
                               source,
                               asset,
                               stack=[
                                   source['FileName'],
                                   asset[1].get('Path', asset[1]['Id'])
                               ])
                for asset in list_cpl_assets(source, filters='Picture')
                for check in asset_checks
            ]

        return self.checks
Exemplo n.º 12
0
    def check_dcnc_field_claim_immersive_sound(self, playlist, fields):
        """ Immersive audio format imply Auxiliary track in CPL. """
        immersive = fields['AudioType'].get('ImmersiveSound')
        auxdatas = list(list_cpl_assets(playlist, filters=['AuxData']))

        if immersive and not auxdatas:
            self.error("ContentTitle claims immersive audio ({}) "
                       "but CPL have no Auxiliary tracks".format(immersive))

        if immersive and auxdatas:
            assets = [
                asset for _, asset in auxdatas
                if asset['Schema'].lower() == immersive.lower()
            ]

            if not assets:
                self.error("ContentTitle claims immersive audio ({})"
                           " but CPL is not".format(immersive))
Exemplo n.º 13
0
    def check_dcnc_field_claim_audio(self, playlist, fields):
        """ Audio format from CPL and ContentTitleText shall match. """
        # NOTE : MXF track count don't seems to be related to the actual
        # number of audio channels (there could be metadata and/or reserved
        # tracks).
        # TODO : SMPTE 428-12 add SoundField UL structure that could be used
        # to have a more meanigful check
        audio_format = fields['AudioType'].get('Channels')
        audio_map = DCP_SETTINGS['sound']['format_channels']
        sounds = list(
            list_cpl_assets(playlist,
                            filters=['Sound'],
                            required_keys=['Probe']))

        if sounds and audio_format:
            _, asset = sounds[0]
            asset_cc = asset['Probe']['ChannelCount']
            cpl_cc = audio_map.get(audio_format)

            if cpl_cc and asset_cc < cpl_cc:
                self.error(
                    "ContentTitle claims {} audio but CPL contains only "
                    " {} channels".format(audio_format, asset_cc))
Exemplo n.º 14
0
 def cpl_probe_assets(self):
     """ Probe mxf assets for each reel. """
     for cpl in self._list_cpl:
         for essence, asset in list_cpl_assets(cpl):
             asset_path = os.path.join(self.path, asset.get('Path', ''))
             cpl_probe_asset(asset, essence, asset_path)
Exemplo n.º 15
0
 def cpl_probe_assets(self):
     """ Probe mxf assets for each reel. """
     for cpl in self._list_cpl:
         for essence, asset in list_cpl_assets(cpl):
             asset_path = asset.get('AbsolutePath', '')
             cpl_probe_asset(asset, essence, asset_path)