Package: clairmeta
ClairMetaClairMeta is a python package for Digital Cinema Package (DCP) probing
and checking.FeaturesDCP Probe:Metadata extraction of the whole DCP, including all XML fields and MXF
assets inspection.DCP Checker:SMPTE / Interop standard conventionIntegrity (MIME type, size, hash) of all assetsForeign file identificationXSD Schema validation for XML files (VOLINDEX, ASSETMAP, CPL, PKL)Digital signature validation (CPL, PKL)Intra / Inter Reels integrity and coherenceMetadata match between CPL assets and MXF headersRe-link VF / OVPicture tests : FrameRate, BitRateSound tests : Channels, SamplingSubtitle : Deep inspection of Interop and SMPTE subtitlesDSM / DCDM Checker:Basic image file sequence validation with some specific rules.InstallationRequirements:Python: 3.8 or laterPlatform: Windows (with limitations), macOS, LinuxExternal (non-python) dependencies:asdcplibmediainfo (opt)sox (opt)Install from PyPI package (this does not install external dependencies):pipinstallclairmetaIf you need help installing the external dependencies, you can have a look at
our continuous integration system, specifically the.githubfolder.UsageGeneralAs a command line tool:# Probingpython3-mclairmeta.cliprobe-typedcppath/to/dcppython3-mclairmeta.cliprobe-typedcppath/to/dcp-formatjson>dcp.jsonpython3-mclairmeta.cliprobe-typedcppath/to/dcp-formatxml>dcp.xml# Checkingpython3-mclairmeta.clicheck-typedcppath/to/dcppython3-mclairmeta.clicheck-typedcppath/to/dcp-formatjson>check.jsonpython3-mclairmeta.clicheck-typedcppath/to/dcp-formatxml>check.xmlpython3-mclairmeta.clicheck-typedcppath/to/dcp-kdm/path/to/kdm-key/path/to/privatekeypython3-mclairmeta.clicheck-typedcppath/to/dcp-progresspython3-mclairmeta.clicheck-typedcppath/to/dcp_vf-ovpath/to/dcp_ovAs a python library:fromclairmetaimportDCPdcp=DCP("path/to/dcp")dcp.parse()status,report=dcp.check()# Check DCP VF against OVstatus,report=dcp.check(ov_path="/path/to/dcp_ov")# DCP check with console progression reportfromclairmeta.utils.fileimportConsoleProgressstatus,report=dcp.check(hash_callback=ConsoleProgress())# Alternatives# - function matching utils.file.ConsoleProgress.__call__ signature# - derived class from utils.file.ConsoleProgressProfilesCheck profile allow custom configuration of the DCP check process such
as bypassing some unwanted tests or error level specification. To
implement a check profile, simply write a JSON file derived from this
template (actual content listed below is for demonstration purposes only):criticalitykey allow custom criteria level specification, check
name can be incomplete to quickly ignore a bunch of tests,defaultis
used if no other match where found.bypasskey allow specific test bypass, incomplete names are not allowed.allowed_foreign_fileskey specify files that are allowed in the DCP
folder and should not trigger the foreign file check.{"criticality":{"default":"ERROR","check_dcnc_":"WARNING","check_cpl_reel_duration_picture_subtitles":"WARNING","check_picture_cpl_avg_bitrate":"WARNING","check_picture_cpl_resolution":"WARNING"},"bypass":["check_assets_pkl_hash"],"allowed_foreign_files":["md5.md5"]}Custom profile check:python3-mclairmeta.clicheck-typedcppath/to/dcp-profilepath/to/profile.jsonfromclairmetaimportDCPfromclairmeta.profileimportload_profiledcp=DCP("path/to/dcp")profile=load_profile("/path/to/profile.json")status,report=dcp.check(profile=profile)LoggingLogging is customizable, see thesettings.pyfile or below. By default
ClairMeta logs to stdout and a rotated log file.'level':'INFO'# Minimum log level'enable_console':True# Enable / Disable stdout logging'enable_file':True# Enable / Disable file logging'file_name':'/log/path/clairmeta.log'# Log file absolute path'file_size':1e6# Individual log file maximum size'file_count':10# Number of files to rotate onContributingTo setup your environment follow these steps:gitclonehttps://github.com/Ymagis/ClairMeta.gitcdclairmetagitclonehttps://github.com/Ymagis/ClairMeta_Datatests/resourcespip3installpoetrypoetryinstallpoetryshell# Code... and testspytest--doctest-modulesOpen a Pull RequestOpen an IssueChangesThe release changes are available on Github:https://github.com/Ymagis/ClairMeta/releasesReferencesThe following sources / software were used:asdcp-lib:http://www.cinecert.com/asdcplib/sox:http://sox.sourceforge.net/mediainfo:https://mediaarea.net/SMPTE Digital Cinema standards:https://www.smpte.org/Interop Digital Cinema specifications:https://cinepedia.com/interop/Digital Cinema Initiative specifications:http://www.dcimovies.com/specification/index.htmlISDCF Naming Convention:http://isdcf.com/dcnc/Texas Instrument Digital Cinema Subtitles specificationsAbouthttp://www.ymagis.com/