Difference between revisions of "MediaConch workflow"

From Archivematica
Jump to navigation Jump to search
Line 1: Line 1:
 
This page describes some sample workflows for using MediaConch as a validation tool within Archivematica. This is supported in Archivematica 1.7 and higher.
 
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 =
+
=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).
 
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 =
+
=Policy check on original files=
  
 
Users can use [https://mediaarea.net/MediaConchOnline/ 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.
 
Users can use [https://mediaarea.net/MediaConchOnline/ 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.
 +
 +
==Steps==
  
 
1. Ensure that the Archivematica processing configuration is set to Perform Policy Checks on originals.
 
1. Ensure that the Archivematica processing configuration is set to Perform Policy Checks on originals.
Line 66: Line 68:
 
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.
 
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 =
+
=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.
 
As above, you can check preservation and access derivatives created by Archivematica or through manual normalization against a local policy.
 +
 +
==Steps==
  
 
1. Ensure that the Archivematica processing configuration is set to Perform Policy Checks on preservation derivatives and/or Perform Policy Checks on access derivatives.
 
1. Ensure that the Archivematica processing configuration is set to Perform Policy Checks on preservation derivatives and/or Perform Policy Checks on access derivatives.
  
2. In the Preservation Planning tab, as in 2 above, create or replace a command to run the policy you have created using MediaConch.
+
2. In the Preservation Planning tab, as in Policy checks on original files above, create or replace a command to run the policy you have created using MediaConch.
  
 
3. As above, also create a rule or rules to run your command on the format(s) in question, with the purpose Validation against a Policy.
 
3. As above, also create a rule or rules to run your command on the format(s) in question, with the purpose Validation against a Policy.

Revision as of 17:24, 27 April 2017

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.

Steps

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>
</policy>
""".strip()

# Valuate this constant with the name of the policy.
POLICY_NAME = 'NYULib_MKVFFV1_MODIFIED.xml'

if __name__ == '__main__':
    target = sys.argv[1]
    policy_checker = MediaConchPolicyCheckerCommand(
        policy=POLICY,
        policy_file_name=POLICY_NAME)
    sys.exit(policy_checker.check(target))

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="*"/>
</policy>

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.

Steps

1. Ensure that the Archivematica processing configuration is set to Perform Policy Checks on preservation derivatives and/or Perform Policy Checks on access derivatives.

2. In the Preservation Planning tab, as in Policy checks on original files above, create or replace a command to run the policy you have created using MediaConch.

3. As above, also create a rule or rules to run your command on the format(s) in question, with the purpose Validation against a Policy.