Skip to content

Parsers

This module contains the internal parsing functions that convert binary chunk data into Python dataclasses.

Main Parser

parse

Parse an After Effects (.aep) project file and return an Application instance.

This is the main entry point for the library. It parses the binary RIFX data and returns an Application object whose project attribute holds the full project tree.

Parameters:

Example
import aep_parser

app = aep_parser.parse("project.aep")
project = app.project
print(app.version)

parse_app

parse_app(aep: Aep, project: Project) -> Application

Build an Application from the parsed RIFX data and project.

Parameters:

  • aep

    (Aep) –

    The parsed Kaitai RIFX structure.

  • project

    (Project) –

    The already-parsed Project.

parse_project

parse_project(
    aep_file_path: str | PathLike[str],
) -> Project

Parse an After Effects (.aep) project file.

Deprecated

Use aep_parser.parse instead which returns an Application instance. Access the project via app.project.

Parameters:

Item Parsers

parse_composition

Parse a composition item.

Parameters:

  • child_chunks

    (list[Chunk]) –

    child chunks of the composition LIST chunk.

  • item_id

    (int) –

    The unique item ID.

  • item_name

    (str) –

    The composition name.

  • label

    (Label) –

    The label color. Colors are represented by their number (0 for None, or 1 to 16 for one of the preset colors in the Labels preferences).

  • parent_folder

    (FolderItem) –

    The composition's parent folder.

  • comment

    (str) –

    The composition comment.

  • effect_param_defs

    (dict[str, dict[str, dict[str, Any]]]) –

    Project-level effect parameter definitions, used as fallback when layer-level parT chunks are missing.

parse_footage

Parse a footage item.

Parameters:

  • child_chunks

    (list[Chunk]) –

    The footage item child chunks.

  • item_id

    (int) –

    The item's unique id.

  • item_name

    (str) –

    The item's name.

  • label

    (Label) –

    The label color. Colors are represented by their number (0 for None, or 1 to 16 for one of the preset colors in the Labels preferences).

  • parent_folder

    (FolderItem) –

    The item's parent folder.

  • comment

    (str) –

    The item's comment.

parse_folder

Parse a folder item.

Parameters:

  • is_root

    (bool) –

    Whether the folder is the root folder (ID 0).

  • child_chunks

    (list[Chunk]) –

    child chunks of the folder LIST chunk.

  • project

    (Project) –

    The project.

  • item_id

    (int) –

    The unique item ID.

  • item_name

    (str) –

    The folder name.

  • label

    (Label) –

    The label color. Colors are represented by their number (0 for None, or 1 to 16 for one of the preset colors in the Labels preferences).

  • parent_folder

    (FolderItem | None) –

    The folder's parent folder.

  • comment

    (str) –

    The folder comment.

Layer Parser

parse_layer

parse_layer(
    layer_chunk: Chunk,
    composition: CompItem,
    effect_param_defs: dict[str, dict[str, dict[str, Any]]],
    layer_id_to_index: dict[int, int] | None = None,
) -> Layer

Parse a composition layer.

This layer is an instance of an item in a composition. Some information can only be found on the source item. To access it, use source_item = layer.source.

Parameters:

  • layer_chunk

    (Chunk) –

    The LIST chunk to parse.

  • composition

    (CompItem) –

    The composition.

  • effect_param_defs

    (dict[str, dict[str, dict[str, Any]]]) –

    Project-level effect parameter definitions, used as fallback when layer-level parT chunks are missing.

  • layer_id_to_index

    (dict[int, int] | None, default: None ) –

    Mapping from binary layer IDs to 1-based layer indices, used to resolve LAYER_INDEX property values.

Returns:

Property Parsers

parse_property_group

Parse a property group.

Parameters:

  • tdgp_chunk

    (Chunk) –

    The TDGP chunk to parse.

  • group_match_name

    (str) –

    A special name for the property used to build unique naming paths. The match name is not displayed, but you can refer to it in scripts. Every property has a unique match-name identifier. Match names are stable from version to version regardless of the display name (the name attribute value) or any changes to the application. Unlike the display name, it is not localized. An indexed group (PropertyBase.property_type == PropertyType.indexed_group) may not have a name value, but always has a match_name value.

  • time_scale

    (float) –

    The time scale of the parent composition, used as a divisor for some frame values.

  • property_depth

    (int) –

    The nesting depth of this group (0 = layer level).

  • effect_param_defs

    (dict[str, dict[str, dict[str, Any]]]) –

    Project-level effect parameter definitions, used as fallback when layer-level parT chunks are missing.

  • frame_rate

    (float) –

    The frame rate of the parent composition.

  • comp_size

    (tuple[int, int]) –

    (width, height) of the parent composition in pixels.

  • layer_id_to_index

    (dict[int, int] | None) –

    Mapping from binary layer IDs to 1-based layer indices, used to resolve LAYER_INDEX property values.

