Issue with Python-Generated Kdenlive Project - Won’t Open

Hello,
I’m working on a Python script to automatically generate Kdenlive projects (.kdenlive) using the MLT XML format. The goal is to create a project with one video track and multiple audio clips positioned at specific times (for automated dubbing). The script uses libraries like moviepy to get durations and xml.etree.ElementTree to build the XML.

The generated file seems valid (correct XML syntax), but Kdenlive (v24.12.2) won’t open it and doesn’t show a clear error. Comparing it to a manually created Kdenlive project, I noticed differences:

  • My script uses instead of for clips.

  • The has a custom frame rate (e.g., 59.94 fps) instead of a standard one (e.g., 25 fps).

  • Fewer metadata properties in .

  • File paths are absolute despite an attempt to make them relative.

Does anyone know if Kdenlive has specific requirements for these elements? Or how I could debug this (e.g., with --debug) to figure out why the project won’t open? Thanks in advance for any advice!

[A bunch of what you wrote isn’t visible, probably because you used unquoted <tags> - you’ll need to stick a \ in front of them like \<this>.]

But it probably doesn’t make a lot of difference - right now, the project files are not a defined interface for other tools, and make no promise to remain stable. kdenlive itself will handle updating older project files when changes are made, but outside of that it’s a bit Wild West in there.

There’s some documentation here: Project File Details — Kdenlive Manual 24.12 documentation - which also references this file: dev-docs/fileformat.md · master · Multimedia / Kdenlive · GitLab

But they may or may not be entirely accurate as of the currently released version. Really, the only definitive version is how it’s handled in the kdenlive source, and as above, that may change without notice. It usually doesn’t without a compelling reason, but good reasons do still happen every few releases.

It might be nice for this to be a more stable interface, but I think the reality is some parts are still moving targets that it would be a mistake to commit to freezing yet.

Depending on exactly what you’re trying to do, there’s at least 3 options:

  • If you’re not expecting to interactively edit what you’re generating, then just bypass kdenlive and generate config for MLT instead.

  • If you are, consider if what you’re trying to do might actually be a useful tool to integrate in kdenlive itself.

  • Accept the fact that whatever you do is going to be dependent on specific versions of kdenlive and may be broken and need changes for any future releases.

Hello,
Thanks for your feedback! MLT (Media Lovin’ Toolkit) is often a more stable and documented alternative for automating or generating video montages without depending on Kdenlive’s internal specificities.

Jean-Claude

I’d certainly hope so! By contrast that is the interface that Kdenlive uses to drive MLT :smiley:

The kdenlive project files are a superset of that, which doesn’t profess to be an interface for other tools (at least not yet) - but in theory you should be able to pass them directly to MLT and have it render Something. That used to be true, I’m not sure if it still is with the addition of support for multiple sequences etc.

As with most things, choosing the right tools for the job you need to do is an important first step.