pycmx Classes

class pycmx.edit_list.EditList(statements: list)[source]

Represents an entire edit decision list as returned by parse_cmx3600().

property channels: ChannelMap

Return the union of every channel channel.

property events: Generator[Event, None, None]

A generator for all the events in the edit list

property format: str

The detected format of the EDL. Possible values are: “3600”, “File32”, “File128”, and “unknown”.

Adobe EDLs with more than 999 events will be reported as “3600”.

property sources: Generator[StmtSourceUMID, None, None]

A generator for all of the sources in the list

property title: str

The title of this edit list.

property unrecognized_statements: Generator[Any, None, None]

A generator for all the unrecognized statements and corrupt remarks in the list.

Yields:

either a StmtUnrecognized or StmtCorruptRemark

class pycmx.event.Event(statements)[source]

Represents a collection of Edit s, all with the same event number.

property edits: List[Edit]

Returns the edits. Most events will have a single edit, a single event will have multiple edits when a dissolve, wipe or key transition needs to be performed.

property number: int

Return the event number.

property unrecognized_statements: Generator[StmtUnrecognized, None, None]

A generator for all the unrecognized statements in the event.

class pycmx.edit.Edit(edit_statement: StmtEvent, audio_ext_statement: StmtAudioExt | None, clip_name_statement: StmtClipName | None, source_file_statement: StmtSourceFile | None, trans_name_statement: StmtEffectsName | None = None, asc_sop_statement: StmtCdlSop | None = None, asc_sat_statement: StmtCdlSat | None = None, frmc_statement: StmtFrmc | None = None)[source]

An individual source-to-record operation, with a source roll, source and recorder timecode in and out, a transition and channels.

property asc_sat: float | None

Get ASC CDL saturation value for clip, if present.

property asc_sop: AscSopComponents[float] | None

Get ASC CDL Slope-Offset-Power color transfer function for the edit, if present. The ASC SOP is a transfer function of the form:

\(y = (ax + b)^p\)

for each color component the source, where the slope is a, offset is b and power is p.

property asc_sop_raw: str | None

ASC CDL Slope-Offset-Power statement raw line.

property aux_source: bool

The source field for this edit was “AX”. An auxiliary source is the source for this event.

property black: bool

The source field for thie edit was “BL”. Black video or silence should be used as the source for this event.

property channels: ChannelMap

Get the ChannelMap object associated with this Edit.

property clip_name: str | None

Get the clip name, as attested by a “* FROM CLIP NAME” or “* TO CLIP NAME” remark on the EDL. This will return None if the information is not present.

property framecounts: FramecountTriple | None

Get frame count offset data, if it exists. If an FRMC statement exists in the EDL for the event it will give an integer frame count for the edit’s source in and out times.

property line_number: int

Get the line number for the “standard form” statement associated with this edit. Line numbers a zero-indexed, such that the “TITLE:” record is line zero.

property record_in: str

Get the record in timecode.

property record_out: str

Get the record out timecode.

property source: str

Get the source column. This is the 8, 32 or 128-character string on the event record line, this usually references the tape name of the source.

property source_file: str | None

Get the source file, as attested by a “* SOURCE FILE” remark on the EDL. This will return None if the information is not present.

property source_in: str

Get the source in timecode.

property source_out: str

Get the source out timecode.

property transition: Transition

Get the Transition that initiates this edit.

class pycmx.transition.Transition(transition, operand, name=None)[source]

A CMX transition: a wipe, dissolve or cut.

property cut: bool

True if this transition is a cut.

property dissolve: bool

True if this traansition is a dissolve.

property effect_duration: int

The duration of this transition, in frames of the record target.

In the event of a key event, this is the duration of the fade in.

property key_background: bool

True if this edit is a key background.

property key_foreground: bool

True if this edit is a key foreground.

property key_out: bool

True if this edit is a key out. This material will removed from the key foreground and replaced with the key background.

property kind: str | None

Return the kind of transition: Cut, Wipe, etc.

property wipe: bool

True if this transition is a wipe.

property wipe_number: int | None

Wipes are identified by a particular number.

class pycmx.channel_map.ChannelMap(v=False, audio_channels={})[source]

Represents a set of all the channels to which an event applies.

property a1: bool

True if A1 is included

property a2: bool

True if A2 is included

property a3: bool

True if A3 is included

property a4: bool

True if A4 is included

property audio: bool

True if an audio channel is included

property channels: Generator[int, None, None]

A generator for each audio channel

get_audio_channel(chan_num) bool[source]

True if chan_num is included

set_audio_channel(chan_num, enabled: bool)[source]

If enabled is true, chan_num will be included

property video: bool

True if video is included

class pycmx.cdl.AscSopComponents(slope: Rgb[T], offset: Rgb[T], power: Rgb[T])[source]

Fields in an ASC SOP (Slope-Offset-Power) color transfer function statement.

The ASC SOP is a transfer function of the form:

\(y_{color} = (ax_{color} + b)^p\)

for each color component the source, where the slope is a, offset is b and power is p.

class pycmx.cdl.FramecountTriple(start: int, end: int, duration: int)[source]

Fields in an FRMC statement

duration: int

Alias for field number 2

end: int

Alias for field number 1

start: int

Alias for field number 0

class pycmx.cdl.Rgb(red: T, green: T, blue: T)[source]

A tuple of three `T`s, where each is the respective red, green and blue values of interest.