The Main Bin
The "main bin" got its name after its unique DOM element identifier: "main bin".
Technically, the main bin is an MLT playlist (well, even a <playlist> inside the project document XML). But it is a really important one to Kdenlive. The emphasis here really is "to Kdenlive", as the main bin playlist actually never gets played back in the timeline. My understanding is that the playlist is just a neat trick to gather the required Kdenlive project information inside MLT, so it can be saved together with all the important MLT data in a single flush.
And in fact, the producer="main bin" attribute at the root <mlt> element gets ignored by MLT. (So far, I could not find any information on why this attribute reference even exists.)
When looking at the XML of an arbitrary Kdenlive gen 2 project file, you'll find this main bin somewhere in the middle of all the project document XML mess:
<mlt producer="main bin" ...> ... <!-- producers --> <playlist id="main bin"> ... </playlist> ... </mlt>
This isn't exactly thrilling yet. So what's so special with this main bin playlist?
Kdenlive Project Information
To Kdenlive, the main bin carries additional required information about a project. Some useful bits of information are:
- general project properties, such as a unique project identifier, preview profile information, et cetera.
- project bin folders, with their titles and hierarchy. MLT has no need for clip folders and such fancy stuff, so Kdenlive needs to store it somewhere inside the MLT data, in the main bin. For more details, see the separate post about the project bin.
- clip groups in the timeline. As MLT only knows about clips (producers) and transitions on tracks, but has no need for grouping producers (clips) and transitions across timeline tracks for editing purposes, this information needs to be stored somewhere. As it happens, inside the main bin.