Bug 359365 - git master 2016-02-13 - Effect stack not saved completely
Summary: git master 2016-02-13 - Effect stack not saved completely
Status: RESOLVED FIXED
Alias: None
Product: kdenlive
Classification: Applications
Component: User Interface & Miscellaneous (other bugs)
Version First Reported In: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Jean-Baptiste Mardelle
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-13 21:24 UTC by Evert Vorster
Modified: 2016-02-15 22:49 UTC (History)
0 users

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


Attachments
The project file created by that video. (44.70 KB, application/x-kdenlive)
2016-02-14 13:43 UTC, Evert Vorster
Details
The saved effect (5.63 KB, text/xml)
2016-02-14 13:45 UTC, Evert Vorster
Details
The original effect stack (5.56 KB, text/xml)
2016-02-14 13:47 UTC, Evert Vorster
Details
Effect Stack saved with 15.13.0.r7058.bfd3da1-1 (5.18 KB, text/xml)
2016-02-14 23:11 UTC, Evert Vorster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Evert Vorster 2016-02-13 21:24:00 UTC
I have a fairly deep video stack that I use to correct for GoPro footage that is shot in protune mode. 
The footage from the GoPro can also be quite long, time-wise. I would chop out scenes that I like, and then start setting the parameters on the filter stack, like white balance and levels. It's important that these settings are the same on each of the bits of footage, so I would play with one piece of the clip until it is perfect, and then save the filter stack, and apply it to the other pieces of the footage. 
Unfortunately, it would seem that the whole stack is not saved, only the first two effects in the stack. 

Reproducible: Always

Steps to Reproduce:
1.Make a deep filter stack. 
2.Save the filter stack
3.Apply the filter stack to another bit of footage. 

Actual Results:  
Stack is incomplete, and removing it causes a segfault

Expected Results:  
a duplicate of the original stack to be applied to the clip where the saved stack was applied. 

I'll attach the original stack, and the saved stacks in a bit
Comment 1 Evert Vorster 2016-02-14 00:29:19 UTC
Just rebuilt kdenlive from git. 
Saving effect stacks saves all the effects in the stacks now, but there has been a regression, as it saves the position of the original keyframes in the stack, which is almost guaranteed to be in the wrong place for the clip that it will be applied on. 

Also, none of the values of the sliders have been preserved, which is a bit pointless, as these values were exactly the ones I wanted to save, as I don't want to be typing in the values of every slider for every effect from my six or so filters for every single clip. It gets tedious soon. 

Lastly, the order of the effects in the stack are not preserved between a save and a restore of the project file. If you can't re-create this issue easily, I can file a separate bug.
Comment 2 Evert Vorster 2016-02-14 02:54:31 UTC
Just a quick comment... 
I downgraded my kdenlive to one that was checked out from git about a week ago, and that version cannot load the .kdenlive file, claiming it's from an unsupported version (0.93)
Comment 3 Jean-Baptiste Mardelle 2016-02-14 09:41:46 UTC
Git commit 7c29022503bde9a8704812aa7498e4ed6a7398bf by Jean-Baptiste Mardelle.
Committed on 14/02/2016 at 09:41.
Pushed by mardelle into branch 'master'.

Fix saved effects using default params instead of saved ones

M  +4    -3    src/mltcontroller/effectscontroller.cpp

http://commits.kde.org/kdenlive/7c29022503bde9a8704812aa7498e4ed6a7398bf
Comment 4 Evert Vorster 2016-02-14 11:00:31 UTC
Partially fixed. 
The keyframe issue does not exist anymore, but a saved effect stack is still useless at the moment, as all the values in the filters have been set to 0. 

ie: I have De-fish as my first filter, with a value of 800.
If I save this filter as a custom filter, and I apply it to a clip, the value now reads 0.

Setting up the sliders to be exactly right is half the battle, their values should really be remembered in a custom filter for the filter to look anything like the one that was saved.
Comment 5 Jean-Baptiste Mardelle 2016-02-14 13:23:52 UTC
I cannot reproduce. Custom effects are saved in:
$HOME/.local/share/kdenlive/effects/
with the file name set to the saved effect name. Can you attach here a custom effect file that you saved and is buggy when applying it ?
Comment 6 Evert Vorster 2016-02-14 13:43:24 UTC
Created attachment 97193 [details]
The project file created by that video.

