KDL2FCP
Quick and dirty Kdenlive to fcpxml (Davinci Resolve, Final Cut Pro, Premiere Pro) converter.
Copyright (C) Gabriel Gambetta 2019. https://github.com/ggambetta/mlt2fcp
Debugged by Guido Torelli, Jan 2022. Ported to Python3 and perfected by Marcel Alexandru Nitan, Sept 2022.
Introduction
This is a quick and dirty converter from Kdenlive video project files (and probably, with some modifications, other MLT dialects such as OpenShot and ShotCut) to Final Cut Pro XML (in particular, one that Davinci Resolve can import).
Description
The purpose of this script is to transfer the clips in a timeline from KdenLive (any version!) to another video editing software, such as DaVinci Resolve, Adobe Premiere Pro, or Final Cut Pro. Only the clips are transferred, while everything else is discarded (effects, transitions, etc.).
All the footage contained in the project must have the same frame rate as the project, otherwise, the alignment of the clips into the imported timeline is not guaranteed.
The .fcpxml output file generated by this script has minimal content and was designed to be compatible with Davinci Resolve.
It has been verified that the output file cannot be imported directly to Final Cut Pro (probably, not even to Adobe Premiere Pro); therefore, an intermediate step must first be carried out through DaVinci Resolve, importing and re-exporting the .fcpxml file. In this way, the .fcpxml file gets enriched with extra information that allows it to be imported into other platforms.
Gabriel Gambetta's original script had a bug, so the conversion was introducing errors in the order of +/- 1 frame. The bug has been fixed, and the conversion results are now very accurate.
The original script was only compatible with files generated from KdenLive version 19 onwards; now also files generated by previous versions of KdenLive can be converted; however, it is recommended doing "right-click + split-audio" on each clip in the timeline before conversion, otherwise, the audio of the clips will not be transferred.
Known Issues
Nested clips (a .kdenlive clip in the timeline) are supported, but don't work very well; sometimes Resolve imports the result correctly, and sometimes it doesn't. Therefore, processing nested clips is disabled by default. As a result, the container timeline will contain references to a missing .kdenlive file. These can be converted independently, imported as timelines into Resolve, and the missing clip replaced with the imported timeline.
Suggestions
All the footage contained in the project must have the same frame rate as the project, otherwise, the alignment of the clips into the imported timeline is not guaranteed. Beware of cellphone footage, as some phones (Samsung Galaxy, and more) use a Variable Frame Rate, which KdenLive can handle very well, while some high-end video editing platforms (Resolve and Final Cut) can't handle that properly, causing slight drifts and misaligning. On the other end, Adobe Premiere should be capable of Variable Frame Rate handling. If you're in doubt, better to reencode your footage with a specific, standard frame rate.
Notes on importing into Davinci Resolve
When importing into Resolve, clips are sometimes imported with "gaps" separating each clip from the next. We don't know why this happens, but a very simple workaround is to import the .fcpxml file a second time, and everything will load correctly (tested on Resolve Studio 16 Linux).
If you intend to use the "free" version of Resolve for your conversions, you are strongly advised NOT to use the Linux version (because of its many extra limitations); use the Windows or Mac versions instead. Only the "Studio" (paid) version is recommended on Linux for this purpose.