Skip to content

File source

FileSource

Bases: FootageSource

The FileSource object describes footage that comes from a file.

Example
from py_aep import FileSource, parse

app = parse("project.aep")
footage = app.project.footages[0]
if isinstance(footage.main_source, FileSource):
    print(footage.main_source.file)
Info

FileSource is a subclass of FootageSource object. All methods and attributes of FootageSource are available when working with FileSource.

See: https://ae-scripting.docsforadobe.dev/sources/filesource/

Attributes

alpha_mode

alpha_mode = enum(AlphaMode, '_sspc', 'alpha_mode_raw')

Defines how the alpha information in the footage is interpreted. If has_alpha is False, this attribute has no relevant meaning. Read / Write.

conform_frame_rate

conform_frame_rate = ChunkField[float](
    "_sspc",
    "conform_frame_rate",
    reverse_instance_field=reverse_fractional(
        "conform_frame_rate_integer",
        "conform_frame_rate_fractional",
    ),
    validate=validate_number(min=0.0, max=999.0),
)

A frame rate to use instead of the native_frame_rate value. If set to 0, the native_frame_rate is used instead. Read / Write.

display_frame_rate

display_frame_rate = ChunkField[float](
    "_sspc", "display_frame_rate", read_only=True
)

The effective frame rate as displayed and rendered in compositions. If remove_pulldown is active, the rate is multiplied by 0.8. Read-only.

field_separation_type

field_separation_type = enum(
    FieldSeparationType,
    "_sspc",
    "field_separation_type",
    reverse_instance_field=_reverse_field_separation_type,
)

How the fields are to be separated in non-still footage. Read / Write.

file

file: str

The full file path. Read-only.

file_attributes

file_attributes: dict[str, Any]

Format-specific metadata extracted from the source file header stored in the project.

For PSD (Photoshop) sources, the following keys are available:

  • psd_layer_index (int): Zero-based index of this layer within the PSD file. 0xFFFF means merged/flattened.
  • psd_group_name (str): PSD group/folder that contains this layer (e.g. "PAINT 02").
  • psd_layer_count (int): Total number of layers in the source PSD.
  • psd_canvas_width (int): Full PSD canvas width in pixels.
  • psd_canvas_height (int): Full PSD canvas height in pixels.
  • psd_bit_depth (int): Bit depth per channel (8, 16, 32).
  • psd_channels (int): Number of color channels (3 for RGB, 4 for RGBA/CMYK).
  • psd_layer_top (int): Layer bounding-box top (pixels, can be negative if the layer extends above the canvas).
  • psd_layer_left (int): Layer bounding-box left.
  • psd_layer_bottom (int): Layer bounding-box bottom.
  • psd_layer_right (int): Layer bounding-box right.

Read-only.

file_names

file_names: list[str]

The filenames if the footage is an image sequence. Read-only.

has_alpha

has_alpha = bool('_sspc', 'has_alpha', read_only=True)

When True, the footage has an alpha component. In this case, the attributes alpha_mode, invert_alpha, and premultiplied have valid values. When False, those attributes have no relevant meaning for the footage. Read-only.

high_quality_field_separation

high_quality_field_separation = ChunkField[bool](
    "_sspc",
    "high_quality_field_separation",
    transform=lambda v: v % 2 != 0,
    reverse_seq_field=int,
)

When True, After Effects uses special algorithms to determine how to perform high-quality field separation. Read / Write.

interpret_as_linear_light

interpret_as_linear_light = enum(
    LinearLightMode, "_linl", "value", default=OFF
)

The Interpret As Linear Light setting from the Interpret Footage > Color Management tab. Read / Write.

Note

Not exposed in ExtendScript.

invert_alpha

invert_alpha = bool('_sspc', 'invert_alpha')

When True, an alpha channel in a footage clip or proxy should be inverted. This attribute is valid only if an alpha is present. If has_alpha is False, or if alpha_mode is AlphaMode.IGNORE, this attribute is ignored. Read / Write.

is_still

is_still: bool

When True the footage is still; When False, it has a time-based component. Read-only.

loop

loop = ChunkField[int](
    "_sspc",
    "loop",
    validate=validate_number(min=1, max=9999, integer=True),
)

The number of times that the footage is to be played consecutively when used in a composition. Read / Write.

media_color_space

media_color_space: str

The media color space from the Interpret Footage > Color Management tab.

Returns "Embedded" (default), "Working Color Space", or the name of the selected ICC profile (e.g. "Apple RGB"). Read-only.

Note

Not exposed in ExtendScript.

missing_footage_path

missing_footage_path: str

The path of the missing source file when the footage was missing at the time the project was last saved, otherwise an empty string. Read-only.

native_frame_rate

native_frame_rate = ChunkField[float](
    "_sspc", "native_frame_rate", read_only=True
)

The native frame rate of the footage. Read-only.

premul_color

premul_color = ChunkField[List[float]](
    "_sspc",
    "premul_color",
    transform=normalize_values,
    reverse_seq_field=denormalize_values,
    validate=validate_sequence(length=3, min=0.0, max=1.0),
)

The color to be premultiplied. This attribute is valid only if the alpha_mode is AlphaMode.PREMULTIPLIED. Read / Write.

preserve_rgb

preserve_rgb: bool

When True, the footage Preserve RGB setting is enabled. From the Interpret Footage > Color Management tab. Read / Write.

Note

Not exposed in ExtendScript.

remove_pulldown

remove_pulldown = enum(
    PulldownPhase,
    "_sspc",
    "remove_pulldown",
    invalidates=["display_frame_rate"],
)

Controls which pulldown phase to remove from the source footage. PulldownPhase.OFF by default. Read / Write.

target_is_folder

target_is_folder: bool

True if the file is a folder, else False. Read-only.