Bug 485356 - External proxy preset, error when setting multiple profiles
Summary: External proxy preset, error when setting multiple profiles
Status: RESOLVED FIXED
Alias: None
Product: kdenlive
Classification: Applications
Component: Project Bin & Import (other bugs)
Version First Reported In: 24.05.0
Platform: Appimage Linux
: NOR normal
Target Milestone: ---
Assignee: Jean-Baptiste Mardelle
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2024-04-11 06:16 UTC by Ron
Modified: 2025-01-30 09:49 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ron 2024-04-11 06:16:47 UTC
Hi!

Attempting to add an external proxy preset with multiple profiles from the UI
dialog results in saving the fields in the wrong order.  It interleaves the fields
for each profile instead of concatenating them as a group one profile after another.

So if for example I set clip prefix FOO_;BAR_ in the dialog, it will save:

MyProfile=;FOO_;BAR_;;;;;;;;;

instead of

MyProfile=;FOO_;;;;;;BAR_;;;;

Manually editing externalproxies.rc to correct this makes the new proxy
profile it work as intended.


You can see this corruption also occur with:

Project -> Project Settings -> Proxy
Enable external proxy clips and open the edit profiles dialog with the button next to the drop down selector.

Click on 'GoPro LRV' which has multiple profiles.  You should see the fields look correct.

Now click on another profile to view it, eg. Akaso LRV.
Then if you go back to the GoPro profile, you'll see the field contents are all garbled.

I'm seeing this in kdenlive built locally from:
c806935cdc8870115503a1f217f0554a0f83d1fc

Checking the 24.02.1 Appimage, I'm not seeing the button to pop up an edit profile
dialog at all - so now I'm not sure if this is a new option, or something that is not
enabled for the AppImage?

  Cheers,
  Ron
Comment 1 Ron 2024-05-31 10:54:55 UTC
Hi,

Just a followup to this now that the external proxy editing dialog has been enabled in 24.05.0.

The bug I noted here is still present in the 24.05.0 appimage.  I can see it manifest if I just
open that dialog and then flick between the various preset options.

If you select the GoPro or Insta option (or any with multiple profiles) then select a different
profile, then flick back to the GoPro or Insta one (without closing the dialog), you'll see that
each time you go back to the multiple profile preset, the options in it get shuffled around
and appear in the wrong fields.

Cheers,
Ron
Comment 2 emohr 2024-06-01 17:50:52 UTC
Thanks for reporting. I can confirm the issue following your steps. It’s reproduceable on Windows with Kdenlive 24.05.0 and AppImage 24.05.0.
Comment 3 MartinG 2024-12-22 14:53:55 UTC
Thank you for this - I have spent a few hours trying to find out why my external proxy clips don't work. 
Below is a workaround that solved my problem of non-working external proxy clips.

I can confirm this bug (shuffling of external proxy settings) on the following versions (Fedora Linux):
kdenlive-24.08.3-1.fc40.x86_64
kdenlive-24.12.0-1.fc41.x86_64

In my kdenliverc, I have this:

externalProxyProfile=./;GOPR;./;GOPR;./;GL;./;GH;./;.LRV;./;.MP4;./;.LRV;./;.MP4;GL;.LRV;GX;.MP4;GP;.LRV;GP;.MP4

I have checked that the settings are transferred to the Project Settings when I create a new project, but realize now that that's where the problem is; in my project settings, I have eg.

Relative path from clip to proxy: ./;./;./;GX

which is wrong, as "GX" is in fact a prefix. It is all messed up. 

So, if I save the project, and open the .kdenlive project file, I have the following:

  <property name="kdenlive:docproperties.externalproxyparams">./;GOPR;./;GOPR;./;GL;./;GH;./;.LRV;./;.MP4;./;.LRV;./;.MP4;GL;.LRV;GX;.MP4;GP;.LRV;GP;.MP4</property>

Looking at the documentation https://docs.kdenlive.org/en/tips_and_tricks/useful_info/using_camcorder_proxy_clips.html#using-camcorder-proxy-clips I see that I have also ~/.local/share/kdenlive/externalproxies.rc with this in it:

GoPro LRV=./;GOPR;./;GOPR;./;GL;./;GH;./;.LRV;./;.MP4;./;.LRV;./;.MP4;GL;.LRV;GX;.MP4;GP;.LRV;GP;.MP4

But the manual says:
profile name=<proxy_folder> (relative to original clip); <proxy clip prefix>; <proxy clip suffix>; <original_folder> (relative to proxy file); <original_clip_prefix>; <original_clip_suffix>

and

GoPro LRV=./;GL;.LRV;./;GX;.MP4;./;GP;.LRV;./;GP;.MP4;./;GOPR;.LRV;./;GOPR;.MP4

