forked from GlobalAssistant/aaf-avid
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyaaf_avb.py
More file actions
43 lines (32 loc) · 1.46 KB
/
pyaaf_avb.py
File metadata and controls
43 lines (32 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import aaf2
from aaf2.mobid import MobID
with aaf2.open("Aaf TestSeq.aaf", "r") as f:
# with aaf2.open("Youtube clips.avb.aaf", "r") as f:
print('header = ', f.header)
print('dictionary = ', f.dictionary)
# for p in f.dictionary.properties():
# print('dic = ', p.)
# 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.class_id)
mobs = f.content.mobs
for mob in mobs:
print('mob name = ', mob.name)
print('mob id = ', mob.mob_id)
if str(mob.class_id) == '0d010101-0101-3500-060e-2b3402060101':
print('mob class id = {0}, mob_type = {1} '.format(mob.class_id, 'composition'))
elif str(mob.class_id) == '0d010101-0101-3600-060e-2b3402060101':
print('mob class id = {0}, mob_type = {1} '.format(mob.class_id, 'master'))
elif str(mob.class_id) == '0d010101-0101-3700-060e-2b3402060101':
print('mob class id = {0}, mob_type = {1} '.format(mob.class_id, 'source'))
# mob_id = f.storage.composition_mobs()[0]
print('mob umid = ', MobID(mob.mob_id))