Technical Documentation: KDE/kdenlive
βΉοΈ Provenance: Multi-Tier Ingestion Β· CodeWiki Reference
Overview (`README.md`)
Kdenlive
Kdenlive is a powerful, free and open-source video editor that brings professional-grade video editing capabilities to everyone. Whether you're creating a simple family video or working on a complex project, Kdenlive provides the tools you need to bring your vision to life.
For more information about Kdenlive's features, tutorials, and community, please visit our official website.
There you can also find downloads for both stable releases and experimental daily builds for Kdenlive.
Contributing to Kdenlive
Kdenlive is a community-driven project, and we welcome contributions from everyone! There are many ways to contribute beyond coding:
- Help translate Kdenlive into your language
- Report and triage bugs
- Write documentation
- Create tutorials
- Help other users on forums and bug trackers
Visit kdenlive.org to learn more about non-code contributions.
Developer Information
Technology Stack
Kdenlive is written in C++ and is using these technologies and frameworks:
- Core Framework: MLT for video editing functionality
- GUI Framework: Qt and KDE Frameworks 6
- Additional Libraries: frei0r (video effects), LADSPA (audio effects)
Getting Started
- Check out our build instructions to set up your development environment
- Familiarize yourself with the architecture and coding guidelines
- If the MLT library is new to you check out MLT Introduction
- Join our Matrix channel
#kdenlive-dev:kde.orgfor developer discussions and support
Contributing Code
Kdenlive's primary development happens on KDE Invent. While we maintain a GitHub mirror, all code contributions should be submitted through KDE's GitLab instance. For more information about KDE's development infrastructure, visit the KDE GitLab documentation.
Finding Things to Work On
- Browse open issues on KDE Invent, for example those labeled with First Task
- Check the KDE Bug Tracker for reported issues
- Look for issues tagged with "good first issue" or "help wanted"
Need help getting started? Join our Matrix channel #kdenlive-dev:kde.org - our community is friendly and always ready to help new contributors!
Please get in touch with us before working on a task, either by commenting in the issue or through our Matrix channel.
Overview (`benchmark/README.md`)
This folder provides benchmarking utilities, currently mostly covering the backend model.
The aim is to quantify performance improvements on a wide range of synthetic but hopefully somewhat realistic scenarios.
The benchmark is run manually and is not registered with CTest. With BUILD_TESTING=ON, build and run it from the repository root, redirecting stdout to a file:
cmake --build build --target timelinemodelbenchmark -j4
QT_QPA_PLATFORM=offscreen build/bin/timelinemodelbenchmark > benchmark/baseline.csvThen, from the repository root, compare two measurements using Python 3 (no additional packages required):
python3 benchmark/compare.py benchmark/base.csv benchmark/improved.csvThis will print the speedup for each operation, in decreasing order. Higher is better. Ideally we'd want to see everything > 1.0, but in practice that's rarely the case. We can make tradeoff where we drastically improve the perf of a function that is called very often, while losing out a little on one that is more rarely called.
Overview (`data/effects/README.md`)
Effects (and Transitions)
Kdenlive uses MLT for all video/audio effects/filters.
For filters that provide metadata the GUI can be generated automatically.
If the generated GUI is not sufficient a custom one can be build using a XML
file describing the effect and its parameters.
Important notes
Effects can be blacklisted in
kdenlive/data/blacklisted_effects.txt. All effects with a custom XML GUI need to be blacklistedEffects can be added to "Main effects" list in
kdenlive/data/preferred_effects.txtEffects can be assigned to an effect category in
kdenlive/data/kdenliveeffectscategory.rc.Kdenlive parses the effect folder at each startup, so that if you have an XML file describing a new effect,
just copy it to your~/.kde/share/apps/kdenlive/effects/folder and restart Kdenlive to enable the new effect.
The basic structure of a XML filter description:
01 <!DOCTYPE kpartgui>
02 <effect tag="mlt_filter" id="mlt_filter_custom1">
03 <name>Filter name</name>
04 <description>Filter the image</description>
05 <author>Anon</author>
06 <parameter type="constant" name="amount" default="10" min="0" max="1000" factor="1000">
07 <name>Amount of filtering</name>
08 </parameter>
09 <parameter type="bool" name="enable" default="0">
10 <name>Enable</name>
11 </parameter>
15 </effect>Line 1:
- required to make strings used in the effect translatable (see here)
Line 2:
| tag name | description |
|---|---|
tag |
MLT ("mlt_service") name of the effect (see MLT Docs) |
id |
internal kdenlive id, can be anything, but must be unique for each effect |
type |
(default = "video") whether effect modifies video or audio (use "audio" then) |
unique |
(default = "0") this effect cannot be attached multiple times to one clip (speed, fades, ...) |
version |
(optional) minimum version of the effect required to be available (works only if the MLT filter provides the necessary metadata) |
dependency |
(optional) ) MLT ("mlt_service") name of an effect or composition this asset depends on. If the dependency is not available this asset will not be available in Kdenlive too |
Line 3:
- name of the effect that will appear to the user
Line 4:
- Short description of the effect to be shown in the effects list
- Additionally a
part can be added inside. It's content will be available in the effect stack (see frei0r_lightgraffiti.xml for an example): - supports HTML formatting (requires the use of CDATA)
Line 5:
- name of the author(s) of the filter (not of the XML file ;))
The rest:
list of tags for `...`
| tag name | description |
|---|---|
name |
visible name of the parameter (depending on the GUI this parameter uses) |
comment |
(optional) description of the parameter (support HTML formatting) (not yet supported by all widgets) |
list of attributes for ``
| attribute name | description |
|---|---|
name |
MLT filter parameter name |
paramprefix |
a string to be prepended to the parameter value before passing it to MLT |
suffix |
a string to be appended to the parameter (for UI display only) |
min |
the minimal accepted value |
max |
the maximal accepted value |
visualmin |
the minimal value displayed in timeline keyframes (can be > than min) |
visualmax |
the maximal value displayed in timeline keyframes (can be < than max) |
default |
initial value, format depends on parameter type |
value |
|
optional |
if it is set, it means that this parameter can have an empty value. So then loading a project, don't set its value to default |
type |
widget (GUI) to use. See section below for possible values |
For double values these placeholders are available:
| placeholder | description |
|---|---|
%maxWidth |
width of the current profile |
%maxHeight |
height of the current profile |
%width |
synonym for %maxWidth |
%height |
synonym for %maxHeight |
%contentWidth |
width of the target clip |
%contentHeight |
height of the target clip |
%fittedContentWidth |
width of the target clip scaled to fit current profile |
%fittedContentHeight |
height of the target clip scaled to fit current profile |
%out |
the out position of the current item |
%fade" |
the default fade duration (can be configured by the user) |
values for attribute `type`
`"animated"`
- Alias for
"keyframe"
`"animatedrect"`
- A rectangle that can change in time. The parameter is exported in a semicolon separated string:
"keyframe=x y width height opacity", for example:"0=10 10 50 50 1;50=100 100 50 50 1"
`"bezier_spline"`
- cubic BΓ©zier spline editor for the frei0r color curves filter (new version, might be reused for other filters)
`"bool"`
- true/false
- represented by a checkbox
`"color"`
- color value, similar to representation HTML (
"#rrggbb"/"#aarrggbb"or"0xrrggbbaa") - represented by a button opening the KDE color dialog + a color picker button
additional attributes:
| attribute name | description |
|---|---|
alpha |
(default = "0") use to enable alpha support |
`"constant"`
- number
- represented by a slider
additional parameter attributes:
| attribute name | description |
|---|---|
factor |
(optional) values coming from MLT will be multiplied with factor |
offset |
(optional) will be added to values coming from MLT after factor is applied |
min |
smallest value possible (after multiplying with factor) |
max |
largest value possible (after multiplying with factor) |
suffix |
(optional) displayed unit of the value |
`"curve"`
- cubic curve editor for the frei0r color curves filter (old version)
`"double"`
- synonym for
"constant"
`"fakepoint"` and `"animatedfakepoint"`
- A way to handle 2 separate MLT parameters as the x, y coordinates of a point
- represented by 2 spin boxes
additional required parameter attributes:
| attribute name | description |
|---|---|
name |
a kdenlive: prefixed name that will be used internally and in project file to save animation |
requires 2 additional parammap child elements with attributes:
| attribute name | description |
|---|---|
target |
the parameter described by this element, can be x, y |
source |
the name of the parameter in MLT |
min |
smallest value possible (after multiplying with factor) |
max |
largest value possible (after multiplying with factor) |
default |
default value on initialization |
factor |
(optional) the factor used to display the value (not affecting the value passed to MLT) |
`"fakerect"` and `"animatedfakerect"`
- A way to handle 4 separate MLT parameters as the left, top, width, height coordinates of a point. Additional right, bottom values are supported
- represented by a geometry widget
additional required parameter attributes:
| attribute name | description |
|---|---|
name |
a kdenlive: prefixed name that will be used internally and in project file to save animation |
default |
the default rect value |
opacity |
set to true to indicate we also use opacity, false otherwise |
requires 2 additional parammap child elements with attributes:
| attribute name | description |
|---|---|
target |
the parameter described by this element, can be left, top, right, bottom, width, height |
source |
the name of the parameter in MLT |
min |
smallest value possible (after multiplying with factor) |
max |
largest value possible (after multiplying with factor) |
default |
default value on initialization |
factor |
(optional) the factor used to display the value (not affecting the value passed to MLT) |
`"fixed"`
- sets a (MLT filter) parameter, but does not expose it to the user (no GUI)
`"fontfamily"`
- Font typeface entry
`"geometry"`
- a rectangle: position + dimension + additional value
- works with MLT filters using mlt_geometry
- the rect can be edited on the project monitor
additional attributes:
| attribute name | description |
|---|---|
fixed |
(default = "0") use to disable keyframe support |
showrotation |
(default = "0") use to enable support to 3 axis rotation |
opacity |
(default = "true") use to disable support of the opacity setting |
You can set default to "adjustcenter" to adjust the geometry to the frame size
`"keyframe"`
- keyframable number
- keyframes are opt-in (only one keyframe by default -> should be preferred over "constant" whenever possible)
- works with MLT filters that utilize start/end values
- same attributes as "constant"
additional attributes:
| attribute name | description |
|---|---|
factor |
(optional) values coming from MLT will be multiplied with factor |
intimeline |
(default = "0") parameter to preselect for editing in the timeline (only one parameter can have "1") |
widget |
(optional) GUI based on the standard keyframe GUI (possible values: "corners") |
`"keywords"`
- Text entry with a selection of possible keywords to be inserted in the text.
additional tags:
| attribute name | description |
|---|---|
keywords |
list of possible keyword values separated by semicolon |
keywordsdisplay |
list of names to use for the values separated by semicolon |
`"list"`
- multiple choice
- represented by a drop-down menu
additional parameter attributes:
| attribute name | description |
|---|---|
paramlist |
list of possible values separated by semicolon (no whitespaces!). Special keyword %lumaPaths available to show files in the applications luma directories |
additional tags:
| tag name | description |
|---|---|
paramlistdisplay |
(optional) list of names to use for the values separated by comma |
`"multiswitch"`
- 2 possible options defined by strings (max / min)
- this special parameter type will affect 2 different parameters when changed. the
nameof this parameter will contain the name of the 2 final parameters, separated by a LF character: . Same thing for thedefault,minandmaxwhich will contain the values for these 2 parameters, separated by an LF character. See for example the fade_to_black effect. - represented by a checkbox
`"point"`
- A point coordinate, represented in MLT by a rectangle, using only the first 2 x, y coordinates
- represented by 2 spin boxes
`"position"`
- time stored as frame number
- represented by a slider
`"readonly"`
- Data (usually an animated geometry) that can be pasted to clipboard or dragged/dropped on another geometry parameter. Cannot be modified directly by user.
`"roto-spline"`
- GUI for the rotoscoping filter (spline on the monitor)
`"simplekeyframe"`
- works with MLT filters that use mlt_geometry for keyframe support (includes all frei0r filters)
- same attributes as "keyframe"
`"switch"`
- 2 possible options defined by strings (max / min)
- represented by a checkbox
`"url"`
- url/path
- represented by button to open "file open" dialog
additional attributes:
| attribute name | description |
|---|---|
filter |
Filter for file extensions. Example : "*.cpp *.cc *.C|C++ Source Files\n*.h *.H|Header files" or as using MIME type: "image/png text html" |
mode |
(optional) Default is empty = open. "save" means none-exsisting files can be selected and gui label is "save" |
`"urllist"`
- url/path
- represented by button to open "file open" dialog (like
url) but in addition the file can be selected from a predefined list (like"list") and it has support for KNewStuff (e.g. https://store.kde.org) additional attributes:
| attribute name | description |
|---|---|
filter |
Filter for file extensions. Example : "Source Files (*.cpp *.cc *.C);;Header files (*.h *.H)" (warning: this format is different to url!) |
newstuff |
(optional) KNewStuff config file (usually placed in kdenlive/data and added to kdenlive/src/uiresources.qrc so the value looks like ":data/kdenlive_wipes.knsrc"). If this is empty no download button is shown |
paramlist |
list of possible values separated by semicolon (no whitespaces!). Special keywords %lumaPaths and %lutPaths are available to show files in the applications luma/lut directories |
additional tags:
| tag name | description |
|---|---|
paramlistdisplay |
(optional) list of names to use for the values separated by comma |
`"wipe"`
- special GUI for the wipe transition makes it possible to select a direction of a slide
Overview (`data/resourceproviders/README.md`)
How To Write Provider Configurations
Instruction written 2021 by Julius KΓΌnzel as part of Kdenlive (www.kdenlive.org)
Overview
Provider configuration files are json files.
Here is an example for freesound
/* Detailed source-code truncated for AI context efficiency. */Base Structure
Each provider config files should only specify a certain media type such as video. If the provider provides multiple types, create one config file for each.
| Key | Type | Required | Description |
|---|---|---|---|
| name | String | yes | Name of the provider (not translatable!!!) |
| homepage | String | yes | Url pointing to the providers webpage |
| type | String | yes | one of video, image, music, sound |
| integration | String | yes | Must be buildin as this is the only supported value at the moment |
| clientkey | String | If OAuth2 or %clientkey% is used |
The client key to access the api. Kdenlive has some keys build in: %pixabay_apikey%, %freesound_apikey% and %pexels_apikey% will be replaced by a key for the certain provider. |
| downloadOAuth2 | bool | no | Whether OAuth2 authentication is needed to download files |
| api | Object | yes | see Api |
Api
The api object describes the api endpoints
| Key | Type | Required | Description |
|---|---|---|---|
| root | String | yes | The apis base url (should not end with /) |
| oauth2 | Object | If downloadOAuth2 is true |
See OAuth2 |
| search | Object | yes | See Search |
| downloadUrls | Object | yes | See Fetch Download Urls |
OAuth2
| Key | Type | Required | Description |
|---|---|---|---|
| authorizationUrl | String | yes | The url to authorize |
| accessTokenUrl | String | yes | The url to request an access token |
| clientId | String | yes | The clients id |
Search
The search object should hold the two objects req and res.
Request
| Key | Type | Required | Description |
|---|---|---|---|
| path | String | yes | Path to the search endpoint (appended to root, should start with /) |
| method | String | yes | HTTP method. Only GET is supported at the moment |
| params | Array of Objects | no | List of HTTP params |
| header | Array of Objects | no | List HTTP headers |
The objects in the arrays in params and header should contain two fields: key and value
Response
| Key | Type | Required | Description |
|---|---|---|---|
| format | String | yes | Format of the response. Only json is supported at the moment |
| resultCount | String | yes | Number of total result |
| list | String | Name of the key containing the list holding the search results. All of the following fields are relative to a item of this list | |
| name | String | no | The items name |
| filetype | String | no | The items filetype |
| id | String | yes | Name of the key in a list element holding the items id |
| url | String | Url to the item to be opened in a external browser | |
| licenseUrl | String | Url to the license to be opened in a external browser. If you use a template, always use link to the english license version. Kdenlive can generate License names out of links to Creative Commons, Pexels and Pixabay Licenses for all other links the License name is "Unknown License". | |
| description | String | no | Description of the item |
| author | String | no | Name of the items author |
| authorUrl | String | no | Link to the items authors page to be opened in a external browser |
| duration | String | no | Duration of the item (for video and audio) |
| width | String | no | Width of the item (for video and image) |
| height | String | no | Height of the item (for video and image) |
| downloadUrl | String | no, if downloadUrls or Fetch Download Urls |
To be used when there is only one download url (i.e. one file version) for the item |
| downloadUrls | Object | no, if downloadUrl or Fetch Download Urls |
To be used when there are multiple download url (i.e. one file version) for the item. See description in table below |
| previewUrl | String | no | Url to preview file of the item |
| imageUrl | String | no | Url to image thumb of the item (for audio e.g. album cover, for video a still) |
Multiple Download Urls
| Key | Type | Required | Description |
|---|---|---|---|
| key | String | yes | Name of the key containing the list holding the files. The following fields are relative to a item of this list |
| url | String | yes | Name of the key in a list element holding the download url |
| name | String | yes | Label for the certain file version |
Example
"downloadUrls": {
"key": "video_files",
"url":"link",
"name":"${quality} {width}x{height}"
}Fetch Download Urls
Only necessary in special cases (e.g. https://archive.org) when no download urls are provided with the search response i.e. neither downloadUrl nor downloadUrls can be set in Search res
For the req object see the description of the req object for search
The res object should hold two fields: format (same as in search response) and downloadUrl (same as in search response) or downloadUrls. The field downloadUrls is again similar to the one in search response, but has some additional fields:
| Key | Type | Required | Description |
|---|---|---|---|
| isObject | Boolean | no | Whether the list not a normal array but a object and each subobject contains metadata about a file (e.g. "files": { "file1": { "name": "&" }, "file2": { β¦ }, β¦}) |
| format | String | no | Format of the file |
If isObject is true there is a special case for format, url and name: if they have the value & (or {&} within a template) it is replace by the key of the parent object. In the example in the table above this means name will be file1
Example
"downloadUrls": {
"req": {
"path": "/details/%id%",
"method": "GET",
"params": [
{ "key": "output", "value": "json"}
]
},
"res": {
"format": "json",
"downloadUrls": {"key":"files", "isObject":true, "url":"$http://archive.org/download/%id%{&}", "format": "format", "name":"${source} {format} {width}x{height}"}
}
}Special Keys
Special keys are available for the following fields in Search res: author, authorUrl, name, filetype, description, id, url, licenseUrl, imageUrl, previewUrl, downloadUrl, downloadUrls.url and downloadUrls.name.
In res of Fetch Download Urls they are available for these fields: downloadUrl, downloadUrls.format,downloadUrls.url and downloadUrls.name
Placeholders
Placeholders are expressions that will be replaced by something.
For params and header these of placeholders are available.
| Placeholder | Replaced By | Hint |
|---|---|---|
| %query% | The search query the user entered | Only for search |
| %pagenum% | Th number of the page to request results for | Only for search |
| %perpage% | Number of results that should be shown per page | |
| %shortlocale% | Short local like en-US (at the moment always en-US) |
|
| %clientkey% | The clients apikey defined in clientkey |
|
| %id% | Id of the item to fetch urls for | Only for Fetch Download Urls |
Templates
Templates must always start with $. Within a template string you can use keys like this {username}.
NOTE: You can not use the general key like author. You must use the key of the response like username in the example for freesound!
Example
If your response looks like
{
"results": [
{
"name": "example",
"files": [
{"picname": "nice-picture", "id": "1234"},
...
]
}
]
}and your config like this
{
...
"api": {
...
"search": {
...
"res" {
...
"downloadUrls": {
"key": "files",
"url":"$https://example.org/files/{picname}-{id}",
"name":"picname"
}
}
}
}
}you will finally get https://example.org/files/nice-picture-1234 as url.
Overview (`packaging/flatpak/README.md`)
Package Kdenlive as Flatpak
Stable Version
The manifest for the stable Kdenlive version on Flathub is hosted on https://github.com/flathub/org.kde.kdenlive
Nightly Version
The nightly flatpak is on the kde flatpak repository (kdeapps). The build scripts for this repository are living at https://invent.kde.org/packaging/flatpak-kde-applications but in Kdenlives case it is just a link to the .flatpak-manifest.json file in the root of the Kdenlive repository. It is used by the new GitLab Flatpak CI.
How to build
First you need to setup flatpak and flatpak-builder. On Ubuntu you do it by running
sudo apt install flatpak flatpak-builderTo build Kdenlive you also need some dependencies:
flatpak install org.kde.SdkTo build and install the Flatpak just run the following command from the root of the Kdenlive repository:
flatpak-builder ~/flatpak-buildir .flatpak-manifest.json --installRead the flatpak build instructions for further general instructions on the flatpak build system: https://docs.flatpak.org/en/latest/building.html
Tip: use flatpak make-current master or flatpak make-current stable to switch the current version for flatpak run org.kde.kdenlive
Check for updates of dependencies
The flatpak manifest contains x-checker-data for flatpak-external-data-checker.
That means that after you installed it with
flatpak install --from https://dl.flathub.org/repo/appstream/org.flathub.flatpak-external-data-checker.flatpakrefyou can simply run
flatpak run org.flathub.flatpak-external-data-checker .flatpak-manifest.jsonto get a report about all dependencies with new versions available.
Overview (`src/lib/external/kiss_fft/README.md`)
kiss_fft
Files in the this directory are copied from https://github.com/mborgerding/kissfft, except for the CMakeLists.txt file which was written by the Kdenlive team. Addionally the files have been modified to use #pragma once and SPDX-License headers. The last update is has happend with commit f5f2a3b2f2cd02bf80639adb12cbeed125bdf420.
Doc CMakeLists (`doc/CMakeLists.txt`)
SPDX-License-Identifier: BSD-2-Clause
SPDX-FileCopyrightText: Julius KΓΌnzel
kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${KDE_INSTALL_DOCBUNDLEDIR}/en SUBDIR kdenlive)
Src Doc CMakeLists (`src/doc/CMakeLists.txt`)
SPDX-License-Identifier: BSD-2-Clause
SPDX-FileCopyrightText: Vincent PINON
set(kdenlive_SRCS
${kdenlive_SRCS}
doc/documentchecker.cpp
doc/dcresolvedialog.cpp
doc/documentcheckertreemodel.cpp
doc/documentvalidator.cpp
doc/kdenlivedoc.cpp
doc/kthumb.cpp
doc/docundostack.cpp
PARENT_SCOPE)
--- METRICS ---
- Files Extracted: 8
- Estimated Token Budget: ~7413 tokens
- Canonical Reference: https://codewiki.google/github.com/KDE/kdenlive