gyroflow/gyroflow-frei0r

Absolute path needed to render with kdenlive

RonOnGithub opened this issue · 5 comments

Hi,

I've only just learned about gyroflow, and it's looking really promising
thanks for all the work you've put in to this! :)

I've been getting it set up to use it with kdenlive, and the latest hurdle in
making that all work nice and painless seem to be that the plugin stores
the Project file as a relative path (relative to the <mlt root="..."> path).

So when I edit a new project, add the gyroflow effect to a clip and set the
project file, it all works great.

But if I save that project and then reopen kdenlive, or when I try to actually
render it, then gyroflow sees the relative path fragment as invalid, and I see
the same thing as in the third image shown here:
#2

If I manually edit the kdenlive project file or mlt render script to make the
Project property an absolute path then everything works as expected.

I'm just not sure if that's something gyroflow is supposed to tell mlt with a
parameter in the effect xml file, or if it's supposed to handle it in the plugin
code by prepending the mlt root to a relative path before using it.

Hmm, that sounds like Kdenlive bug, beause in the plugin code, the path is not altered at all, never, it's just always treated as a string. The parameter is just string too, not path. The Path parameter type is created and handled by Kdenlive (based on the xml)

Yeah, that was my first thought too, but after a bit of digging, the project file xml does seem to be quite consistent about making paths under the <mlt root=''> relative to it, and I found this report against mlt mltframework/shotcut#710 which seems to indicate this is intentional.

I couldn't find another effect which uses a path to see how it handled this, but it would seem a little odd to have the path in the xml project file to the .gyroflow file be absolute when the path to the video source is relative. I'm seeing:

<property name="Project">footage/PRO_VID_20240410_064418_018.gyroflow
<property name="kdenlive:originalurl">footage/PRO_VID_20240410_064418_018.mp4
<property name="kdenlive:original.resource">footage/PRO_VID_20240410_064418_018.mp4

Can we access the mlt root parameter in lib.rs to create a full path there, or do we really need kdenlive (actually mlt in this case) to pass us something more?

I can open an issue on the kdenlive side, but if we can fix it on this side by normalising the Project path if it is relative, that does seem like the most robust answer to my current (slim) understanding of what's happening in this code.

There's really nothing I can do on my side, the frei0r interface is dead simple and doesn't have any control over host application or anything host-specific. All that gyroflow plugin handles in lib.rs is a single String. The interpretation of it as a path is entirely on the host side and invisible to the frei0r plugin

Ok, thanks for clarifying that. I started out looking at whether the parameter type for Project needed to be something other than 'url' in frei0r_gyroflow.xml, but then I wasn't sure if we also had access to more than just those parameter values. I'll leave this open here for now so we've got somewhere to track this side of the discussion, and if we need to bounce some more questions off you, but I'll take it up on the kdenlive side and figure out what needs to be done there. Thanks for the fast response!

In theory it would work if you could set the parameter in xml to string and just type the full path there manually, but it appears that there's no such type in the effect xml