parse_property

Parse a property.

Parameters:

  • tdbs_chunk

    (Chunk) –

    The TDBS chunk to parse.

  • match_name

    (str) –

    A special name for the property used to build unique naming paths. The match name is not displayed, but you can refer to it in scripts. Every property has a unique match-name identifier. Match names are stable from version to version regardless of the display name (the name attribute value) or any changes to the application. Unlike the display name, it is not localized.

  • time_scale

    (float) –

    The time scale of the parent composition, used as a divisor for some frame values.

  • property_depth

    (int) –

    The nesting depth of this property (0 = layer level).

  • frame_rate

    (float) –

    The frame rate of the parent composition.

  • layer_id_to_index

    (dict[int, int] | None, default: None ) –

    Mapping from binary layer IDs (ldta.layer_id) to 1-based layer indices. Used to convert tdpi values to the layer index reported by ExtendScript.

parse_effect

Parse an effect.

Parameters:

  • sspc_chunk

    (Chunk) –

    The SSPC chunk to parse.

  • group_match_name

    (str) –

    A special name for the property used to build unique naming paths. The match name is not displayed, but you can refer to it in scripts. Every property has a unique match-name identifier. Match names are stable from version to version regardless of the display name (the name attribute value) or any changes to the application. Unlike the display name, it is not localized. An indexed group (PropertyBase.property_type == PropertyType.indexed_group) may not have a name value, but always has a match_name value.

  • time_scale

    (float) –

    The time scale of the parent composition, used as a divisor for some frame values.

  • property_depth

    (int) –

    The nesting depth of this group (0 = layer level).

  • effect_param_defs

    (dict[str, dict[str, dict[str, Any]]]) –

    Project-level effect parameter definitions, used as fallback when layer-level parT chunks are missing.

  • frame_rate

    (float) –

    The frame rate of the parent composition.

  • comp_size

    (tuple[int, int]) –

    (width, height) of the parent composition in pixels.

  • layer_id_to_index

    (dict[int, int] | None) –

    Mapping from binary layer IDs to 1-based layer indices, used to resolve LAYER_INDEX property values.

Marker Parsers

parse_markers

parse_markers(
    mrst_chunk: Chunk, time_scale: float, frame_rate: float
) -> Property

Parse markers from an MRST chunk.

Returns the underlying Property (the tdbs inside the mrst chunk, with keyframes holding marker values).

Parameters:

  • mrst_chunk

    (Chunk) –

    The MRST chunk to parse.

  • time_scale

    (float) –

    The time scale of the parent composition, used as a divisor for some frame values.

  • frame_rate

    (float) –

    The frame rate of the parent composition, used to compute marker duration in seconds.

parse_marker

parse_marker(
    nmrd_chunk: Chunk, frame_rate: float, frame_time: int
) -> MarkerValue

Parse a marker.

Parameters:

  • nmrd_chunk

    (Chunk) –

    The NMRD chunk to parse.

  • frame_rate

    (float) –

    The frame rate of the parent composition (unused but kept for API consistency).

  • frame_time

    (int) –

    The time of the marker, in frames.

Property Defaults

set_transform_defaults

set_transform_defaults(layer: Layer) -> None

Assign defaults and synthesize missing transform properties.

After Effects always exposes twelve transform properties via ExtendScript regardless of whether the layer is 2-D or 3-D. The binary format, however, only stores properties relevant to the current layer state. This function:

  1. Sets default_value on every transform property already parsed from the binary so that Property.is_modified works correctly.
  2. Creates Property objects for any of the twelve canonical properties that are absent from the binary.
  3. Re-orders transform.properties to match the canonical ExtendScript order.

Spatial defaults (Anchor Point, Position, and the X / Y separated followers) depend on layer dimensions and are computed here; all other defaults are fixed constants defined in _TRANSFORM_FIXED_DEFAULTS.

set_layer_property_defaults

