Expand description
Import timelines from other editors, with an honest per-item report.
Supported: Final Cut Pro 7 XML (.xml - what Premiere Pro exports and DaVinci Resolve reads/writes),
EDL (CMX 3600) and uncompressed Premiere .prproj (the same XML reader). A real .prproj is
gzip-wrapped and there is no inflate in-tree, so those are accepted by the picker only to answer
with the βexport FCP7 XML insteadβ note below. Anything the reader cannot map (unknown effects,
missing media, speed ramps, colour pages) becomes an Issue instead of failing the import.
StructsΒ§
EnumsΒ§
ConstantsΒ§
- IMPORT_
EXTS - MAX_
XML_ πDEPTH - Maximum element nesting.
Eldrops recursively andfind_allrecurses, so an adversarial file of 100k nested tags would overflow the (UI-thread) stack β which nocatch_unwindcan catch. Real FCP7/EDL exports are under 20 deep.
StaticsΒ§
- PROBING π
- Paths with a probe still out. By path rather than asset id: a probe outlives the project that started it, and paths are what the library has to hand. ponytail: linear scan under one lock β an import batch is a handful of files, not a thousand.
FunctionsΒ§
- adopt
- Fold a finished probe into
project. The asset is seconds old, so every clip on it was placed against the placeholder (one MIN_CLIP-long clip, wrong audio streams): those are laid down again at the same starts now that the real duration is known. False when the asset is already gone. - asset_
of π - Asset for a
<file>: defined once, then referenced by id (<file id="file-3"/>). - attach π
- cell π
- A markdown table cell: no pipes, no line breaks.
- channels π
("V", "A", "A2", "AA", "B", "AA/V")β (has video, audio track indices).- close π
- Close
name, unwinding any elements left open inside it. - decode π
- Bytes β text: strips a UTF-8 BOM, decodes UTF-16 (LE/BE BOM) and never fails.
- from_
pathurl π file://localhost/C:/a%20b/v.mp4βC:\a b\v.mp4;file://nas/share/v.mp4β\\nas\share\v.mp4.- import_
file - Detect the format by extension + content and import it.
- is_
probing - Is this asset still waiting for its metadata? (the library says βLoadingβ¦β instead of a duration)
- link_
stacks π - Clips of one asset at the same place on different tracks are one linked group (video + its audio),
which is how
Project::insert_asset_clipsbuilds them. - looks_
like_ πedl - ms π
- parse_
event π 001 AX V C 00:00:00:00 00:00:02:00 00:00:00:00 00:00:02:00(aD/Wadds a frame count).- parse_
tag π - parse_
xml π - Minimal well-formed-ish XML reader: elements, attributes, text, CDATA; comments / PIs / DOCTYPE are
skipped. Mismatched or missing close tags unwind instead of failing β exported timelines are machine
written, but a truncated one should still give back what it has. Nesting is capped at
MAX_XML_DEPTH. - percent_
decode π - place π
- Put the clip on
ti, or on the first track of the same kind with room (a new one if needed). - placeholder
- Stand-in asset for a file whose probe has not come back: the name and a kind guessed from the
extension are all we know. An audio placeholder claims one stream so that dropping a song on the
timeline before the probe lands still makes a clip for
adoptto rebuild. - probe_
async - Probe
files(placeholder asset id + path) on a worker. Returns at once; poll the receiver. - rate_of π
- read_
clipitem π - read_
edl π - read_
filters π - Opacity / Basic Motion become clip properties; everything else is reported.
- read_
transitionitem π - read_
xmeml π - relink π
- Look for the file next to the imported timeline, then one level of sub-folders.
- source_
name π - tag_end π
- Index of the
>closing a tag, ignoring quoted attribute values. - timecode π
HH:MM:SS:FF(;= drop frame) β seconds.- track_
slot π - Ensure the
n-th track ofkindexists and return its index. - transition_
kind π - unescape π
- utf16 π