Added a project file with the broken effects in.
Comment 7 Evert Vorster 2016-02-14 13:45:15 UTC
Created attachment 97194 [details]
The saved effect

This is the effect that was saved
Comment 8 Evert Vorster 2016-02-14 13:47:37 UTC
Created attachment 97195 [details]
The original effect stack

This effect stack is sort of middle of the road correction for GoPro with protune on, native white balance and flat color. It's pretty badass, but takes a really long time to apply to each frame. 
It needs a little tuning depending on the amount of light and time of day...
Comment 9 Evert Vorster 2016-02-14 13:49:20 UTC
Thanks for looking into this. 
I have made a little video capture of my usual workflow with GoPro footage from a drone. 
https://youtu.be/xUSjcvDuMMg
As you can see, kdenlive is pretty usable, even on a virtual machine on restricted hardware and with 4K video.
Comment 10 Jean-Baptiste Mardelle 2016-02-14 15:52:19 UTC
Git commit d74cf5fddc20bd9640f8eb9aa3570d78f4e65761 by Jean-Baptiste Mardelle.
Committed on 14/02/2016 at 15:51.
Pushed by mardelle into branch 'master'.

Fix keyframe position when saving effect

M  +5    -0    src/effectstack/collapsibleeffect.cpp
M  +6    -0    src/effectstack/parametercontainer.cpp
M  +2    -0    src/effectstack/parametercontainer.h
M  +18   -0    src/mltcontroller/effectscontroller.cpp
M  +3    -0    src/mltcontroller/effectscontroller.h

http://commits.kde.org/kdenlive/d74cf5fddc20bd9640f8eb9aa3570d78f4e65761
Comment 11 Jean-Baptiste Mardelle 2016-02-14 15:53:41 UTC
Ok, saving an effect saved absolute keyframes positions. I changed that so that it now saves relative positions. Can you try it ? 
You need to save the effect again and then applying it should work.
Comment 12 Evert Vorster 2016-02-14 23:11:18 UTC
Created attachment 97212 [details]
Effect Stack saved with 15.13.0.r7058.bfd3da1-1

The effect stack is still broken. 
Keyframe is still on the maximum frame, and all the values are still on their minimum. This looks like a feature of how it's imported when the effect has a keyframe that is on a frame that is outside of the range of the clip...

In ProTune Daylight, the line
  <parameter min="0" intimeline="1" name="Amount" max="1000" type="simplekeyframe" value="0" keyframes="0=800;" factor="1000" default="0">
   <name>Amount</name>

keyframes="0=800;"  <- that is the value of the slider, and must be preserved. This effect is normally keyframeable, but in this case there is only one keyframe, and so that value must be applied to all the frames that the effect stretches over, hence "0="


Now, in the file "temporary", the line reads:
  <parameter max="1000" factor="1000" min="0" intimeline="1" type="simplekeyframe" name="Amount" default="0" keyframes="4670=800">
   <name>Amount</name>

Here I see:
keyframes="4670=800"
This should read 
keyframes="0=800"
ie: no keyframes for this saved effect. The keyframe 4670 is not in the range of frames for the clip is is applied to, and so all the sliders get their default, minimum values.
Comment 13 Jean-Baptiste Mardelle 2016-02-15 20:16:27 UTC
Git commit 91f799c394906c134ab30b5f6b82f63592a3b177 by Jean-Baptiste Mardelle.
Committed on 15/02/2016 at 20:16.
Pushed by mardelle into branch 'master'.

Fix saving keyframe effects in group

M  +11   -0    src/effectstack/collapsibleeffect.cpp
M  +3    -0    src/effectstack/collapsibleeffect.h
M  +2    -2    src/effectstack/collapsiblegroup.cpp

http://commits.kde.org/kdenlive/91f799c394906c134ab30b5f6b82f63592a3b177
Comment 14 Evert Vorster 2016-02-15 22:49:32 UTC
Much, much better. Thanks for taking a look at this. 
Effects now are saved properly, and apply properly. 
There is a separate issue of save files not preserving the order of the filter stack, but I will open a separate bug for that. 

The main issue here is fixed. Thanks very much for your patience and determination.