-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathotio_debug.py
More file actions
26 lines (20 loc) · 758 Bytes
/
otio_debug.py
File metadata and controls
26 lines (20 loc) · 758 Bytes
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
import sys
import os
from aaftimelineparser import CutClipList
sys.path.append(os.path.join(os.path.dirname(__file__), "venv/Lib/site-packages/")) #for e.g. OTIO
import opentimelineio as otio
from opentimelineio.media_linker import MediaLinker
from opentimelineio.schema import ExternalReference
import xml.etree.ElementTree as ET
input_file = sys.argv[1]
in_adapter = otio.adapters.from_filepath(input_file).name
result_tl = otio.adapters.read_from_file(input_file, in_adapter)
for track in result_tl.tracks:
if track.kind != "Video":
continue
for item in track:
if not isinstance(item, otio.schema.Clip):
continue
sr = item.source_range
print (sr.start_time.value)
print (sr.duration.value)