def check_assets_cpl_metadata(self, playlist, asset): """ CPL assets metadata coherence with MXF tracks. """ _, asset = asset # This a correspondance table between CPL and MXF tags metadata_map = { 'EditRate': 'EditRate', 'FrameRate': 'SampleRate', 'Encrypted': 'EncryptedEssence', 'IntrinsicDuration': 'ContainerDuration', 'ScreenAspectRatio': 'AspectRatio', 'Id': 'AssetUUID', 'KeyId': 'CryptographicKeyID', } if 'Probe' in asset: for k, v in six.iteritems(metadata_map): if k in asset and v in asset['Probe']: cpl_val = asset[k] mxf_val = asset['Probe'][v] is_float = type(cpl_val) is float or type(mxf_val) is float matching = is_float and compare_ratio(cpl_val, mxf_val) matching = matching or not is_float and cpl_val == mxf_val if not matching: raise CheckException( "{} metadata mismatch, CPL claims {} but MXF {}" .format(k, cpl_val, mxf_val)) if k in asset and v not in asset['Probe']: raise CheckException("Missing MXF Metadata {}".format(v)) if k not in asset and v in asset['Probe']: raise CheckException("Missing CPL Metadata {} for asset {}" "".format(k))
def check_picture_cpl_archival_framerate(self, playlist, asset): """ Picture archival framerate. """ _, asset = asset editrate = asset['EditRate'] archival_editrates = self.settings['editrates_archival'] for archival_editrate in archival_editrates: if compare_ratio(editrate, archival_editrate): raise CheckException( "Archival EditRate {} may not play safely on all hardware". format(editrate))
def check_picture_cpl_archival_framerate(self, playlist, asset): """ Picture archival framerate. Reference : SMPTE 428-21-2011 5 D-Cinema FAQs release FIAF 2012 1.1 5 """ _, asset = asset editrate = asset['EditRate'] archival_editrates = self.settings['editrates_archival'] for archival_editrate in archival_editrates: if compare_ratio(editrate, archival_editrate): raise CheckException( "Archival EditRate {} may not play safely on all hardware". format(editrate))
def check_picture_cpl_archival_framerate(self, playlist, asset): """ Picture archival framerate. References: SMPTE ST 428-21:2011 5 FIAF D-Cinema Equipment Frequently Asked Questions (v1.1) 5 https://www.fiafnet.org/images/tinyUpload/E-Resources/Commission-And-PIP-Resources/TC_resources/D-Cinema%20FAQs%20release%20FIAF%202012%20V1.1.pdf """ _, asset = asset editrate = asset['EditRate'] archival_editrates = self.settings['editrates_archival'] for archival_editrate in archival_editrates: if compare_ratio(editrate, archival_editrate): self.error( "Archival EditRate {} may not play safely on all hardware". format(editrate))