2016-07-22

Inside Kdenlive Projects: Individual Tracks

This time, let's find out where Kdenlive stores the various properties of a particular timeline track: MLT's playlists form the basis, with additional information tacked on as required...



Tracks


In Kdenlive projects, individual tracks are MLT <playlist>s. We humans can easily spot them by their unique XML element identifiers in the form of "playlist#", where # is a cardinal number starting from 1. To Kdenlive matters only that they are referenced from the maintractor <tractor> using track elements in the form of <track producer="playlist#">.

This is what can we find inside timeline track <playlist>s:
<playlist id="producer5">
  <property name="kdenlive:track_name">Video 3</property>
  <property name="kdenlive:locked_track">0</property>
  <property name="kdenlive:composite">1</property>
...
</playlist>
There is further stuff inside these playlists, such as the individual timeline clips for this track. However, we won't cover them in this post.

But what it is interesting to us now are the <property> elements inside the track <playlist>s. A name= attribute then identifies a particular property of a track. So what do we get here...?

Track Title


The title of a particular timeline track can be found from the <property> with name="kdenlive:track_name". This is the title as set by the user and shown in the header of each timeline track. Please note the kdenlive: namespace prefix used for this and the other Kdenlive-specific properties. This is necessary in order to avoid name property clashes with properties used by MLT itself. In fact, the <property> concept is a generic property of MLT.

This property is always present on all timeline tracks.

Track Lock


Whether a timeline track is locked or not is indicated by the name=kdenlive:locked_track property:
  • "0": unlocked,
  • "1": locked.
This property is always present on all timeline tracks, regardless of whether they are locked or not.

Automatic Compositing State


At some time after Kdenlive 15.04, Jean-Baptiste introduce the long requested feature of automatic compositing (tracks are not layers). Newer projects usally will now have the name=kdenlive:composite property be present. However, depending on the (upgrade) history of a project you should not expect this new composite property to be always present.
  • missing or "0": this is an opaque track.
  • "1": a transparent track using implicit compositing; transparent tracks are a means to help newcomers to get better along with Kdenlive when titling clips (and to avoid the dreaded tracks-are-not-layers surprise).
When implicit compositing is enabled for a track, then Kdenlive also adds an so-called internally added transition to the project. These internally added transitions are hidden from the user, so you won't see it directly in your project. We will cover these special transitions in a separate blog post.

Sometimes, these special, internally added transitions can get out of sync. So in case you notice strange compositing behavior for your transparent tracks, then this tip might be right for you:

Note: The upcoming 16.08 release of Kdenlive, whenever you add or remove tracks from the timeline, then Kdenlive will automatically add missing the composite properties as well as rebuilding the associated internally added composite transitions from ground up. This is especially important as I've seen several projects of mine that had totally messed up internally added composite transitions. One project set a new record with 234(!) such disabled internally added transitions for only 9 timeline tracks.

Track Type (Audio/Video)


In contrast to MLT, Kdenlive differentiates between video and audio tracks. Admittedly, Kdenlive is not so strict when it comes to video tracks, but audio tracks are for audio only. An audio track is signalled by a name=kdenlive:audio_track property.
  • missing: this is a video(+audio) track.
  • "1": this is an audio-only track.

Hidden Track


A hidden track cannot be identified by a (<playlist>) track <property>. Instead, you need to look at the track's corresponding <track> element, and its hidden= attribute in particular. Please see Timeline Tracks for details on how to interpret the hidden= attribute (note: hidden="video" or hidden="both").

Muted Track


Again, a muted track cannot be identified by a (<playlist>) track <property>. Instead, you need to look at the track's corresponding <track> element, and its hidden= attribute in particular. Please see Timeline Tracks for details on how to interpret the hidden= attribute (note: hidden="audio" or hidden="both").