Skip to content

Final Cut Pro FCPXML Support #22

Open
@orchetect

Description

@orchetect

Baseline

  • Support for parsing most common FCPXML elements into model objects, primarily with a view to extracting annotations such as markers, keywords, captions, etc.
  • Reasoning on the model:
    • Extracting elements (clips, markers) and calculating their absolute start timecode on the main timeline
    • Filtering and contextual data gathering for extracted events

Parsing and Element Extraction

  • sync-clip roles
  • mc-clip roles
  • analysis-marker
  • Method to parse top-level story elements that are immediate children of fcpxml
  • Detection for elements that are out of their containing clip's timecode bounds
    • write FCPXML utility method to detect if a clip or attribute (marker, caption, etc.) is out of bounds of the clip it's within
    • but also have a method that can recursively check up all the parent breadcrumbs to see if it's occluded from the main timeline
    • add property to ExtractionSettings to allow filtering out elements that are either partially or fully out-of-bounds, and therefore not visible on the main timeline
  • Change absoluteStart to inTime. Add outTime property to context, calculated from inTime + duration.
  • Add logic to convert sub-role names to their base role. ie: convert "Dialogue.Dialog-1" to "Dialogue"
  • Add progress reporting to element extraction (useful for very large FCPXML documents)

Frame Rate Scaling

Frame rate scaling for clips using conform-rate child element.

As support for timeline/media frame rate pairs are added, this table will be updated. (Project rates in the 1st column and media rates in subsequent columns.)

Project rate 23.98 24 25 29.97 29.97d 30 50 59.94 60
23.98 N/A ? X ? ? ? ?
24 X N/A X X
25 N/A
29.97 X ? N/A ? ? ? ?
29.97d X X N/A
30 X X N/A
50 N/A
59.94 X X N/A
60 X X N/A

X = implemented and unit tested
? = should work in theory, being reciprocals of already-tested rate pairs, but have not been explicitly unit tested

Authoring

  • Make all model attributes settable
  • Make all model children mutable / settable
  • Add a mechanism to be able to author elements by supplying their absolute start timecode value
  • API ergonomics and considerations

Refactors

  • Extensively implement throwing methods with propagated error handling
  • Refactor FCPXML to remove resources parameter in inits and force them to parse exclusively from the XML, including parsing out resources when necessary
  • Aggregate accumulation of Timecode can result in subframe aliasing where Final Cut Pro shows timecode for elements (markers, captions, keywords, etc.) 1-2 subframes off
    • may need to store atomically as CMTime or Fraction and convert to Timecode ad-hoc
    • not an issue when times fall on frame boundaries and do not have subframes
  • API adjustments and refactors to enable writing model contents to disk as FCPXML

Technical

  • Add pretty debugDescription output for Any* enum cases, etc.
  • Performance optimization: concurrency for FCPXML file parsing to increase performance
    • Each XML element's child notes could be parsed in parallel to speed up parsing. And that could happen with every element in the hierarchy.
  • Make types Sendable

To Investigate

  • Bundle FCPXML DTDs and validate input FCPXML files?
  • FCPXML note is a child element for clips, but an attribute for annotations
  • Implement predefined formats?
    Not sure if it's possible to sometimes only have the format string and no attributes like frameDuration, in which case we would need to add frame rate info for each one of these to derive it
  • read/write FCP clipboard contents (see Final Cut Pro clipboard data read/write #26)

Testing

  • Audio/video role attribute parsing & storage in structs
  • Edge cases involving new-line characters in notes or other text elements
  • Occlusion where elements with non-0 lanes extend past clip(s) beneath them

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestfcpxmlFinal Cut Pro FCPXML

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions