kdenlive-api

February 4, 2026 · View on GitHub

DaVinci Resolve-compatible Python scripting API for Kdenlive via D-Bus.

Scripts written for the Resolve API work with minimal changes. The library communicates with a modified Kdenlive build that exposes Q_SCRIPTABLE methods over D-Bus (org.kde.kdenlive.scripting).

Quick start

pip install -r requirements.txt
from kdenlive_api import Resolve

resolve = Resolve()
pm = resolve.GetProjectManager()
project = pm.GetCurrentProject()
timeline = project.GetCurrentTimeline()

# Import media and build a timeline
pool = project.GetMediaPool()
clips = pool.ImportMedia(["scene01.mp4", "scene02.mp4"])
pool.AppendToTimeline(clips)

API hierarchy

Resolve
└── ProjectManager
    └── Project
        ├── MediaPool
        │   ├── Folder
        │   └── MediaPoolItem
        ├── MediaStorage
        └── Timeline
            └── TimelineItem

All class and method names follow the DaVinci Resolve Scripting API naming conventions. Kdenlive-specific extensions (transitions, clip insertion, audio track) are added on top.

CLI scripts

ScriptDescription
scripts/build_timeline.pyReads a scene script and builds a complete Kdenlive project
scripts/replace_scene.pySwaps a single scene clip on the timeline
scripts/add_transitions.pyApplies a transition map (dissolve, wipe, cut) between scenes
scripts/preview.pyPrints a text summary of the current timeline

Requirements

  • Python 3.10+
  • Linux (D-Bus transport requires pydbus and PyGObject)
  • Modified Kdenlive build with D-Bus scripting support

Docs

Tests

pytest tests/

81 unit tests using a MockDBus backend — no running Kdenlive instance needed.

License

MIT