set_layer_property_defaults(layer: Layer) -> None

Apply min/max and other property defaults to all layer groups.

Walks all top-level property groups on the layer (excluding Transform, which is handled by set_transform_defaults). Also synthesizes missing sub-properties in standard groups (Material Options, Geometry Options, etc.) and missing top-level groups that ExtendScript always exposes.

Parameters:

  • layer

    (Layer) –

    The layer whose properties should be updated.

Viewer Parser

parse_viewers

parse_viewers(root_folder_chunk: Chunk) -> list[Viewer]

Parse viewer panels from the Fold-level chunks.

The Fold chunk contains a repeating pattern of small metadata chunks that describe each viewer panel (Timeline, Composition, Layer, Footage). Each panel block is bounded by fvdv (start) and fifl (end), and may contain fips chunks that hold the per-view options.

The fitt chunk contains the inner tab type label (e.g. "AE Composition") which maps to ViewerType. The foac chunk indicates whether the outer panel is active.

Parameters:

  • root_folder_chunk

    (Chunk) –

    The LIST:Fold chunk.

Returns:

Render Queue Parsers

parse_render_queue

parse_render_queue(
    root_chunks: list[Chunk], project: Project
) -> RenderQueue

Parse the render queue from the top-level chunks.

Parameters:

  • root_chunks

    (list[Chunk]) –

    The top-level chunks from the AEP file.

  • project

    (Project) –

    The Project object being constructed, used to link comp references in render queue items.

parse_render_queue_items

parse_render_queue_items(
    lrdr_child_chunks: list[Chunk], project: Project
) -> list[RenderQueueItem]

Parse render queue items from the child chunks of LRdr.

The render queue items are stored in a LIST 'list' chunk directly under LRdr. Each item consists of: - An optional RCom chunk with the item comment - A LIST 'list' chunk with item metadata and settings - A LIST 'LOm ' chunk with output module info - A RenderSettingsLdatBody chunk with the render settings for the item - A Rout chunk with per-item render flags

Parameters:

  • lrdr_child_chunks

    (list[Chunk]) –

    The child chunks of the LRdr chunk.

  • project

    (Project) –

    The Project object being constructed, used to link comp references in render queue items.

parse_render_queue_item

parse_render_queue_item(
    list_chunk: Chunk,
    lom_chunk: Chunk,
    ldat_body: RenderSettingsLdatBody,
    comment: str,
    project: Project,
) -> RenderQueueItem

Parse a single render queue item from its component chunks.

Parameters:

  • list_chunk

    (Chunk) –

    The LIST 'list' chunk containing item metadata.

  • lom_chunk

    (Chunk) –

    The LIST 'LOm ' chunk containing output modules.

  • ldat_body

    (RenderSettingsLdatBody) –

    The RenderSettingsLdatBody chunk for this item.

  • comment

    (str) –

    The comment for the render queue item (from RCom chunk).

  • project

    (Project) –

    The Project object being constructed, used to link comp references in render queue items.

Output Module Parser

parse_output_module

parse_output_module(
    chunks: list[Chunk],
    om_ldat_data: OutputModuleSettingsLdatBody,
    project: Project,
    render_queue_item: RenderQueueItem,
) -> OutputModule

Parse an output module from its chunk group.

Each output module consists of: - Roou: Output options (binary data) - Ropt: Render options (binary data) - hdrm: HDR metadata - Utf8: HDR10 / color metadata JSON (e.g. {"colorMetadataPresent":true}) - LIST Als2: Output file path info - alas: JSON with fullpath and target_is_folder - Utf8: Template/format name (e.g., "H.264 - Match Render Settings - 15 Mbps") - Utf8: File name template (e.g., "[compName].[fileextension]" or "output.mp4")

Parameters:

  • chunks

    (list[Chunk]) –

    List of chunks belonging to this output module.

  • om_ldat_data

    (OutputModuleSettingsLdatBody) –

    Parsed OutputModuleSettingsLdatBody from LdatItem.

Returns:

Format Options Parser

parse_format_options

parse_format_options(
    chunks: list[Chunk],
) -> FormatOptions | None

Parse format-specific options from the Ropt chunk, if present.

Parameters:

  • chunks

    (list[Chunk]) –

    List of chunks belonging to an output module.

Returns:

  • FormatOptions | None

    A format-specific options object, or None when the Ropt chunk

  • FormatOptions | None

    is absent or the format is not yet supported.