A parent folder is a parent folder is a parent folder

Hello World. A kdenlive project is acting as a template and therefor copied around multiple times. Unfotunately the project has some absolute file paths stored in it that I want to get rid of.

Directory Structure:

my-own-project/
  Render/
  Documents/
  Assets/
    yo-mama-last-night.bmp
  Edit/
    foo.kdenlive

As you see the kdenlive file is in a sub-directory of the project. It is there so that it can clutter some sub-directory instead of messing up the project directory. The kdenlive file itself shall not even be in the project directory.

This is also the structure that is copied around for new projects. But the image in the Assets folder is stored as an absolute path. It shall rather be linked using a relative path.

There is one option in the settings which claims to use the parent folder, but that does not seem solve it. Also the documentation on that option does not help at all, because the description says that a prent folder is a parent folder.

I do not care about files that are outside the project folder.

How can I make kdenlive link all the files (within the project folder) using a relative path?

(talking about <property name="resource"> here)

This isn’t really supported. It would be nice, and lots of people try some variation of this when they first start out - but the project file is not a public interface, and makes no public promises about its content from one version to the next. Only that kdenlive will always import and update older files.

the project has some absolute file paths stored in it that I want to get rid of.

You don’t say what version you are using, and this has changed over time too.
But generally speaking in current versions, most paths are relative to the ‘root’, so it wouldn’t surprise me if paths outside that remain absolute.

the documentation on that option does not help at all, because the description says that a prent folder is a parent folder

@berndmj General Settings — Kdenlive Manual 25.08 documentation looks like a typo. “Uses the parent folder of the folder the .kdenlive project file” should probably say “Uses the parent folder of the .kdenlive project file” ?

But typo or not, that makes no claims or promises about how paths in the project file are recorded, only which directory is the “Project Folder”.

How can I make kdenlive link all the files (within the project folder) using a relative path?

Personally, I think you’re trying to solve the wrong problem the wrong way.

If you want to hack about manually editing project files, you get to keep all the pieces and all the grief when things change to break that. I think you’d be better off floating a feature request to create “template projects” that you can select from within the UI. There is some support for this with the ‘library’ but it has some issues and limitations at present too.

@berndmj General Settings — Kdenlive Manual 25.08 documentation looks like a typo. “Uses the parent folder of the folder the .kdenliveproject file” should probably say “Uses the parent folder of the .kdenlive project file” ?

Will be fixed soon together with the other changes and updates.

1 Like

Most support one could expect from this, is that Assets in sub-dirs are linked using a relative path. AND make sure that all those resources currently have a relative path on save.

Yes, but the root shall be one level higher than the path that the kdenlive file is in. So that kdenlive can clutter its own corner.

Nah, I was just hinting on the part of the XML that is related to that. Question is how I can tell kdenlive to go one level higher in the path and consider this to be the root of the project. Then of course it would do all the things as relative paths.

Also: This is in the documentation as well, which points to other websites suggesting directory strutures for projects. But then you put the kdenlive files into a sub-directory and end up in the same problem again, when you try to have a template for projects.

Except there are some things which don’t work when a relative resource path is used, because they don’t know anything about the kdenlive project file format or its root.

So this assumption fails at the very first hurdle.

So that kdenlive can clutter its own corner.

What exactly do you consider ‘clutter’. There is no project without a project file …

Then of course it would do all the things as relative paths.

Why “of course”? There is no API promise of that for All The Things, or that even if they are that way today that they will still be tomorrow.

end up in the same problem again, when you try to have a template for projects

Suggestions about a directory structure doesn’t mean you can simply copy that tree and the files in it to some other location and expect that it will all still work. It doesn’t and won’t.

The project archiving tool has some support for unpacking archives into a new location - and might be a reasonable basis for a future “project templates” feature. But as you seem to have noticed, trying to do something like that the way you’re currently trying to do it is simply a World Of Pain, and you’ve barely scratched the surface of all the reasons why.

What you ultimately want here is a desirable new feature, but what you’re currently trying to do to get it is not the way to get there.

TL;DR Screw this question and suggestion. I search&replace the XML until then and live with any sideeffects and extra effort I may have to put into it :man_shrugging:

What? A project that looks up resources nested somewhere in the project directory using a relative path starting from the project root can cause what problems exactly?

And backup files, and cachefiles, and proxies and whatever else I did not yet meet.

Because generally speaking in current versions, most paths are relative to the ‘root’.

Damn. To me all of this looks very easy but you say it is not. Speaking with HTML I am thinking of simple examples like <img src="./foo.jpeg"> which uses the “foo.jpeg” in the project directory whereever the HTML file would get copied (because of the relative path). I would have never expected that linking to resources within the project directory can not always be done using a relative path.
Or <property name="resource">foo.mp4</property> for example, which is also a relative path to a video inside the project directory. Within the root defined by <mlt LC_NUMERIC="en_US.UTF-8" producer="main_bin" root="/foo/bar/baz" version="7.30.0"> and even that has potential to be relative.

Well, then screw this question and suggestion. I search&replace the XML until then and live with any sideeffects and extra effort I have to put into it :man_shrugging: