数字电影包(DCP)探测和检查实用程序
clairmeta的Python项目详细描述
克莱尔梅塔
clairmeta是一个用于数字电影包(dcp)探测的python包 还有检查。
功能
- DCP探测:整个DCP的元数据提取,包括所有XML 字段和MXF资产检查。
- DCP检查器:高级DCP验证工具,包括(非
详尽):
- smpte/interop标准约定(命名,…)
- 所有资产的完整性(mime类型、大小、散列)
- 外来文件标识
- XML文件的XSD架构验证(volindex、assetmap、cpl、pkl)
- 数字签名验证(CPL,PKL)
- 卷内/卷间完整性和一致性
- cpl资产和mxf头之间的元数据匹配
- 重新链接vf/ov
- 图片测试:帧率、比特率,…
- 声音测试:声道,采样,…
- 字幕:深入检查互操作和smpte字幕
- dsm/dcdm检查器:基本图像文件序列验证 具体规则。
安装
要求:
- Python:
- 应该在Python2.7和Python3.3+上工作
- 测试时间:python 2.7、python 3.6
- 平台:
- 应该在Windows、MacOS、Linux上工作
- 测试时间:MacOS 10.12
- 外部(非python)依赖项:
- ASDCPLIB
- 媒体信息(可选)
- SOX(可选)
从pypi包安装(提醒:这不安装外部依赖项):
pip install clairmeta
从Debian软件包安装(将自动安装所有要求):
# Optional : add Bintray public key apt-get install dirmngr gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 379CE192D401AB61 gpg --export --armor 379CE192D401AB61 | apt-key add - # Add Clairmeta repository to apt sources # Replace <distro> appropriately # Ubuntu 14.04 : use trusty # Ubuntu 16.04 : use xenial # Ubuntu 17.04 : use artful # Ubuntu 18.04 : use bionic echo "deb https://dl.bintray.com/ymagis/Clairmeta <distro> main" | sudo tee /etc/apt/sources.list.d/clairmeta.list sudo apt-get update sudo apt-get install python3-clairmeta
使用量
概述
作为命令行工具:
python3 -m clairmeta.cli probe -type dcp path/to/dcp python3 -m clairmeta.cli probe -type dcp path/to/dcp -format json > dcp.json python3 -m clairmeta.cli probe -type dcp path/to/dcp -format xml > dcp.xml python3 -m clairmeta.cli check -type dcp path/to/dcp python3 -m clairmeta.cli check -type dcp path/to/dcp -kdm /path/to/kdm -key /path/to/privatekey python3 -m clairmeta.cli check -type dcp path/to/dcp -progress
作为一个python库:
from clairmeta import DCP dcp = DCP("path/to/dcp") # Parse DCP dcp.parse() # Check DCP status, report = dcp.check() # Check DCP VF against OV status, report = dcp.check(ov_path="/path/to/dcp_ov") # Check DCP with console progression report from clairmeta.utils.file import console_progress_bar status, report = dcp.check(hash_callback=console_progress_bar)
配置文件
检查配置文件允许自定义DCP检查进程的配置,例如 绕过一些不需要的测试或标准规范。到 实现一个check配置文件,只需编写一个json文件 模板(下面列出的实际内容仅用于演示):
- criticality键允许自定义条件级别规范,检查 名称可能不完整,无法快速忽略一堆测试,default 如果找不到其他匹配项,则使用。
- bypass键允许特定测试 不允许绕过不完整的名称。
{ "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"] }
自定义配置文件检查:
python3 -m clairmeta.cli check -type dcp path/to/dcp -profile path/to/profile.json
from clairmeta import DCP from clairmeta.profile import load_profile dcp = DCP("path/to/dcp") profile = load_profile("/path/to/profile.json") status, report = dcp.check(profile=profile)
日志记录
日志记录是可自定义的,请参阅settings.py文件或下面的文件。默认情况下克莱尔梅塔 记录到stdout和一个旋转的日志文件。
'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 on
贡献
- 要设置您的环境,请使用pipenv:
pip install pipenv git clone https://github.com/Ymagis/ClairMeta.git cd clairmeta pipenv install --dev [–two] pipenv check # Enter virtual environment pipenv shell # Code... # Get tests resources git clone https://github.com/Ymagis/ClairMeta_Data tests/resources # Run tests nosetests --nocapture --with-doctest --doctest-options=+ELLIPSIS --with-coverage --cover-package=clairmeta # Leave virtual environment exit
- 打开拉取请求
- 打开问题
变化
github上提供了版本更改: https://github.com/Ymagis/ClairMeta/releases
参考文献
使用了以下源/软件:
- asdcp库:http://www.cinecert.com/asdcplib/
- 索克斯:http://sox.sourceforge.net/
- 媒体信息:https://mediaarea.net/
- SMPTE数字电影标准:https://www.smpte.org/
- Interop数字影院规范:https://cinepedia.com/interop/
- 数字电影倡议规范:http://www.dcimovies.com/specification/index.html
- isdcf命名约定:http://isdcf.com/dcnc/
- 德州仪器数字电影字幕规范