Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 42 additions & 10 deletions src/apps/pyocioamf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,47 @@
pyocioamf
=========

**Work in progress**. Script to convert an ACES Metadata File (AMF) into OCIO's
native CTF file format. The CTF may then be used with any of the other OCIO tools
to process pixels.
Script to convert an ACES Metadata File (AMF) into OCIO's native CTF file format.
The CTF may then be used with any of the other OCIO tools to process pixels.

An example AMF file named ``example.amf`` is provided. It references the LUT file
``example_referenced_lut.clf``, which is in the Academy/ASC Common LUT Format (CLF).
**Supports both AMF v1.0 and v2.0** with automatic version detection.

Example files are provided:
- ``example.amf`` - AMF v1.0 format, references ``example_referenced_lut.clf``
- ``example_v2.amf`` - AMF v2.0 format

The referenced LUT file is in the Academy/ASC Common LUT Format (CLF).

Usage
-----

1. Install dependencies on ``PYTHONPATH``
2. Run ``python pyocioamf.py example.amf`` (or any other AMF file).
3. The CTF file will have the same name as the AMF file but with a .ctf extension, in
this case, ``example.ctf``.
Basic usage:

```bash
python pyocioamf.py example.amf
```

The CTF file will have the same name as the AMF file but with a .ctf extension.

### Command-Line Options

```bash
# Use a specific OCIO config file
python pyocioamf.py example.amf --config path/to/config.ocio

# Exclude specific components from conversion
python pyocioamf.py example.amf --no-idt # Exclude input transform
python pyocioamf.py example.amf --no-lmt # Exclude look transforms
python pyocioamf.py example.amf --no-odt # Exclude output transform
python pyocioamf.py example.amf --no-lmt --no-odt # Exclude multiple

# Split CTF generation for AMF v2.0 workingLocation marker
python pyocioamf.py example.amf --split-by-working-location
```

The ``--split-by-working-location`` option generates two CTF files:
- ``*_before.ctf``: IDT + look transforms before the workingLocation marker
- ``*_after.ctf``: Look transforms after the marker + ODT

Dependencies
------------
Expand All @@ -27,6 +54,11 @@ Dependencies
Implementation notes
--------------------

* Automatically detects AMF version (v1.0 or v2.0) from namespace URI or version attribute
* Supports both ASC CDL element naming conventions (``SOPNode``/``SatNode`` and ``ASC_SOP``/``ASC_SAT``)
* Uses a prototype ACES config ``config-aces-reference.yaml`` to interpret the
ACES Transform IDs encountered in the AMF file. This file should be in the
ACES Transform IDs encountered in the AMF file. This file should be in the
same directory as the script.
* Alternatively, use ``--config`` to specify a custom OCIO config file
* For OCIO 2.5+ configs, uses the ``amf_transform_ids`` interchange attribute for transform lookup
* For OCIO 2.1-2.4 configs, searches transform IDs in the description field
71 changes: 71 additions & 0 deletions src/apps/pyocioamf/example_v2.amf
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<aces:acesMetadataFile
xmlns:aces="urn:ampas:aces:amf:v2.0"
xmlns:cdl="urn:ASC:CDL:v1.01"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="2.0">
<aces:amfInfo>
<aces:description>Example Movie</aces:description>
<aces:author>
<aces:name>Foo Bar</aces:name>
<aces:emailAddress>Foobar@onset.com</aces:emailAddress>
</aces:author>
<aces:dateTime>
<aces:creationDateTime>2019-09-19T13:20:00</aces:creationDateTime>
<aces:modificationDateTime>2019-11-27T13:20:00Z</aces:modificationDateTime>
</aces:dateTime>
<aces:uuid>urn:uuid:afe122be-59d3-4360-ad69-33c10108fa7a</aces:uuid>
</aces:amfInfo>
<aces:clipId>
<aces:clipName>A001C012</aces:clipName>
<aces:sequence idx="#" min="1" max="240">A001_C012_AE0306_###.exr</aces:sequence>
</aces:clipId>
<aces:pipeline>
<aces:pipelineInfo>
<aces:description>Example Movie Final DI</aces:description>
<aces:dateTime>
<aces:creationDateTime>2019-09-19T13:20:00</aces:creationDateTime>
<aces:modificationDateTime>2019-11-27T13:20:00Z</aces:modificationDateTime>
</aces:dateTime>
<aces:uuid>urn:uuid:be6Ec2ea-a6DC-6cBC-ff0D-AfCED5FF3Dd8</aces:uuid>
<aces:systemVersion>
<aces:majorVersion>1</aces:majorVersion>
<aces:minorVersion>0</aces:minorVersion>
<aces:patchVersion>3</aces:patchVersion>
</aces:systemVersion>
</aces:pipelineInfo>
<aces:inputTransform applied="true">
<aces:description>IDT from Acme Camera Company</aces:description>
<aces:hash algorithm="http://www.w3.org/2001/04/xmlenc#sha256">1531ea6ef06c5b0a5bea80c94f60c7b68e3989e3c90b8ebd25c28aa4670c30f8</aces:hash>
<aces:transformId>urn:ampas:aces:transformId:v1.5:IDT.Acme.Camera.a1.v1</aces:transformId>
</aces:inputTransform>
<aces:lookTransform applied="true">
<aces:description>Technical Grade</aces:description>
<aces:cdlWorkingSpace>
<aces:fromCdlWorkingSpace>
<aces:transformId>urn:ampas:aces:transformId:v1.5:ACEScsc.Academy.ACEScct_to_ACES.a1.0.3</aces:transformId>
</aces:fromCdlWorkingSpace>
</aces:cdlWorkingSpace>
<cdl:ASC_SOP>
<cdl:Slope>2.0 2.0 2.0</cdl:Slope>
<cdl:Offset>0.1 0.1 0.1</cdl:Offset>
<cdl:Power>1 1 1</cdl:Power>
</cdl:ASC_SOP>
<cdl:ASC_SAT>
<cdl:Saturation>1</cdl:Saturation>
</cdl:ASC_SAT>
</aces:lookTransform>
<aces:outputTransform applied="false">
<aces:referenceRenderingTransform>
<aces:description>ACES v1.0.3 RRT</aces:description>
<aces:hash algorithm="http://www.w3.org/2001/04/xmlenc#sha256">c81af4fb4a22ee0353308e4582708951df4682bf73f838c24bf44e585fc3bb61</aces:hash>
<aces:transformId>urn:ampas:aces:transformId:v1.5:RRT.a1.0.3</aces:transformId>
</aces:referenceRenderingTransform>
<aces:outputDeviceTransform>
<aces:description>P3D60 ODT</aces:description>
<aces:hash algorithm="http://www.w3.org/2000/09/xmldsig#sha1">efd279a82c2d52ee8c49dc0793499dc86bb1a4a3fa0dfb420d59c2814c55aea6</aces:hash>
<aces:transformId>urn:ampas:aces:transformId:v1.5:ODT.Academy.P3D60_48nits.a1.0.3</aces:transformId>
</aces:outputDeviceTransform>
</aces:outputTransform>
</aces:pipeline>
</aces:acesMetadataFile>
Loading