Welcome to pyaaf2 Documentation!¶
Overview¶
pyaaf2 is a python module for the reading and writing Advanced Authoring Format (AAF) files.
Quickstart¶
Installing¶
You can install pyaaf2 via:
pip install pyaaf2
or if you want to use the latest development git master:
git clone https://github.com/markreidvfx/pyaaf2
cd pyaaf2
python setup.py install
Reading¶
import aaf2
with aaf2.open("path/to/file.aaf", "r") as f:
# get the main composition
main_compostion = next(f.content.toplevel())
# print the name of the composition
print(main_compostion.name)
# AAFObjects have properties that can be
# accessed just like a dictionary
print(main_compostion['CreationTime'].value)
# video, audio and other track types are
# stored in slots on a mob object.
for slot in main_compostion.slots:
segment = slot.segment
print(segment)
Embedding Footage¶
First lets generate some DNxHR media with ffmpeg:
ffmpeg -f lavfi -i testsrc=size=960x540 -frames:v 24 -vcodec dnxhd -pix_fmt yuv422p -profile:v dnxhr_lb sample.dnxhd
Now lets generate some audio media:
ffmpeg -f lavfi -i aevalsrc="sin(420*2*PI*t):s=48000:d=1.0" -acodec pcm_s16le sample.wav
Finally import the footage:
import aaf2
with aaf2.open("example2.aaf", 'w') as f:
# objects are create with a factory
# on the AAFFile Object
mob = f.create.MasterMob("Demo2")
# add the mob to the file
f.content.mobs.append(mob)
edit_rate = 25
# lets also create a tape so we can add timecode (optional)
tape_mob = f.create.SourceMob()
f.content.mobs.append(tape_mob)
timecode_rate = 25
start_time = timecode_rate * 60 * 60 # 1 hour
tape_name = "Demo Tape"
# add tape slots to tape mob
tape_mob.create_tape_slots(tape_name, edit_rate,
timecode_rate, media_kind='picture')
# create sourceclip that references timecode
tape_clip = tape_mob.create_source_clip(1, start_time)
# now finally import the generated media
mob.import_dnxhd_essence("sample.dnxhd", edit_rate, tape_clip)
mob.import_audio_essence("sample.wav", edit_rate)
About the AAF File Format¶
AAF is a file format used for professional multimedia creation and authoring. The file specification is managed by the Advanced Media Workflow Association (AMWA).
AAF uses a object-oriented data model. The data model has a single inheritance class hierarchy and classes have properties that store metadata. Classes, properties, and types each have unique ids, known as a Authoring Unique Identifier (AUID). AAF and MXF are closely related, The AAF data model is the basis for the MXF data model.
The Compound File Binary Format (CFBF) is what AAF uses for binary storage. CFBF, also called Structured Storage or Object Linking and Embedding (OLE), is a file format developed by Microsoft for storing hierarchical data. CFBF is basically a FAT32 filesystem in a file and AAF uses “directories” as classes and “files” to store property metadata.
aaf2 package¶
Submodules¶
aaf2.ama module¶
-
aaf2.ama.
get_wave_fmt
(path)¶ Returns a bytearray of the WAVE RIFF header and fmt chunk for a WAVEDescriptor Summary
-
aaf2.ama.
get_aifc_fmt
(path)¶ Compute the AIFC header information for a AIFCDescriptor Summary
Parameters: path – file to read chunk from Returns: a bytearray
-
aaf2.ama.
create_network_locator
(f, absolute_path)¶
-
class
aaf2.ama.
FormatInfo
(metadata)¶ Bases:
object
Provides convenient access to commonly-used datums
-
streams
¶
-
first_sound_stream
¶
-
first_picture_stream
¶
-
create_descriptor
(f, path)¶
-
container_guid
¶
-
edit_rate
¶ Returns: The edit rate of the first picture stream, or if there are none, the first sound stream.
-
length
¶ Returns: The length of the first picture stream, or if there are none, the first sound stream.
-
create_wav_descriptor
(f, path)¶
-
create_aifc_descriptor
(f, path)¶
-
coalesce_descriptors
(f, descriptors, path)¶
-
create_multistream_descriptor
(f, path)¶
-
-
class
aaf2.ama.
StreamInfo
(metadata)¶ Bases:
object
-
codec_type
¶
-
codec_name
¶
-
is_sound
¶
-
is_picture
¶
-
edit_rate
¶
-
length
¶
-
physical_track_count
¶
-
create_pcm_descriptor
(f)¶
-
pixel_sizes
()¶
-
get_avc_compression
()¶
-
get_compression
()¶
-
create_video_descriptor
(f)¶
-
-
aaf2.ama.
create_media_link
(f, path, metadata)¶ Create an essence linked to external media and all obligatory mobs and data structures required by the edit spec.
The returned
aaf.mobs.MasterMob
will have one slot for each video stream and each audio channel in the file at path.Example: The linked file is a Quicktime movie with picture and a stereo audio track. This function will create a SourceMob with three slots, one picture slot, and two sound slots, for audio channels one and two respectively. The function will also create a derivation SourceMob, linked to these slots.
Parameters: - f – The
aaf.File
to add this link to - path – A path recognizable to os.path
- metadata – Pre-fetched media description (in the form of a dictionary) from “ffprobe -show_format -show_streams”
Returns: A aaf.mobs.MasterMob linked to the file at link.
- f – The
aaf2.auid module¶
aaf2.cfb module¶
-
aaf2.cfb.
pretty_sectors
(fat)¶
-
class
aaf2.cfb.
Stream
(storage, entry, mode='r')¶ Bases:
object
-
storage
¶
-
dir
¶
-
mode
¶
-
pos
¶
-
fat_chain
¶
-
tell
()¶
-
seek
(offset, whence=0)¶
-
is_mini_stream
()¶
-
sector_size
()¶
-
sector_offset
()¶
-
sector_index
()¶
-
read
(n=-1)¶
-
allocate
(byte_size)¶
-
write
(data)¶
-
truncate
(size=None)¶
-
close
()¶
-
-
aaf2.cfb.
is_red
(entry)¶
-
aaf2.cfb.
is_not_red
(entry)¶
-
aaf2.cfb.
is_parent_of
(parent, entry)¶
-
aaf2.cfb.
validate_rbtree
(root)¶
-
aaf2.cfb.
jsw_single
(root, direction)¶
-
aaf2.cfb.
jsw_double
(root, direction)¶
-
aaf2.cfb.
find_entry_parent
(root, entry, max_depth)¶
-
aaf2.cfb.
get_entry_path
(root, entry, max_depth)¶
-
class
aaf2.cfb.
DirEntry
(storage, dir_id, data=None)¶ Bases:
object
-
storage
¶
-
parent
¶
-
data
¶
-
dir_id
¶
-
name
¶
-
type
¶
-
color
¶
-
red
¶
-
left_id
¶
-
right_id
¶
-
child_id
¶
-
class_id
¶
-
flags
¶
-
create_time
¶
-
modify_time
¶
-
sector_id
¶
-
byte_size
¶
-
mark_modified
()¶
-
left
()¶
-
right
()¶
-
child
()¶
-
add_child
(entry)¶
-
insert
(entry)¶ Inserts entry into child folder tree. Tries to maintain a balanced red black tree. Technique is base on topdown insert approach in described in https://eternallyconfuzzled.com/red-black-trees-c-the-most-common-balanced-binary-search-tree
-
pop
()¶ remove self from self.parent folder binary search tree. Tries to maintain a balanced red black tree. Technique is base on topdown remove approach in described in https://eternallyconfuzzled.com/red-black-trees-c-the-most-common-balanced-binary-search-tree
-
rebalance_children_tree
()¶
-
path
()¶
-
open
(mode='r')¶
-
isdir
()¶
-
isroot
()¶
-
listdir
()¶
-
makedir
(relative_path, class_id=None)¶
-
isfile
()¶
-
get
(name, default=None)¶
-
touch
(name)¶
-
write
()¶
-
read
()¶
-
-
aaf2.cfb.
extend_sid_table
(f, table, byte_size)¶
-
class
aaf2.cfb.
CompoundFileBinary
(file_object, mode='rb', sector_size=4096)¶ Bases:
object
-
close
()¶
-
setup_empty
(sector_size)¶
-
write_header
()¶
-
read_header
()¶
-
iter_difat
()¶
-
write_difat
()¶
-
read_fat
()¶
-
write_fat
()¶
-
read_minifat
()¶
-
write_minifat
()¶
-
write_modified_dir_entries
()¶
-
write_dir_entries
()¶
-
next_free_minifat_sect
()¶
-
next_free_sect
()¶
-
read_sector_data
(sid)¶
-
get_sid_offset
(abs_pos)¶
-
dir_entry_sid_offset
(dir_id)¶
-
dir_entry_pos
(dir_id)¶
-
read_dir_entry
(dir_id, parent=None)¶
-
clear_sector
(sid)¶
-
next_free_dir_id
()¶
-
get_fat_chain
(start_sid, minifat=False)¶
-
mini_stream_grow
()¶
-
fat_chain_append
(start_sid, minifat=False)¶
-
free_fat_chain
(start_sid, minifat=False)¶
-
create_dir_entry
(path, dir_type='storage', class_id=None)¶
-
free_dir_entry
(entry)¶
-
remove
(path)¶ Removes both streams and storage DirEntry types from file. storage type entries need to be empty dirs.
-
rmtree
(path)¶ Removes directory structure, similar to shutil.rmtree.
-
listdir
(path=None)¶ Return a list containing the
DirEntry
objects in the directory given by path.
-
listdir_dict
(path=None)¶ Return a dict containing the
DirEntry
objects in the directory given by path with name of the dir as key.
-
find
(path)¶ find a
DirEntry
located at path. ReturnsNone
if path does not exist.
-
walk
(path=None, topdown=True)¶ Similar to
os.walk()
, yeields a 3-tuple(root, storage_items, stream_items)
-
validate_directory_structure
()¶
-
exists
(path)¶ Return
True
if path refers to a existing path.
-
makedir
(path, class_id=None)¶ Create a storage DirEntry name path
-
makedirs
(path)¶ Recursive storage DirEntry creation function.
-
move
(src, dst)¶ Moves
DirEntry
from src to dst
-
open
(path, mode='r')¶ Open stream, returning
Stream
object
-
aaf2.components module¶
-
class
aaf2.components.
Component
(media_kind=None, length=None)¶ Bases:
aaf2.core.AAFObject
-
class_id
= 0d010101-0101-0200-060e-2b3402060101¶
-
length
¶
-
datadef
¶
-
media_kind
¶
-
-
class
aaf2.components.
Segment
(media_kind=None, length=None)¶ Bases:
aaf2.components.Component
-
class_id
= 0d010101-0101-0300-060e-2b3402060101¶
-
-
class
aaf2.components.
Transition
(media_kind=None, length=None)¶ Bases:
aaf2.components.Component
-
class_id
= 0d010101-0101-1700-060e-2b3402060101¶
-
cutpoint
¶
-
-
class
aaf2.components.
Sequence
(media_kind=None, length=None)¶ Bases:
aaf2.components.Segment
-
class_id
= 0d010101-0101-0f00-060e-2b3402060101¶
-
components
¶
-
component_at_time
(edit_unit)¶
-
index_at_time
(edit_unit)¶
-
positions
()¶
-
-
class
aaf2.components.
NestedScope
(media_kind=None, length=None)¶ Bases:
aaf2.components.Segment
-
class_id
= 0d010101-0101-0b00-060e-2b3402060101¶
-
slots
¶
-
-
class
aaf2.components.
SourceReference
(media_kind=None, length=None)¶ Bases:
aaf2.components.Segment
-
class_id
= 0d010101-0101-1000-060e-2b3402060101¶
-
mob_id
¶
-
slot_id
¶
-
mob
¶
-
slot
¶
-
-
class
aaf2.components.
SourceClip
(start=None, length=None, mob_id=None, slot_id=None, media_kind=None)¶ Bases:
aaf2.components.SourceReference
-
class_id
= 0d010101-0101-1100-060e-2b3402060101¶
-
start
¶
-
walk
()¶
-
-
class
aaf2.components.
Filler
(media_kind=None, length=None)¶ Bases:
aaf2.components.Segment
-
class_id
= 0d010101-0101-0900-060e-2b3402060101¶
-
-
class
aaf2.components.
EssenceGroup
(media_kind=None, length=None)¶ Bases:
aaf2.components.Segment
-
class_id
= 0d010101-0101-0500-060e-2b3402060101¶
-
-
class
aaf2.components.
EdgeCode
(media_kind=None, length=None)¶ Bases:
aaf2.components.Segment
-
class_id
= 0d010101-0101-0400-060e-2b3402060101¶
-
-
class
aaf2.components.
Pulldown
(media_kind=None, length=None)¶ Bases:
aaf2.components.Segment
-
class_id
= 0d010101-0101-0c00-060e-2b3402060101¶
-
-
class
aaf2.components.
ScopeReference
(media_kind=None, length=None)¶ Bases:
aaf2.components.Segment
-
class_id
= 0d010101-0101-0d00-060e-2b3402060101¶
-
-
class
aaf2.components.
Selector
(media_kind=None, length=None)¶ Bases:
aaf2.components.Segment
-
class_id
= 0d010101-0101-0e00-060e-2b3402060101¶
-
-
class
aaf2.components.
Timecode
(fps=25, drop=False, length=None)¶ Bases:
aaf2.components.Segment
-
class_id
= 0d010101-0101-1400-060e-2b3402060101¶
-
start
¶
-
fps
¶
-
drop
¶
-
-
class
aaf2.components.
OperationGroup
(operationdef, length=None, media_kind=None)¶ Bases:
aaf2.components.Segment
-
class_id
= 0d010101-0101-0a00-060e-2b3402060101¶
-
operation
¶
-
parameters
¶
-
segments
¶
-
-
class
aaf2.components.
Event
¶ Bases:
aaf2.components.Segment
-
class_id
= 0d010101-0101-0600-060e-2b3402060101¶
-
-
class
aaf2.components.
CommentMarker
¶ Bases:
aaf2.components.Event
-
class_id
= 0d010101-0101-0800-060e-2b3402060101¶
-
-
class
aaf2.components.
DescriptiveMarker
¶ Bases:
aaf2.components.CommentMarker
-
class_id
= 0d010101-0101-4100-060e-2b3402060101¶
-
aaf2.content module¶
-
class
aaf2.content.
Header
(*args, **kwargs)¶ Bases:
aaf2.core.AAFObject
-
class_id
= 0d010101-0101-2f00-060e-2b3402060101¶
-
-
class
aaf2.content.
ContentStorage
(*args, **kwargs)¶ Bases:
aaf2.core.AAFObject
This object has all
Mob
andEssenceData
objects in the file-
class_id
= 0d010101-0101-1800-060e-2b3402060101¶
-
mobs
¶ Access to all the
Mobs
objects in the aaf file.
-
toplevel
()¶ Convenience generator method that yields only TopLevel
aaf2.mobs.CompositionMob
objects.
-
mastermobs
()¶ Convenience generator method that yields only
aaf2.mobs.MasterMob
objects.
-
compositionmobs
()¶ Convenience generator method that yields only
aaf2.mobs.CompositionMob
objects.
-
sourcemobs
()¶ Convenience generator method that yields only
aaf2.mobs.SourceMob
objects.
-
link_external_mxf
(path)¶
-
link_external_wav
(metadata)¶ Create a link source MOB to a wav file, along with a corresponding master MOB and tape MOB.
Returns a 3-tuple: a master mob, the source MOB whose essence is a WAVEDescriptor link, and a source MOB whose essence is a TapeDescriptor.
-
create_ama_link
(path, metadata)¶
-
essencedata
¶ Access to
aaf2.essence.EssenceData
objects in the aaf file.
-
aaf2.core module¶
-
class
aaf2.core.
AAFObject
(*args, **kwargs)¶ Bases:
object
-
classdef
¶
-
name
¶
-
unique_property
¶
-
unique_key
¶
-
read_properties
()¶
-
validate
()¶
-
write_properties
(validate=True)¶
-
detach
(delete=False)¶
-
attach
(dir_entry)¶
-
walk_references
(topdown=False)¶
-
copy
(new_dir=None, root=None, classdef_cache=None)¶
-
properties
()¶
-
allkeys
()¶
-
keys
()¶
-
get
(key, default=None, allkeys=True)¶
-
getvalue
(key, default=None)¶
-
dump
(space='')¶
-
class_id
¶
-
dir
¶
-
property_entries
¶
-
root
¶
-
aaf2.dictionary module¶
-
aaf2.dictionary.
short_name
(name)¶
-
aaf2.dictionary.
lookup_def
(dictionary, name, instance_type, key)¶
-
class
aaf2.dictionary.
DefinitionObject
(auid=None, name=None, description=None)¶ Bases:
aaf2.core.AAFObject
-
class_id
= 0d010101-0101-1a00-060e-2b3402060101¶
-
name
¶
-
short_name
¶
-
description
¶
-
auid
¶
-
uuid
¶
-
unique_key
¶
-
-
class
aaf2.dictionary.
DataDef
(auid=None, name=None, description=None)¶ Bases:
aaf2.dictionary.DefinitionObject
-
class_id
= 0d010101-0101-1b00-060e-2b3402060101¶
-
-
class
aaf2.dictionary.
OperationDef
(auid=None, name=None, description=None)¶ Bases:
aaf2.dictionary.DefinitionObject
-
class_id
= 0d010101-0101-1c00-060e-2b3402060101¶
-
datadef
¶
-
media_kind
¶
-
parameters
¶
-
number_inputs
¶
-
-
class
aaf2.dictionary.
ParameterDef
(auid=None, name=None, description=None, typedef=None)¶ Bases:
aaf2.dictionary.DefinitionObject
-
class_id
= 0d010101-0101-1d00-060e-2b3402060101¶
-
typedef
¶
-
-
class
aaf2.dictionary.
PluginDef
(auid=None, name=None, description=None)¶ Bases:
aaf2.dictionary.DefinitionObject
-
class_id
= 0d010101-0101-1e00-060e-2b3402060101¶
-
-
class
aaf2.dictionary.
CodecDef
(dictionary, auid=None, name=None, description=None, classdef=None, datadef_names=None)¶ Bases:
aaf2.dictionary.DefinitionObject
-
class_id
= 0d010101-0101-1f00-060e-2b3402060101¶
-
-
class
aaf2.dictionary.
ContainerDef
(auid=None, name=None, description=None)¶ Bases:
aaf2.dictionary.DefinitionObject
-
class_id
= 0d010101-0101-2000-060e-2b3402060101¶
-
-
class
aaf2.dictionary.
InterpolationDef
(auid=None, name=None, description=None)¶ Bases:
aaf2.dictionary.DefinitionObject
-
class_id
= 0d010101-0101-2100-060e-2b3402060101¶
-
-
class
aaf2.dictionary.
TaggedValueDef
(auid=None, name=None, description=None)¶ Bases:
aaf2.dictionary.DefinitionObject
-
class_id
= 0d010101-0101-4c00-060e-2b3402060101¶
-
-
class
aaf2.dictionary.
Dictionary
¶ Bases:
aaf2.core.AAFObject
-
class_id
= 0d010101-0101-2200-060e-2b3402060101¶
-
setup_defaults
()¶
-
register_def
(defobject)¶
-
lookup_typedef
(name)¶
-
lookup_datadef
(name)¶
-
lookup_containerdef
(name)¶
-
lookup_codecdef
(name)¶
-
lookup_parameterdef
(name)¶
-
lookup_operationdef
(name)¶
-
lookup_interperlationdef
(name)¶
-
lookup_taggedvaluedef
(name)¶
-
update
(other)¶
-
aaf2.essence module¶
-
class
aaf2.essence.
EssenceData
(*args, **kwargs)¶ Bases:
aaf2.core.AAFObject
-
class_id
= 0d010101-0101-2300-060e-2b3402060101¶
-
unique_key
¶
-
mob_id
¶
-
mob
¶
-
open
(mode='r')¶
-
-
class
aaf2.essence.
EssenceDescriptor
(*args, **kwargs)¶ Bases:
aaf2.core.AAFObject
-
class_id
= 0d010101-0101-2400-060e-2b3402060101¶
-
locator
¶
-
-
class
aaf2.essence.
FileDescriptor
(*args, **kwargs)¶ Bases:
aaf2.essence.EssenceDescriptor
-
class_id
= 0d010101-0101-2500-060e-2b3402060101¶
-
length
¶
-
-
class
aaf2.essence.
DigitalImageDescriptor
(*args, **kwargs)¶ Bases:
aaf2.essence.FileDescriptor
-
class_id
= 0d010101-0101-2700-060e-2b3402060101¶
-
-
class
aaf2.essence.
CDCIDescriptor
(*args, **kwargs)¶ Bases:
aaf2.essence.DigitalImageDescriptor
-
class_id
= 0d010101-0101-2800-060e-2b3402060101¶
-
-
class
aaf2.essence.
RGBADescriptor
(*args, **kwargs)¶ Bases:
aaf2.essence.DigitalImageDescriptor
-
class_id
= 0d010101-0101-2900-060e-2b3402060101¶
-
pixel_layout
¶
-
-
class
aaf2.essence.
TapeDescriptor
(*args, **kwargs)¶ Bases:
aaf2.essence.EssenceDescriptor
-
class_id
= 0d010101-0101-2e00-060e-2b3402060101¶
-
-
class
aaf2.essence.
SoundDescriptor
(*args, **kwargs)¶ Bases:
aaf2.essence.FileDescriptor
-
class_id
= 0d010101-0101-4200-060e-2b3402060101¶
-
-
class
aaf2.essence.
WAVEDescriptor
(*args, **kwargs)¶ Bases:
aaf2.essence.FileDescriptor
-
class_id
= 0d010101-0101-2c00-060e-2b3402060101¶
-
-
class
aaf2.essence.
AIFCDescriptor
(*args, **kwargs)¶ Bases:
aaf2.essence.FileDescriptor
-
class_id
= 0d010101-0101-2600-060e-2b3402060101¶
-
-
class
aaf2.essence.
DataEssenceDescriptor
(*args, **kwargs)¶ Bases:
aaf2.essence.FileDescriptor
-
class_id
= 0d010101-0101-4300-060e-2b3402060101¶
-
-
class
aaf2.essence.
MultipleDescriptor
(*args, **kwargs)¶ Bases:
aaf2.essence.FileDescriptor
-
class_id
= 0d010101-0101-4400-060e-2b3402060101¶
-
-
class
aaf2.essence.
PCMDescriptor
(*args, **kwargs)¶ Bases:
aaf2.essence.SoundDescriptor
-
class_id
= 0d010101-0101-4800-060e-2b3402060101¶
-
-
class
aaf2.essence.
PhysicalDescriptor
(*args, **kwargs)¶ Bases:
aaf2.essence.EssenceDescriptor
-
class_id
= 0d010101-0101-4900-060e-2b3402060101¶
-
-
class
aaf2.essence.
ImportDescriptor
(*args, **kwargs)¶ Bases:
aaf2.essence.PhysicalDescriptor
-
class_id
= 0d010101-0101-4a00-060e-2b3402060101¶
-
aaf2.exceptions module¶
-
exception
aaf2.exceptions.
AAFError
¶ Bases:
Exception
-
exception
aaf2.exceptions.
AAFAttachError
¶ Bases:
aaf2.exceptions.AAFError
-
exception
aaf2.exceptions.
AAFPropertyError
¶ Bases:
aaf2.exceptions.AAFError
-
exception
aaf2.exceptions.
CompoundFileBinaryError
¶ Bases:
aaf2.exceptions.AAFError
aaf2.file module¶
-
class
aaf2.file.
AAFFactory
(root)¶ Bases:
object
-
from_name
(name, *args, **kwargs)¶
-
create_instance
(*args, **kwargs)¶
-
-
class
aaf2.file.
AAFObjectManager
(root)¶ Bases:
object
-
create_temp_dir
()¶
-
remove_temp
()¶
-
add_modified
(obj)¶
-
pop
(path, default=None)¶
-
read_object
(path)¶
-
write_objects
()¶
-
-
class
aaf2.file.
AAFFile
(path=None, mode='r', sector_size=4096, extensions=True, buffering=8192)¶ Bases:
object
AAF File Object. This is the entry point object for most of the API. This object is designed to be like python’s native open function. It is recommended to create this object with the aaf.open alias. It is also highly recommended to use the with statement.
Warning
If an exception is raised inside the with block and the file was opened as writable, the final file should be considered bad or corrupted.
Take this snippet as an example:
try: with aaf.open('/path/to/aaf_file.aaf', 'r+') as f: raise ValueError('asd') except: pass
in this case, even if the exception is properly handled, the content of
/path/to/aaf_file.aaf
shouldn’t be trusted anymore.For example. Opening existing AAF file readonly:
with aaf.open('/path/to/aaf_file.aaf', 'r') as f:
Opening new AAF file overwriting existing one:
with aaf.open('/path/to/aaf_file.aaf', 'w') as f:
Opening existing AAF in read and write:
with aaf.open('/path/to/aaf_file.aaf', 'rw') as f:
Opening in memory BytesIO file:
with aaf.open() as f:
-
header
¶ aaf2.content.Header
object for AAF file.
-
content
¶ aaf2.content.ContentStorage
object for AAF File. This has the Mob and EssenceData objects.
-
dictionary
¶ aaf2.dictionary.Dictionary
for AAF file. The dictionary property has DefinitionObject objects.
-
setup_empty
()¶
-
writeable
¶
-
resovle_weakref
(index, ref_pid, ref)¶
-
weakref_prop
(index)¶
-
weakref_index
(pid_path)¶
-
read_reference_properties
()¶
-
write_reference_properties
()¶
-
dump
()¶
-
save
()¶ Writes current changes to disk and flushes modified objects in the AAFObjectManager
-
close
()¶ Close the file. A closed file cannot be read or written any more.
-
aaf2.interpolation module¶
-
aaf2.interpolation.
lerp
(a, b, t)¶
-
aaf2.interpolation.
cubic_bezier
(p0, p1, p2, p3, t)¶
-
aaf2.interpolation.
valid_root
(v)¶
-
aaf2.interpolation.
cube_root
(x)¶
-
aaf2.interpolation.
bezier_cubic_roots
(pa, pb, pc, pd)¶
-
aaf2.interpolation.
scale_handle
(p0, p1, p2)¶
-
aaf2.interpolation.
bezier_interpolate
(p0, p1, p2, p3, x)¶
-
aaf2.interpolation.
bezier_interpolate_old
(p0, p1, p2, p3, t)¶
-
aaf2.interpolation.
sign_no_zero
(v)¶
-
aaf2.interpolation.
calculate_tangent
(p0, p1, p2, in_tangent=False)¶
-
aaf2.interpolation.
cubic_interpolate
(p0, p1, p2, p3, t)¶
-
aaf2.interpolation.
mc_trapezoidal_integrate
(value_at_func, a, b, n=5)¶
-
aaf2.interpolation.
integrate_iter
(value_at_func, start, end)¶
aaf2.metadict module¶
-
class
aaf2.metadict.
PropertyDef
(*args, **kwargs)¶ Bases:
aaf2.core.AAFObject
-
class_id
= 0d010101-0202-0000-060e-2b3402060101¶
-
property_name
¶
-
unique_key
¶
-
unique
¶
-
pid
¶
-
auid
¶
-
uuid
¶
-
optional
¶
-
typedef_id
¶
-
typedef
¶
-
store_format
¶
-
-
class
aaf2.metadict.
ClassDef
(*args, **kwargs)¶ Bases:
aaf2.core.AAFObject
-
class_id
= 0d010101-0201-0000-060e-2b3402060101¶
-
auid
¶
-
uuid
¶
-
concrete
¶
-
class_name
¶
-
unique_key
¶
-
unique_key_pid
¶
-
unique_key_size
¶
-
isinstance
(other)¶
-
name
¶
-
classdef
¶
-
parent_id
¶
-
parent
¶
-
propertydefs
¶
-
lookup_propertydef
(property_auid)¶
-
register_propertydef
(name, property_auid, pid, typedef, optional, unique=False)¶
-
relatives
()¶
-
all_propertydefs
()¶
-
get_propertydef_from_pid
(pid, default=None)¶
-
propertydef_by_pid
¶
-
-
class
aaf2.metadict.
MetaDictionary
(root)¶ Bases:
aaf2.core.AAFObject
-
class_id
= 0d010101-0225-0000-060e-2b3402060101¶
-
register_typedef_model
(typedef_model)¶
-
register_extensions
()¶
-
register_classdef
(name, class_auid, parent, concrete, propertydefs=None)¶
-
register_external_typedef
(ext_typedef)¶
-
register_external_classdef
(ext_classdef)¶
-
lookup_class
(class_id)¶
-
lookup_typedef
(t)¶
-
lookup_classdef
(t)¶
-
classdef
¶
-
next_free_pid
()¶
-
read_properties
()¶
-
aaf2.misc module¶
-
class
aaf2.misc.
TaggedValueHelper
(poperty_vector)¶ Bases:
object
-
get
(key, default=None)¶
-
items
()¶
-
append
(value)¶
-
-
class
aaf2.misc.
TaggedValue
(name=None, value=None, value_typedef=None)¶ Bases:
aaf2.core.AAFObject
-
class_id
= 0d010101-0101-3f00-060e-2b3402060101¶
-
name
¶
-
value
¶
-
value_typedef
¶
-
encode_value
(value, value_typedef=None)¶
-
-
class
aaf2.misc.
Parameter
(*args, **kwargs)¶ Bases:
aaf2.core.AAFObject
-
class_id
= 0d010101-0101-3c00-060e-2b3402060101¶
-
auid
¶
-
parameterdef
¶
-
name
¶
-
unique_property
¶
-
unique_key
¶
-
-
class
aaf2.misc.
ConstantValue
(parameterdef=None, value=None)¶ Bases:
aaf2.misc.Parameter
-
class_id
= 0d010101-0101-3d00-060e-2b3402060101¶
-
typedef
¶
-
value_at
(t)¶
-
value
¶
-
-
class
aaf2.misc.
VaryingValue
(parameterdef=None, interperlationdef=None)¶ Bases:
aaf2.misc.Parameter
-
class_id
= 0d010101-0101-3e00-060e-2b3402060101¶
-
interpolationdef
¶
-
interpolation
¶
-
pointlist
¶
-
typedef
¶
-
add_keyframe
(time, value, edit_hint=None)¶
-
value_at
(t)¶
-
nearest_index
(t)¶ binary search for index of point.time <= t
-
-
class
aaf2.misc.
ControlPoint
(*args, **kwargs)¶ Bases:
aaf2.core.AAFObject
-
class_id
= 0d010101-0101-1900-060e-2b3402060101¶
-
time
¶
-
value
¶
-
point_properties
¶
-
base_frame
¶
-
tangents
¶
-
-
aaf2.misc.
generate_offset_map
(speed_map, start=0, end=None)¶
aaf2.mobid module¶
Excerpt from SMPTE ST 330 (Focus on Basic UMID):
5 General Specification
A unique material identifier (UMID) provides for the globally unique identification of any audiovisual material.
This standard defines a dual approach through the specification of a basic UMID and an extended UMID.
The basic UMID provides a globally unique identification for audiovisual material that comprises an integer
number of one or more contiguous material units. The basic UMID has no embedded mechanism to
distinguish between individual material units within a single instance of audiovisual material. The data in the
basic UMID can be created through automatic generation.
The extended UMID comprises the basic UMID followed immediately by a source pack that provides a
signature for material units. The source pack comprises a fixed length metadata pack of 32 bytes that
provides sufficient metadata by which source ?when, where and who (or what)? information can be identified
regardless of current ownership or status. The extended UMID also provides a mechanism to distinguish
between individual material units within a single instance of audiovisual material.
The basic UMID is 32 bytes long and the extended UMID is 64 bytes long.
Both UMID types use the key-length-value construct defined by SMPTE ST 336. The key is a 16-byte
universal label truncated to 12 bytes.
In the case of the basic UMID, the length field has a value of 13h and the value is formed by the combination
of a material number and an instance number.
In the case of the extended UMID, the length field has a value of 33h and the value is formed by the
combination of the material and the instance numbers followed by the source pack.
All components of the UMID have a defined byte order for consistent application in storage and streaming
environments.
The components of the basic UMID are:
1. A 12-byte universal label,
2. A 1-byte length value,
3. A 3-byte instance number, and
4. A 16-byte material number.
The combination of the instance and material numbers can be treated as a dumb number.
Note: The material number does not indicate the status of the material (such as copy number) or its representation
(such as the compression kind). The material number can be identical in copies and in different representations of
the material. The purpose of the instance number is to separately identify different representations or instances of
audiovisual material. Thus, for example, a high-resolution picture and a thumbnail can both have the same
material number because they both represent the same picture but, because they are different instances, they will
have different instance numbers for the different representations. Guidance for the consistent application of new
material numbers and instance numbers is given in SMPTE RP 205.
UMID universal label (SMPTELabel)
Byte No. Description Value (hex) Meaning
----------------------------------------------------------------------------------------
1 Object identifier 06h Universal label start
2 Label size 0Ah 12-byte Universal label
3 Designation: ISO 2Bh ISO registered
4 Designation: SMPTE 34h SMPTE registered
5 Registry category 01h Dictionaries
6 Specific category 01h Metadata dictionaries
7 Structure 01h Dictionary standard (SMPTE ST 335)
8 Version number 05h Version of the metadata dictionary (defined in SMPTE RP 210)
9 Class 01h Identifiers and locators
10 Subclass 01h Globally unique identifiers
11 Material type XXh See Section 6.1.2.1
12 Number creation method YYh See Section 6.1.2.2
6.1.2.1 - Material type identification
Byte 11 of the UL shall define the material type being identified using one of the values defined in Table 2.
The use of material types '01h', '02h', '03h' and '04h' shall be deprecated for use in implementations using
this revised standard. These values are preserved only for compatibility with systems implemented using
SMPTE ST 330:2000#
Table 2
Byte value Meaning Examples and notes
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
01h picture material Deprecated
02h audio material Deprecated
03h data material Deprecated
04h other material Deprecated (originally not only picture, audio, or data material, but also a combination of material types)
05h single picture component e.g. Y component
06h Two or more picture components in a single container e.g. interleaved Y, Cb and Cr components
08h single audio component e.g mono audio
09h two or more audio components in a single container e.g. AES3 audio pair
0Bh single auxiliary (or data) component e.g. sub-titles only
0Ch two or more auxiliary (or data) components in a single container e.g. multiple sub-titles streams in different languages
0Dh mixed group of components in a single container e.g. video & stereo audio pair
0Fh material type is not identified
6.1.2.2 Number creation method identification
Byte 12 of the UL shall define the method by which the material and instance numbers are created. This byte
is divided into top and bottom nibbles for the purpose of this definition.
The top nibble shall occupy the 4 most significant bits (MSBs) of the byte and the value shall be used to
define the method of material number creation. The values used by this nibble shall be limited to the range 0
to 7h so that byte 12 conforms to the ASN.1 BER short form coding rules used by SMPTE ST 298.
The methods of material number generation shall be as defined in table 3 and the specification of the each
method shall be as defined in Annex A.
Note: New material number generation methods can be added by amendment or revision of this document. Each
addition will provide the proposed value (within the range of values currently identified as "Reserved but not
defined") for inclusion in Table 3 together with the supporting definition to be added to Annex A.
Table 3 - Identification of material number generation method::
Value (hex) Method
-------------------------------------------------------------
0 No defined method
1 SMPTE method
2 UUID/UL method
3 Masked method
4 IEEE 1394 network method
5~7 Reserved but not defined
Notes from Pixar 10/30/17
Final note of discussion with Avid engineers how the top nibble in the 12th byte in the SMPTELabel should be set. (In the past we always had it set to 00, i.e. “no defined method”, we had some confusion about how to set it when using a uuid for the material)
Avid Engineer:
“The specification of number creation identification is very clear about using the 4 MSBs for the material number so I am pretty sure that the numbers in the sub-titles of Annex A (e.g. 02h) should not be interpreted literally as values of byte 12. 20h is the correct value of the byte 12 for UL/UUID method/No defined method.
By the way, I don’t see anything wrong with setting byte 12 to 00h (No defined method / No defined method)”
We at Pixar decided to set the byte to 20h, since it (even if already very minimal) completely eliminates the possibility to collide with any MOB ID created by our old MOB ID generation algorithm.
-
aaf2.mobid.
UniqueMobID
()¶
-
class
aaf2.mobid.
MobID
(mobid=None, bytes_le=None, int=None)¶ Bases:
object
-
bytes_le
¶
-
static
new
()¶ Static method for generating unique MobIDs. Uses uuid.uuid4() for generation.
-
material
¶ MobID material representation as a UUID
-
SMPTELabel
¶
-
length
¶
-
instanceHigh
¶
-
instanceMid
¶
-
instanceLow
¶
-
Data1
¶
-
Data2
¶
-
Data3
¶
-
Data4
¶
-
from_dict
(d)¶ Set MobID from a dict
-
to_dict
()¶ MobID representation as dict
-
int
¶ MobID representation as a int
-
urn
¶ MobID Uniform Resource Name representation. https://en.wikipedia.org/wiki/Uniform_Resource_Name
-
aaf2.mobs module¶
-
class
aaf2.mobs.
Mob
(name=None)¶ Bases:
aaf2.core.AAFObject
Base Class for All Mob Objects
-
class_id
= 0d010101-0101-3400-060e-2b3402060101¶
-
unique_key
¶
-
name
¶
-
mob_id
¶ The unique Mob ID associated with this mob. Get Returns
aaf2.mobid.MobID
Object
-
usage
¶
-
comments
¶
-
slots
¶
-
slot_at
(slot_id)¶
-
create_timeline_slot
(edit_rate, slot_id=None)¶
-
create_empty_sequence_slot
(edit_rate, slot_id=None, media_kind=None)¶ Create an empty timeline slot and sets its segment to a new, empty aaf2.components.Sequence component. Timeline slots are for continuous, monotonically-changing media, like picture and sound.
-
create_picture_slot
(edit_rate=25)¶ Create an empty timeline slot, with the ‘picture’ media kind, and sets its segment to a new, empty aaf2.components.Sequence component.
-
create_sound_slot
(edit_rate=25)¶ Create an empty timeline slot, with the ‘sound’ media kind, and sets its segment to a new, empty aaf2.components.Sequence component.
-
create_source_clip
(slot_id=None, start=None, length=None, media_kind=None)¶ Create a SourceClip of Mobs slot with slot_id. If no length given the default length will be the full length of slots segment minus start. Returns
aaf2.components.SourceClip
Object
-
dependant_mobs
()¶ Yields all mobs that this mob is dependant on in depth first order.
-
-
class
aaf2.mobs.
CompositionMob
(name=None)¶ Bases:
aaf2.mobs.Mob
-
class_id
= 0d010101-0101-3500-060e-2b3402060101¶
-
-
class
aaf2.mobs.
MasterMob
(name=None)¶ Bases:
aaf2.mobs.Mob
-
class_id
= 0d010101-0101-3600-060e-2b3402060101¶
-
import_dnxhd_essence
(path, edit_rate, tape=None, length=None, offline=False)¶ Import video essence from raw DNxHD/DNxHR stream
-
import_audio_essence
(path, edit_rate=None, tape=None, length=None, offline=False)¶ Import audio essence from wav file
-
-
class
aaf2.mobs.
SourceMob
(name=None)¶ Bases:
aaf2.mobs.Mob
-
class_id
= 0d010101-0101-3700-060e-2b3402060101¶
-
descriptor
¶
-
create_essence
(edit_rate=None, media_kind='picture', slot_id=None, offline=False)¶
-
create_empty_slot
(edit_rate=None, media_kind='picture', slot_id=None)¶
-
create_timecode_slot
(edit_rate, timecode_fps, drop_frame=False, length=None)¶
-
create_tape_slots
(tape_name, edit_rate, timecode_fps, drop_frame=False, media_kind=None, length=None)¶
-
import_rawvideo_essence
(path, edit_rate, width, height, pixel_layout, tape=None)¶
-
import_dnxhd_essence
(path, edit_rate, tape=None, length=None, offline=False)¶ Import video essence from raw DNxHD/DNxHR stream
-
import_audio_essence
(path, edit_rate=None, tape=None, length=None, offline=False)¶ Import audio essence from wav file
-
export_audio
(path)¶
-
essence
¶
-
aaf2.mobslots module¶
-
class
aaf2.mobslots.
MobSlot
(slot_id=None, name=None, segment=None)¶ Bases:
aaf2.core.AAFObject
-
class_id
= 0d010101-0101-3800-060e-2b3402060101¶
-
segment
¶
-
name
¶
-
datadef
¶
-
media_kind
¶
-
slot_id
¶
-
length
¶
-
-
class
aaf2.mobslots.
EventMobSlot
(slot_id=None, name=None, segment=None)¶ Bases:
aaf2.mobslots.MobSlot
-
class_id
= 0d010101-0101-3900-060e-2b3402060101¶
-
edit_rate
¶
-
-
class
aaf2.mobslots.
TimelineMobSlot
(slot_id=None, name=None, segment=None, origin=None, edit_rate=None)¶ Bases:
aaf2.mobslots.MobSlot
-
class_id
= 0d010101-0101-3b00-060e-2b3402060101¶
-
origin
¶
-
edit_rate
¶
-
length
¶
-
-
class
aaf2.mobslots.
StaticMobSlot
(slot_id=None, name=None, segment=None)¶ Bases:
aaf2.mobslots.MobSlot
-
class_id
= 0d010101-0101-3a00-060e-2b3402060101¶
-
aaf2.mxf module¶
-
aaf2.mxf.
register_mxf_class
(classobj)¶
-
class
aaf2.mxf.
MXFRef
(hex=None, bytes_le=None, bytes_be=None, int=None)¶ Bases:
aaf2.auid.AUID
-
class
aaf2.mxf.
MXFRefArray
¶ Bases:
list
-
aaf2.mxf.
read_auid_be
(f)¶
-
aaf2.mxf.
read_strongref
(f)¶
-
aaf2.mxf.
decode_strong_ref_array
(f)¶
-
aaf2.mxf.
decode_utf16be
(data)¶
-
aaf2.mxf.
decode_auid
(data)¶
-
aaf2.mxf.
reverse_auid
(data)¶
-
aaf2.mxf.
decode_datadef
(data)¶
-
aaf2.mxf.
decode_strongref
(data)¶
-
aaf2.mxf.
decode_indirect_value
(data)¶
-
aaf2.mxf.
decode_rational
(f)¶
-
aaf2.mxf.
decode_video_line_map
(f)¶
-
aaf2.mxf.
decode_pixel_layout
(f)¶
-
aaf2.mxf.
decode_timestamp
(f)¶
-
aaf2.mxf.
decode_mob_id
(data)¶
-
aaf2.mxf.
ama_path
(path)¶
-
class
aaf2.mxf.
MXFObject
¶ Bases:
object
-
create_aaf_instance
()¶
-
read_tag
(tag, data)¶
-
read_properties
(f, length, local_tags)¶
-
resolve_ref
(key)¶
-
iter_strong_refs
(key)¶
-
-
class
aaf2.mxf.
MXFPreface
¶ Bases:
aaf2.mxf.MXFObject
-
class_id
= 060e2b34-0253-0101-0d01-010101012f00¶
-
read_tag
(tag, data)¶
-
-
class
aaf2.mxf.
MXFContentStorage
¶ Bases:
aaf2.mxf.MXFObject
-
class_id
= 060e2b34-0253-0101-0d01-010101011800¶
-
read_tag
(tag, data)¶
-
-
class
aaf2.mxf.
MXFPackage
¶ Bases:
aaf2.mxf.MXFObject
-
read_tag
(tag, data)¶
-
mob_id
¶
-
link
()¶
-
-
class
aaf2.mxf.
MXFMaterialPackage
¶ Bases:
aaf2.mxf.MXFPackage
-
class_id
= 060e2b34-0253-0101-0d01-010101013600¶
-
create_aaf_instance
()¶
-
-
class
aaf2.mxf.
MXFSourcePackage
¶ Bases:
aaf2.mxf.MXFPackage
-
class_id
= 060e2b34-0253-0101-0d01-010101013700¶
-
create_aaf_instance
()¶
-
-
class
aaf2.mxf.
MXFTrack
¶ Bases:
aaf2.mxf.MXFObject
-
class_id
= 060e2b34-0253-0101-0d01-010101013b00¶
-
create_aaf_instance
()¶
-
read_tag
(tag, data)¶
-
link
()¶
-
-
class
aaf2.mxf.
MXFStaticTrack
¶ Bases:
aaf2.mxf.MXFTrack
-
class_id
= 060e2b34-0253-0101-0d01-010101013a00¶
-
create_aaf_instance
()¶
-
-
class
aaf2.mxf.
MXFEventTrack
¶ Bases:
aaf2.mxf.MXFTrack
-
class_id
= 060e2b34-0253-0101-0d01-010101013900¶
-
create_aaf_instance
()¶
-
-
class
aaf2.mxf.
MXFComponent
¶ Bases:
aaf2.mxf.MXFObject
-
read_tag
(tag, data)¶
-
-
class
aaf2.mxf.
MXFSequence
¶ Bases:
aaf2.mxf.MXFComponent
-
class_id
= 060e2b34-0253-0101-0d01-010101010f00¶
-
create_aaf_instance
()¶
-
link
()¶
-
-
class
aaf2.mxf.
MXFSourceClip
¶ Bases:
aaf2.mxf.MXFComponent
-
class_id
= 060e2b34-0253-0101-0d01-010101011100¶
-
create_aaf_instance
()¶
-
link
()¶
-
-
class
aaf2.mxf.
MXFTimecode
¶ Bases:
aaf2.mxf.MXFComponent
-
class_id
= 060e2b34-0253-0101-0d01-010101011400¶
-
create_aaf_instance
()¶
-
link
()¶
-
-
class
aaf2.mxf.
MXFPulldown
¶ Bases:
aaf2.mxf.MXFComponent
-
class_id
= 060e2b34-0253-0101-0d01-010101010c00¶
-
create_aaf_instance
()¶
-
link
()¶
-
-
class
aaf2.mxf.
MXFFiller
¶ Bases:
aaf2.mxf.MXFComponent
-
class_id
= 060e2b34-0253-0101-0d01-010101010900¶
-
create_aaf_instance
()¶
-
link
()¶
-
-
class
aaf2.mxf.
MXFScopeReference
¶ Bases:
aaf2.mxf.MXFComponent
-
class_id
= 060e2b34-0253-0101-0d01-010101010d00¶
-
create_aaf_instance
()¶
-
link
()¶
-
-
class
aaf2.mxf.
MXFEssenceGroup
¶ Bases:
aaf2.mxf.MXFComponent
-
class_id
= 060e2b34-0253-0101-0d01-010101010500¶
-
create_aaf_instance
()¶
-
link
()¶
-
-
class
aaf2.mxf.
MXFDescriptor
¶ Bases:
aaf2.mxf.MXFObject
-
read_tag
(tag, data)¶
-
-
class
aaf2.mxf.
MXFMultipleDescriptor
¶ Bases:
aaf2.mxf.MXFDescriptor
-
class_id
= 060e2b34-0253-0101-0d01-010101014400¶
-
create_aaf_instance
()¶
-
link
()¶
-
-
class
aaf2.mxf.
MXFCDCIDescriptor
¶ Bases:
aaf2.mxf.MXFDescriptor
-
class_id
= 060e2b34-0253-0101-0d01-010101012800¶
-
create_aaf_instance
()¶
-
link
()¶
-
-
class
aaf2.mxf.
MXFRGBADescriptor
¶ Bases:
aaf2.mxf.MXFDescriptor
-
class_id
= 060e2b34-0253-0101-0d01-010101012900¶
-
create_aaf_instance
()¶
-
link
()¶
-
-
class
aaf2.mxf.
MXFANCDataDescriptor
¶ Bases:
aaf2.mxf.MXFDescriptor
-
class_id
= 060e2b34-0253-0101-0d01-010101015c00¶
-
create_aaf_instance
()¶
-
link
()¶
-
-
class
aaf2.mxf.
MXFMPEG2VideoDescriptor
¶ Bases:
aaf2.mxf.MXFCDCIDescriptor
-
class_id
= 060e2b34-0253-0101-0d01-010101015100¶
-
link
()¶
-
-
class
aaf2.mxf.
MXFPCMDescriptor
¶ Bases:
aaf2.mxf.MXFDescriptor
-
class_id
= 060e2b34-0253-0101-0d01-010101014800¶
-
create_aaf_instance
()¶
-
link
()¶
-
-
class
aaf2.mxf.
MXFAES3AudioDescriptor
¶ Bases:
aaf2.mxf.MXFPCMDescriptor
-
class_id
= 060e2b34-0253-0101-0d01-010101014700¶
-
-
class
aaf2.mxf.
MXFSoundDescriptor
¶ Bases:
aaf2.mxf.MXFPCMDescriptor
-
class_id
= 060e2b34-0253-0101-0d01-010101014200¶
-
-
class
aaf2.mxf.
MXFImportDescriptor
¶ Bases:
aaf2.mxf.MXFDescriptor
-
class_id
= 060e2b34-0253-0101-0d01-010101014a00¶
-
create_aaf_instance
()¶
-
link
()¶
-
-
class
aaf2.mxf.
MXFTapeDescriptor
¶ Bases:
aaf2.mxf.MXFDescriptor
-
class_id
= 060e2b34-0253-0101-0d01-010101012e00¶
-
create_aaf_instance
()¶
-
link
()¶
-
-
class
aaf2.mxf.
MXFLocator
¶ Bases:
aaf2.mxf.MXFObject
-
read_tag
(tag, data)¶
-
-
class
aaf2.mxf.
MXFNetworkLocator
¶ Bases:
aaf2.mxf.MXFLocator
-
class_id
= 060e2b34-0253-0101-0d01-010101013200¶
-
create_aaf_instance
()¶
-
link
()¶
-
-
class
aaf2.mxf.
MXFEssenceData
¶ Bases:
aaf2.mxf.MXFObject
-
class_id
= 060e2b34-0253-0101-0d01-010101012300¶
-
read_tag
(tag, data)¶
-
-
class
aaf2.mxf.
MXFTaggedValue
¶ Bases:
aaf2.mxf.MXFObject
-
class_id
= 060e2b34-0253-0101-0d01-010101013f00¶
-
create_aaf_instance
()¶
-
read_tag
(tag, data)¶
-
link
()¶
-
-
aaf2.mxf.
ber_length
(f)¶
-
aaf2.mxf.
iter_kl
(f)¶
-
aaf2.mxf.
auid_to_str_list
(v, sep=', ', prefix='')¶
aaf2.properties module¶
-
aaf2.properties.
writeonly
(func)¶
-
class
aaf2.properties.
Property
(parent, pid, format, version=32)¶ Bases:
object
-
pid
¶
-
format
¶
-
version
¶
-
data
¶
-
parent
¶
-
format_name
()¶
-
attached
¶
-
writeable
¶
-
decode
()¶
-
mark_modified
()¶
-
propertydef
¶
-
unique
¶
-
name
¶
-
typedef
¶
-
copy
(parent, pid, cache=None)¶
-
value
¶
-
add_pid_entry
()¶
-
remove_pid_entry
()¶
-
-
class
aaf2.properties.
StreamProperty
(parent, pid, format, version=32)¶ Bases:
aaf2.properties.Property
-
stream_name
¶
-
dir
¶
-
copy
(parent, pid, cache)¶
-
decode
()¶
-
encode
(data)¶
-
setup_stream
()¶
-
open
(mode='r')¶
-
detach
()¶
-
attach
()¶
-
value
¶
-
-
class
aaf2.properties.
StrongRefProperty
(parent, pid, format, version=32)¶ Bases:
aaf2.properties.Property
-
ref
¶
-
objectref
¶
-
object
¶
-
copy
(parent, pid, cache)¶
-
decode
()¶
-
encode
(data)¶
-
value
¶
-
detach
()¶
-
attach
()¶
-
-
class
aaf2.properties.
StrongRefVectorProperty
(parent, pid, format, version=32)¶ Bases:
aaf2.properties.Property
-
references
¶
-
next_free_key
¶
-
last_free_key
¶
-
objects
¶
-
copy
(parent, pid, cache)¶
-
index_name
¶
-
encode
(data)¶
-
decode
()¶
-
read_index
()¶
-
write_index
(*args, **kwargs)¶
-
ref_classdef
¶
-
index_ref_name
(index)¶
-
get
(index, default=None)¶
-
clear
(*args, **kwargs)¶
-
pop
(*args, **kwargs)¶
-
insert
(*args, **kwargs)¶
-
extend
(*args, **kwargs)¶
-
append
(value)¶
-
value
¶
-
detach
()¶
-
attach
()¶
-
-
class
aaf2.properties.
StrongRefSetProperty
(parent, pid, format, version=32)¶ Bases:
aaf2.properties.Property
-
references
¶
-
index_name
¶
-
next_free_key
¶
-
last_free_key
¶
-
key_pid
¶
-
key_size
¶
-
objects
¶
-
copy
(parent, pid, cache)¶
-
encode
(data)¶
-
decode
()¶
-
read_index
()¶
-
write_index
(*args, **kwargs)¶
-
index_ref_name
(key)¶
-
read_object
(key)¶
-
items
()¶
-
values
()¶
-
get
(key, default=None)¶
-
swap_unique_key
(*args, **kwargs)¶
-
extend
(*args, **kwargs)¶
-
append
(value)¶
-
clear
(*args, **kwargs)¶
-
pop
(*args, **kwargs)¶
-
value
¶
-
detach
()¶
-
attach
()¶
-
-
aaf2.properties.
resolve_weakref
(p, ref)¶
-
class
aaf2.properties.
WeakRefProperty
(parent, pid, format, version=32)¶ Bases:
aaf2.properties.Property
-
weakref_index
¶
-
key_pid
¶
-
key_size
¶
-
ref
¶
-
copy
(parent, pid, cache)¶
-
decode
()¶
-
encode
()¶
-
ref_classdef
¶
-
pid_path
¶
-
value
¶
-
-
class
aaf2.properties.
WeakRefArrayProperty
(parent, pid, format, version=32)¶ Bases:
aaf2.properties.Property
-
references
¶
-
index_name
¶
-
weakref_index
¶
-
key_pid
¶
-
key_size
¶
-
copy
(parent, pid, cache)¶
-
encode
(data)¶
-
decode
()¶
-
read_index
()¶
-
write_index
(*args, **kwargs)¶
-
ref_classdef
¶
-
pid_path
¶
-
get
(key, default=None)¶
-
items
()¶
-
extend
(*args, **kwargs)¶
-
append
(value)¶
-
clear
(*args, **kwargs)¶
-
value
¶
-
-
class
aaf2.properties.
WeakRefVectorProperty
(parent, pid, format, version=32)¶
-
class
aaf2.properties.
WeakRefSetProperty
(parent, pid, format, version=32)¶
-
class
aaf2.properties.
WeakRefPropertyId
(parent, pid, format, version=32)¶
-
class
aaf2.properties.
UniqueIdProperty
(parent, pid, format, version=32)¶ Bases:
aaf2.properties.Property
-
class
aaf2.properties.
OpaqueStreamProperty
(parent, pid, format, version=32)¶ Bases:
aaf2.properties.Property
-
aaf2.properties.
add_string_property
(parent, pid, value)¶
-
aaf2.properties.
add_bool_property
(parent, pid, value)¶
-
aaf2.properties.
add_u32le_property
(parent, pid, value)¶
-
aaf2.properties.
add_u16le_property
(parent, pid, value)¶
-
aaf2.properties.
add_u8_property
(parent, pid, value)¶
-
aaf2.properties.
add_auid_property
(parent, pid, value)¶
-
aaf2.properties.
add_auid_array_propertry
(parent, pid, values)¶
-
aaf2.properties.
add_utf16_array_property
(parent, pid, values)¶
-
aaf2.properties.
add_s64le_array_property
(parent, pid, values)¶
-
aaf2.properties.
add_weakref_property
(parent, pid, pid_path, key_pid, value)¶
-
aaf2.properties.
add_classdef_weakref_property
(parent, pid, value)¶
-
aaf2.properties.
add_typedef_weakref_property
(parent, pid, value)¶
-
aaf2.properties.
add_strongref_set_property
(parent, pid, property_name, unique_pid, key_size=16)¶
-
aaf2.properties.
add2set
(self, pid, key, value)¶ low level add to StrongRefSetProperty
-
aaf2.properties.
add_typedef_weakref_vector_property
(parent, pid, property_name, values)¶
aaf2.rational module¶
-
class
aaf2.rational.
AAFRational
¶ Bases:
fractions.Fraction
Subclass of fractions.Fraction from the standard library. Behaves exactly the same, except doesn’t round to the Greatest Common Divisor at the end.
aaf2.types module¶
-
class
aaf2.types.
TypeDef
(*args, **kwargs)¶ Bases:
aaf2.core.AAFObject
-
class_id
= 0d010101-0203-0000-060e-2b3402060101¶
-
copy
(root=None)¶
-
unique_key
¶
-
auid
¶
-
uuid
¶
-
type_name
¶
-
store_format
¶
-
-
class
aaf2.types.
TypeDefInt
(*args, **kwargs)¶ Bases:
aaf2.types.TypeDef
-
class_id
= 0d010101-0204-0000-060e-2b3402060101¶
-
copy
(root=None)¶
-
signed
¶
-
size
¶
-
byte_size
¶
-
pack_format
(elements=1)¶
-
decode
(data)¶
-
encode
(value)¶
-
-
class
aaf2.types.
TypeDefStrongRef
(*args, **kwargs)¶ Bases:
aaf2.types.TypeDef
-
class_id
= 0d010101-0205-0000-060e-2b3402060101¶
-
copy
(root=None)¶
-
store_format
¶
-
ref_classdef
¶
-
-
class
aaf2.types.
TypeDefWeakRef
(*args, **kwargs)¶ Bases:
aaf2.types.TypeDef
-
class_id
= 0d010101-0206-0000-060e-2b3402060101¶
-
copy
(root=None)¶
-
store_format
¶
-
ref_classdef
¶
-
path
¶
-
pid_path
¶
-
target_set_path
¶
-
propertydef_path
¶
-
-
class
aaf2.types.
TypeDefEnum
(*args, **kwargs)¶ Bases:
aaf2.types.TypeDef
-
class_id
= 0d010101-0207-0000-060e-2b3402060101¶
-
copy
(root=None)¶
-
byte_size
¶
-
elements
¶
-
element_typedef
¶
-
register_element
(element_name, element_value)¶
-
decode
(data)¶
-
encode
(data)¶
-
-
aaf2.types.
iter_utf16_array
(data)¶
-
class
aaf2.types.
TypeDefFixedArray
(*args, **kwargs)¶ Bases:
aaf2.types.TypeDef
-
class_id
= 0d010101-0208-0000-060e-2b3402060101¶
-
copy
(root=None)¶
-
element_typedef
¶
-
size
¶
-
byte_size
¶
-
decode
(data)¶
-
encode
(data)¶
-
-
class
aaf2.types.
TypeDefVarArray
(*args, **kwargs)¶ Bases:
aaf2.types.TypeDef
-
class_id
= 0d010101-0209-0000-060e-2b3402060101¶
-
copy
(root=None)¶
-
store_format
¶
-
element_typedef
¶
-
ref_classdef
¶
-
decode
(data)¶
-
encode
(value)¶
-
-
class
aaf2.types.
TypeDefSet
(*args, **kwargs)¶ Bases:
aaf2.types.TypeDef
-
class_id
= 0d010101-020a-0000-060e-2b3402060101¶
-
copy
(root=None)¶
-
element_typedef
¶
-
ref_classdef
¶
-
store_format
¶
-
decode
(data)¶
-
encode
(data)¶
-
-
class
aaf2.types.
TypeDefString
(*args, **kwargs)¶ Bases:
aaf2.types.TypeDef
-
class_id
= 0d010101-020b-0000-060e-2b3402060101¶
-
copy
(root=None)¶
-
element_typedef
¶
-
decode
(data)¶
-
encode
(data)¶
-
-
class
aaf2.types.
TypeDefStream
(*args, **kwargs)¶ Bases:
aaf2.types.TypeDef
-
class_id
= 0d010101-020c-0000-060e-2b3402060101¶
-
store_format
¶
-
-
class
aaf2.types.
TypeDefRecord
(*args, **kwargs)¶ Bases:
aaf2.types.TypeDef
-
class_id
= 0d010101-020d-0000-060e-2b3402060101¶
-
copy
(root=None)¶
-
member_names
¶
-
member_types
¶
-
fields
¶
-
byte_size
¶
-
decode
(data)¶
-
encode
(data)¶
-
-
class
aaf2.types.
TypeDefRename
(*args, **kwargs)¶ Bases:
aaf2.types.TypeDef
-
class_id
= 0d010101-020e-0000-060e-2b3402060101¶
-
copy
(root=None)¶
-
renamed_typedef
¶
-
decode
(data)¶
-
encode
(data)¶
-
-
aaf2.types.
iter_auid_array
(data)¶
-
class
aaf2.types.
TypeDefExtEnum
(*args, **kwargs)¶ Bases:
aaf2.types.TypeDef
-
class_id
= 0d010101-0220-0000-060e-2b3402060101¶
-
copy
(root=None)¶
-
register_element
(element_name, element_auid)¶
-
elements
¶
-
decode
(data)¶
-
encode
(data)¶
-
-
class
aaf2.types.
TypeDefIndirect
(*args, **kwargs)¶ Bases:
aaf2.types.TypeDef
-
class_id
= 0d010101-0221-0000-060e-2b3402060101¶
-
decode_typedef
(data)¶
-
decode
(data)¶
-
encode
(data, data_typedef=None)¶
-
-
class
aaf2.types.
TypeDefOpaque
(*args, **kwargs)¶ Bases:
aaf2.types.TypeDefIndirect
-
class_id
= 0d010101-0222-0000-060e-2b3402060101¶
-
-
class
aaf2.types.
TypeDefCharacter
(*args, **kwargs)¶ Bases:
aaf2.types.TypeDef
-
class_id
= 0d010101-0223-0000-060e-2b3402060101¶
-
-
class
aaf2.types.
TypeDefGenericCharacter
(*args, **kwargs)¶ Bases:
aaf2.types.TypeDef
-
class_id
= 0e040101-0000-0000-060e-2b3402060101¶
-
copy
(root=None)¶
-
size
¶
-
aaf2.utils module¶
-
aaf2.utils.
read_u8
(f)¶
-
aaf2.utils.
write_u8
(f, value)¶
-
aaf2.utils.
read_u16le
(f)¶
-
aaf2.utils.
read_u16be
(f)¶
-
aaf2.utils.
write_u16le
(f, value)¶
-
aaf2.utils.
read_u32le
(f)¶
-
aaf2.utils.
read_u32be
(f)¶
-
aaf2.utils.
read_s32be
(f)¶
-
aaf2.utils.
write_u32le
(f, value)¶
-
aaf2.utils.
read_u64le
(f)¶
-
aaf2.utils.
read_u64be
(f)¶
-
aaf2.utils.
read_s64be
(f)¶
-
aaf2.utils.
write_u64le
(f, value)¶
-
aaf2.utils.
decode_sid
(sid)¶
-
aaf2.utils.
read_sid
(f)¶
-
aaf2.utils.
encode_sid
(sid)¶
-
aaf2.utils.
write_sid
(f, value)¶
-
aaf2.utils.
read_filetime
(f)¶
-
aaf2.utils.
decode_utf16le
(data)¶
-
aaf2.utils.
encode_utf16le
(data)¶
-
aaf2.utils.
encode_u16le
(value)¶
-
aaf2.utils.
encode_u32le
(value)¶
-
aaf2.utils.
encode_u8
(value)¶
-
aaf2.utils.
encode_utf16_array
(data)¶
-
aaf2.utils.
encode_auid_array
(values)¶
-
aaf2.utils.
str2auid
(value)¶
-
aaf2.utils.
encode_s64le
(value)¶
-
aaf2.utils.
write_filetime
(f, value)¶
-
aaf2.utils.
unpack_u16le_from
(buffer, offset)¶
-
aaf2.utils.
unpack_u32le_from
(buffer, offset)¶
-
aaf2.utils.
unpack_u64le_from
(buffer, offset)¶
-
aaf2.utils.
int_from_bytes
(data, byte_order='big')¶
-
aaf2.utils.
bytes_from_int
(num, length, byte_order='big')¶
-
aaf2.utils.
squeeze_name
(name, size)¶
-
aaf2.utils.
mangle_name
(name, pid, size)¶
-
aaf2.utils.
safe_print
(*args)¶
-
aaf2.utils.
register_class
(classobj)¶
-
aaf2.utils.
rescale
(value, current_rate, new_rate)¶