Skip to content

Av item

AVItem

Bases: Item

The AVItem object provides access to attributes and methods of audio/visual files imported into After Effects.

Info

AVItem is a subclass of Item. All methods and attributes of Item are available when working with AVItem.

Info

AVItem is the base class for both CompItem and FootageItem, so AVItem attributes and methods are also available when working with CompItem and FootageItem objects. See CompItem object and FootageItem object.

See: https://ae-scripting.docsforadobe.dev/item/avitem/

Attributes

comment

comment: str

The item comment. Read / Write.

duration

duration: ChunkField[float]

The duration of the item in seconds. Still footages have a duration of 0. Read-only.

frame_duration

frame_duration: ChunkField[int]

The duration of the item in frames. Still footages have a duration of 0. Read-only.

frame_rate

frame_rate: ChunkField[float]

The frame rate of the item in frames-per-second. Read-only.

frame_time

frame_time: int

The current time of the item when it is being previewed directly from the Project panel. This value is a number of frames.

guides

guides: list[Guide]

The item's ruler guides. Each guide has an orientation and a pixel position. Read-only.

has_audio

has_audio: bool

When True, the AVItem has an audio component.

In a CompItem, the value is linked to the composition. In a FootageItem, the value is linked to the main_source object.

has_video

has_video: bool

True if the item has a video component.

An AVItem has video when it has non-zero dimensions (width > 0 and height > 0). In a CompItem, the value is always True. In a FootageItem, the value depends on the footage source (e.g. audio-only files return False).

height

height: ChunkField[int]

The height of the item in pixels. Read-only.

id

id = ChunkField[int](
    "_idta", "item_id", read_only=True, default=0
)

The item unique identifier. Read-only.

is_composition

is_composition: bool

True if the item is a composition.

is_folder

is_folder: bool

True if the item is a folder.

is_footage

is_footage: bool

True if the item is a footage.

label

label = enum(Label, '_idta', 'label', default=NONE)

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). Read / Write.

name

name = ChunkField[str](
    "_name_utf8", "contents", transform=strip_null
)

The name of the item, as shown in the Project panel. Read / Write.

parent_folder

parent_folder: FolderItem | None

The parent folder of this item. None for the root folder. Read-only.

pixel_aspect

pixel_aspect: ChunkField[float]

The pixel aspect ratio of the item (1.0 is square). Read-only.

selected

selected: bool

When True, this item is selected. Read-only.

Note

Item selection is not stored in the .aep binary format; it is a runtime-only state. Parsed projects always report False.

time

time: float

The current time of the item when it is being previewed directly from the Project panel. This value is a number of seconds. It is an error to set this value for a FootageItem whose main_source is still (item.main_source.is_still is True).

type_name

type_name: str

A user-readable name for the item type ("Folder", "Footage" or "Composition"). These names are application locale-dependent, meaning that they are different depending on the application's UI language. Read-only.

used_in

used_in: list[CompItem]

All the compositions that use this AVItem.

width

width: ChunkField[int]

The width of the item in pixels. Read-only.