MediaConch workflow

From Archivematica
Revision as of 21:26, 10 December 2018 by Ablewer (Talk | contribs)

Jump to: navigation, search

This page describes some sample workflows for using MediaConch as a validation tool within Archivematica. This is supported in Archivematica 1.7 and higher.


Validate Matroska files

In a standard Archivematica 1.7 installation and higher, without any changes to the Format Policy Registry, MediaConch will be used as the validation tool for Matroska (.mkv) files, to check the files against the format specification. This applies to both validation of original files in the Validation micro-service in Transfer, as well as validation of mkv files created by Archivematica during normalization (note that validation of normalized files is a new feature as of Archivematica 1.7).

Policy check on original files

Users can use MediaConch Online or a local installation of MediaConch to create a policy to check against files being ingested in Archivematica. Policies can include rules such as aspect ratios, bit rate, track information, etc. Policy checking is not restricted to mkv files- a policy can be created for any format which can be characterized by MediaInfo.


1. Ensure that the Archivematica processing configuration is set to Perform Policy Checks on originals.

2. In the Preservation Planning tab, click on Commands under Validation. You should see a sample policy called Check against policy PLACEHOLDER_FOR_POLICY_FILE_NAME using MediaConch. Either replace this command or create a new one using it as a template:

2.1 The default command text is:

import sys
from ammcpc import MediaConchPolicyCheckerCommand

# Valuate this constant with the text (XML) of the policy.
POLICY = """
<?xml version="1.0"?>
<policy type="and" name="NYULib_MKVFFV1_MODIFIED" license="CC-BY-SA-4.0+">
  <description>Attempt to re-implement the NYULibraries_MKVFFV1.xsl policy file of MediaConch XML v. 0.1 as a v. 0.3 .xml policy</description>
  <rule name="General Format equals Matroska" value="Format" tracktype="General" occurrence="*" operator="=">Matroska</rule>
  <rule name="Video Format is FFV1" value="Format" tracktype="Video" occurrence="*" operator="=">FFV1</rule>
  <rule name="Video CodecID equals FFV1" value="CodecID" tracktype="Video" occurrence="*" operator="=">V_MS/VFW/FOURCC / FFV1</rule>
  <rule name="Video Width equals 720 (pixels)" value="Width" tracktype="Video" occurrence="*" operator="=">720</rule>
  <rule name="Video Height equals 486 (pixels)" value="Height" tracktype="Video" occurrence="*" operator="=">486</rule>
  <rule name="Video DisplayAspectRatio equals 4:3 (1.333)" value="DisplayAspectRatio" tracktype="Video" occurrence="*" operator="=">1.333</rule>
  <rule name="Video ColorSpace equals YUV" value="ColorSpace" tracktype="Video" occurrence="*" operator="=">YUV</rule>
  <rule name="Video ChromaSubsampling equals 4:2:0" value="ChromaSubsampling" tracktype="Video" occurrence="*" operator="=">4:2:0</rule>
  <rule name="Video BitDepth equals 8 (bits)" value="BitDepth" tracktype="Video" occurrence="*" operator="=">8</rule>
  <rule name="Audio Format equals PCM" value="Format" tracktype="Audio" occurrence="*" operator="=">PCM</rule>
  <rule name="Audio Channels are greater or equal than 1" value="Channels" tracktype="Audio" occurrence="*" operator=">=">1</rule>
  <rule name="Audio SamplingRate is greater or equal than 48 kHz (48000)" value="SamplingRate" tracktype="Audio" occurrence="*" operator=">=">48000</rule>
  <rule name="Audio BitDepth is greater or equal than 16-bit" value="BitDepth" tracktype="Audio" occurrence="*" operator=">=">16</rule>

# Valuate this constant with the name of the policy.

if __name__ == '__main__':
    target = sys.argv[1]
    policy_checker = MediaConchPolicyCheckerCommand(

2.2 To use your own command, replace the xml within the command (between <policy> and </policy> with xml created by MediaConch when you created your own command. As an example, here's a very simple policy to check that a file is an mp4:

<policy type="and" name="Is_Mp4" license="CC-BY-SA-4.0+">
    <rule name="Is_MP4" value="Format" tracktype="General" occurrence="*" operator="=">MPEG-4</rule>
    <rule name="New Rule" occurrence="*"/>

3. Create a rule with the purpose Validation against a Policy, for the format you want to check, using the command you just created/edited.

Policy checks on preservation/access derivatives

As above, you can check preservation and access derivatives created by Archivematica or through manual normalization against a local policy.

Personal tools