orchetect / DAWFileKit

A Swift library for reading and writing common import/export file formats between popular DAW applications.
MIT License
25 stars 2 forks source link

Final Cut Pro FCPXML Support #22

Open orchetect opened 9 months ago

orchetect commented 9 months ago

Baseline

Parsing and Element Extraction

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

Refactors

Technical

To Investigate

Testing

orchetect commented 9 months ago

A TON of work has been put into this thus far. Like literally weeks, full-time. But this remains very much a living and breathing in-progress effort. It's very close to reaching a point of satisfactory capability, stability, and accuracy. The goal now is to fine tune, work out some bugs, cover edge cases, and add unit testing to further improve its rigidity so it can be production-ready.

Currently, the parsing model is not complete (ie: does not implement 100% of the FCP XML 1.11 DTD). It may in future, but there is no compelling reason other than completeness. There exists a lot of ancillary elements possible in the DTD that are somewhat irrelevant to the main goal of DAWFileKit at present, which is markers extraction and interchange.

Also, the model is primarily designed to be read-only and is not yet capable of writing the model to disk as XML. That is a very possible addition to DAWFileKit in future, but will require a substantial refactor and is not a priority at this time.

DAWFileKit is currently capable of parsing and reasoning on:

It's taken quite some time to start shaping the codebase and API into something more ergonomic and it's so much more effort than just writing an XML parser. FCPXML is a bit heady and labyrinthian, and takes time to get into to really understand and be able to reason on, and there's not a ton of great documentation out there.

Reasoning on the model to achieve things like this was challenging to get right:

Multiple layers and references need to be considered and consulted to compile just one piece of reasoning datum such as these, and there are many ways to get it wrong. That's why it's taken so long to build and unit test.

orchetect commented 9 months ago

After a massive second-pass refactor, I'm getting close to stabilizing the API and getting a robust core feature set done.

The goal is to have this pushed to a new release in the next week or so.

orchetect commented 8 months ago

The re-refactor is basically complete on fcpxml-refactor branch.

There should be a forthcoming merge to main and release soon.

orchetect commented 8 months ago

Merged PR to main.