So I updated it (actually also changed it, since I have GoPro HERO cameras (GL proxy to GH origs):

GoPro LRV=./;GL;.LRV;./;GH;.MP4

This also resulted in messed up settings when I open kdenlive and choose New and look at the Proxy settings. Turns out this file isn't used before I switch from "Current settings" (where ever they came from?) to "GoPro LRV". Nice.

And it works - when I choose the GoPro GHxxxxxx.MP4 file, it gets marked with the "P" almost immediately. 

I guess this should also work, not tested yet:
GoPro LRV=./;GP;.LRV;./;GP;.MP4;./;GL;.LRV;./;GH;.MP4;./;GS;.LRV;./;GS;.360;./;GOPR;.LRV;./;GOPR;.MP4
Comment 4 Ron 2024-12-27 10:32:12 UTC
(In reply to MartinG from comment #3)
> Thank you for this - I have spent a few hours trying to find out why my
> external proxy clips don't work. 
> Below is a workaround that solved my problem of non-working external proxy
> clips.

I'm actually not quite clear on what you are "working around" here, but ...

> In my kdenliverc, I have this:
> externalProxyProfile=./;GOPR;./;GOPR;./;GL;./;GH;./;.LRV;./;.MP4;./;.LRV;./;. MP4;GL;.LRV;GX;.MP4;GP;.LRV;GP;.MP4

Yes, this is clearly corrupted by this bug, and this setting is just kdenlive 'remembering'
the last set of values that you used in those fields of the project settings proxy tab ...

> I see that I have also ~/.local/share/kdenlive/externalproxies.rc with this in it:
> GoPro LRV=./;GOPR;./;GOPR;./;GL;./;GH;./;.LRV;./;.MP4;./;.LRV;./;.MP4;GL;.LRV;GX;.MP4;GP;.LRV;GP;.MP4

Which is where the named profiles are defined, and clearly you have corrupted
the entry(/ies) in this file too by editing that profile in a version of kdenlive with
this bug.

If you just delete that file, kdenlive should restore it with the actually correct values
from the compiled in setttings for the pre-defined profiles that it ships with.

> Turns out this file isn't used before I switch from "Current settings" (where ever they came from?) ...

"Current settings" are the last values you used in those fields (taken from the
setting in kdenliverc), when those don't correspond to a named profile (because
you can put whatever custom thing you like in there to suit the structure of a
given project.  You don't have to define a named profile for something you will
only use once in one project.

> ... to "GoPro LRV".

And when you select a named profile it uses the setttings saved in externalproxies.rc

So I'm glad that finding this helped you figure it all out, but there isn't really any magic workaround ...

While this bug persists, if you try to use the edit profile dialog it will create a corrupted profile in
externalproxies.rc

If you then try to use that, it will remember the last used settings (bogus or not) in kdenliverc
(and save them to your project file).

The only way to add or edit new profiles until this is fixed is to manually edit the externalproxies.rc
file - and so long as you never try to edit them in the app dialog, the contents of that file is initially
created correctly and will not become corrupted.
Comment 5 MartinG 2025-01-04 11:54:57 UTC
Hi Ron, you're right - my comment doesn't add much info. I was just so happy that I managed to get it working and move on with my project, with help from your comments in this report, and wanted to share what I did to get there.

I do hope this bug will be fixed.
Comment 6 Bug Janitor Service 2025-01-15 07:32:03 UTC
A possibly relevant merge request was started @ https://invent.kde.org/multimedia/kdenlive/-/merge_requests/575
Comment 7 Jean-Baptiste Mardelle 2025-01-15 12:26:32 UTC
Git commit 4670ea8841ca4a476ea60edf45d3ab3d6bc50d87 by Jean-Baptiste Mardelle, on behalf of Ron El.
Committed on 15/01/2025 at 12:26.
Pushed by mardelle into branch 'master'.

Reassemble proxy profile elements in the correct order after validation

The external proxy preset strings consist of sets of 6 elements:
path clip->proxy;proxy prefix;proxy suffix;path proxy->clip;clip prefix;clip suffix
appended sequentially for each 'profile' that the preset describes.

When we import those into the proxy profiles edit dialog, we deconstruct
that and regroup them so that all the clip->proxy paths (etc.) are together
in a single QLineEdit widget for each element type.

Which means we need to reverse that process and re-interleave them in
profile groups after validating those fields.  If we just concatenate
the contents of the edit widgets all the elements end up in the wrong
order.

M  +17   -8    src/dialogs/customcamcorderdialog.cpp

https://invent.kde.org/multimedia/kdenlive/-/commit/4670ea8841ca4a476ea60edf45d3ab3d6bc50d87
Comment 8 Jean-Baptiste Mardelle 2025-01-30 09:49:57 UTC
Git commit a48cf6ccf04b015b606b5656b87d2ee883f767c9 by Jean-Baptiste Mardelle, on behalf of Ron El.
Committed on 30/01/2025 at 09:16.
Pushed by mardelle into branch 'release/24.12'.

Reassemble proxy profile elements in the correct order after validation

The external proxy preset strings consist of sets of 6 elements:
path clip->proxy;proxy prefix;proxy suffix;path proxy->clip;clip prefix;clip suffix
appended sequentially for each 'profile' that the preset describes.

When we import those into the proxy profiles edit dialog, we deconstruct
that and regroup them so that all the clip->proxy paths (etc.) are together
in a single QLineEdit widget for each element type.

Which means we need to reverse that process and re-interleave them in
profile groups after validating those fields.  If we just concatenate
the contents of the edit widgets all the elements end up in the wrong
order.

M  +17   -8    src/dialogs/customcamcorderdialog.cpp

https://invent.kde.org/multimedia/kdenlive/-/commit/a48cf6ccf04b015b606b5656b87d2ee883f767c9