Advanced trim tools and trim window.
Open, Needs TriagePublic


for more explenations read here:

I don't know if it can be useful because Flowblade and Kdenlive are both based on MLT but Flowblade is written in Python and not in C++ as Kdenlive is. Aanyway here you can find the code that flowblade uses for three of these trimming operations:

afarid moved this task from Feature ideas to In Progress on the Kdenlive board.Apr 22 2016, 7:13 PM
afarid moved this task from In Progress to Feature ideas on the Kdenlive board.

Ripple edit is a feature I would like to see in Kdenlive because it would greatly improve the editing workflow in my Kdenlive screencasting projects. I regularly have sets of go&still clips, where in the go clip shows some activity and the still clip is a still of the last frame of the go clip. As I need to synchronize these groups to a voice over audio clip I need to ripple edit thee still clips to match the voice over explanations.

I guess it's correct to begin to implement these features by starting with a basic rolling trim by the mouse.

With the preview rendering and timeline toolbar now in place, ripple editing using the mouse would be the final blow to send me to Kdenlive Heaven (at least for the moment).

In my projects, I regularly first drop the go-and-stop clips onto my story main video track. At this point the clip lengths are correct only for the "go" parts, while the stills (the "stop") don't have correct clip lengths yet. I then need to resize them so that the go-and-stop rhythm matches the narrator's voice over. So a ripple edit using the mouse would greatly improve editing for me: just resize the stop clip to its required length, with all later clips on the same trip shuffling back to make room.

The existing advanced editing modes unfortunately don't help me here, as for the stills I don't know their exact length until I have the narrator's voice over audio track ready.

I agree with you that trimming tools will be a great improvement in the Kdenlive workflow.
But I guess that Jean-Baptiste wants to complete the rendering function before to move to this task.
I guess we have to be a little patient. He said that he felt very tired and he was sorry for the "accident" which occurred.
I hope that we'll can take decisions and we'll focus on further steps during the Kdenlive café #7 which will be on next thursday June 9.

I made a first attempt at Ripple window. There is a new "Ripple Mode" button in timeline toolbar. Selecting a clip in timeline and clicking the Ripple Mode button will change the monitor to display a split screen (see screenshot) allowing to scroll left/right to adjust start point. Currently Accept/Cancel buttons not working.

It looks like an interesting approach. I hope that you'll put some version of the code on the git soon, so I'll be able to compile and test it.

This is already in git, as well as some attempts to fix movit crash, so you can already test..

OK. I just don't know why at
there is written that the last update was made by Vincent 3 days ago.
Am I missing some details?

Oh, that's because I had not pushed to launchpad.
Our master git repository is on KDE's servers:
I have now pushed to launchpad though, with the accept button performing the ripple edit on clip start

I'm sorry for making you wait but I tried to use the new feature in "Strict" mode and it made Kdenlive crashes.
After some attempt my mind was lighted by the doubt and I used the clip in "Mixed" mode and I was finally able to perform the action.
As a first comment, sorry if I'm so strict with definition, but you are working on a "Rolling" and not on a "Ripple". Anyway if you read what I wrote in the past I'm sure that "Rolling" is the correct first step.
I tested the new feature by dragging the edit line, by moving it frame by frame from the keyboard and by the mouse (by clicking on the project monitor) and also in dynamic mode (by playing the timeline via JKL) and it always worked perfectly!!! :)
I don't believe we need the accept/cancel buttons: you perform the action and when you quit the trim mode, the clip stay in the position you left them.

I watched only a "strange" behaviour:

  • If I go back before the begin of the following clip, the first clip is shown at full screen.
  • If I go forward after the end of the first clip everything works as it has to be. - the project monitor stay splitted and the clip without material is shown as black.

My suggestion is to create a button for the "Trim mode" instead of "Ripple mode" which changes function in relation to the position of the edit line or to what is selected/unselected on the timeline.
Once we are in the "Trim mode" the GUI tells us how we are working by mouse cursor shape and by what is shown on the project monitor.
Anyway I must admit that this is already a great first step!
We have just to reflect on how to make it work in "Strict mode" and how the feature will react when performed on complex timelines with a lot of tracks and clips.

Before to close, as I'm sure you already saw, I opened a new task for collecting infos about Movit/Nvidia issues. I hope you agree with this initiative.

I just tested the new update but it mostly crashes both in Strict and in Mixed mode.
It happened that in Strict mode it worked only one time and when it occurred Kdenlive performed the rolling operation just on the video, though audio and video was linked toghether.
Anyway this version of Kdenlive now it's too unstable when you use the rolling feature to make further tests.
Let me know what I can do more for helping you.

  1. I can't get it ripple mode working at all. I've found the new button and added it to my timeline toolbar. Then I added some clips to the top track of my timeline. Then I selected either none, one, two clips or three clips and pressed ripple mode. In either case I get the cancel and accept buttons, but only a single clip displayed. This clip is also overlaid by the buttons, so I only see roughly the top half of my clip. But I don't see two clips. What am I doing wrong?
  2. Anyway, I don't see at the moment how a "stateful" ripple mode monitor would fit into the user interface? What are the buttons supposed to do? As massimostella mentioned, as I'm editing the timeline, there hasn't been so far any accept or cancel concept so far. It seems slightly awkward to me. I can understand that there may be different monitor modes, such "normal" and "ripple mode". The new button is already hinting at that.
  3. I'm wondering whether it would make sense to use instead a dedicated (forth) monitor type? That is, a dedicated "Edit Monitor"? But I'm not sure if that would fit into the editing and display organisation habits of other users, so I would like to hear feedback!

It's still in a raw state but it actually works.

  1. Put the edit line exactly between two edit cuts in the timeline at the beginning of the second clip. Then select this second clip and click on the "Ripple mode" button.
  2. Now you can play forward or backward, drag the editline by the mouse or just move frame by frame by the keyboard arrow keys or by the buttons you have on the project monitor. The preview will show you the OUT frame of the first clip and the IN frame of the second clip.
  3. When you finish your job have to accept it by clicking on the "accept" button.

Actually I just said that instead of use the "accept" button we can just go out from the trim mode as it's in standard behaviour.
Test the new feature as I wrote you and give a feedback if it works also on your pc.
Thanks in advance for it.

Massimo, thank you for your help! Unfortunately, I still can't make it work this way. I'm always only seeing one clip with the buttons below. Do the clips need to be on different tracks?

After my first attempt, I realized we really needed to do some cleanup of the timeline code otherwise we are going to end up with a huge messy code for timeline operations. Also, currently making a small change in resize clip operations messes up every timeline operation, so I am in the process of separating the code for each timeline feature.

Also I think I mixed Rolling and Ripple editing in my mind.
However I just pushed a change in master that enables Rolling Edit by doing Ctrl+click+drag on a cut.

Got Ctrl+Click+Drag working. However, I still mostly don't see the two clips side-by-side but only one. Could be the reason that I also have another track on top that uses a transition to combine with the track where I work on a clip cut?

When dragging sometimes I see two clips side-by-side and when I drag further, I only see one again. I also see a lot of timeline corruption, such as one of the clips getting removed from the timeline after mouse release.

Another corruption is that redrawing of tracks under the timeline position cursor seems to be off by one track. Because the topmost track is locked I get the next lower track getting its background redrawn in a brownish red instead of black. And the track below the currently selected track gets redrawn as the selected track. This redrawing is the redrawing necessary as the timeline position head moves to some other position.

I just tested the latest git version (from the kde git as you shown me last time) and for me Ctrl+Click+drag doesn't work.
More now I have the same problem as thediveo: I have no more the two pictures side by side but only a big one half covered by the button.
Of course this is just for giving a feedback. I know you are working on cleaning the code so I rolling feature is in a total work in progress.
For the rest, it's not a problem at all that you mixed the 2 names. I just wrote it for being clear and for avoid issues in next communications.

massimostella updated the task description. (Show Details)Sep 1 2016, 1:32 AM

I usually can edit only one clip, afterwards, ctrl+click doesn't work anymore for some reason. What's the purpose of the Done button? Do I need to explicitly accept my changes? What if I just click anywhere else in the timeline; can I ever go back to this edit?

mardelle updated the task description. (Show Details)Sep 20 2016, 8:31 PM

I finally tested the new implementation of the rolling trim.
Here below I wrote a list of the suggestions I had while I tested it:

  1. The clip selection is a perfect idea for slip and slide because you act on the clip you selected. For rolling and ripple, which work on two adiacent clips, you have to indicate which is the border you want to trim. At now I saw that it depends on the positiion of the edit line which has to be placed in the selected clip range. My suggestions about are: for rolling and ripple you move the edit line on the place you want to in the middle of 2 clips by using the page up and down keys (or the keys set in your configuration) and then switch to the trim mode by using a toggle switch or a key. For slip and slide you select the cip you want to edit and then you enter in the trim mode by using the same toggle switch or the same key. For exiting from the trim mode you can use the close button or the esc key which already works.
  2. The fact that you have to keep the ctrl key pressed during the operation doesn't allow you to use the play function (JKL) for dynamic trimming.
  3. Probably the trim window might be arranged in a better way: We could have buttons at the place of the big "close" green bar. For eg:
    • 5 and 10 frames forward and backward buttons
    • button for selecting the type of trimming action (rolling or ripple and slip or slide depending from how you entered in the trim mode - by selecting a clip or by positioning the edit line in the middle of 2 clips)
    • other ideas and the close button too
  4. It's important to remeber that in slip and slide mode we'll need 4 thumbnails as references, the OUT point of the previous clip, the IN and the OUT points of the clip we are editing, the IN point of the following clip.

Before to finish I have to remark, though I'm pretty sure it's a known thing, that sometimes the preview has issues and it shows only one of the 2 clips at full dimension covered by the 2 color bars.
I hope my comments will help the good job you're doing.

One more question, I am not sure how the trim mode should be related to the "normal / insert / overwrite" modes that we currently have in timeline toolbar.
Are the "insert/overwrite mode supposed to only work on new clips added to the timeline ?
And trim modes are related to edition of clips that are already in the timeline? Because it seems to me that resizing a clip in overwrite mode would in fact do the same as a ripple edit.

By the way I just noticed that resizing a clip in insert or overwrite mode corrupts the timeline :().

So, would it make sense to make it a full editing mode, excluding others in the way we have normal, insert, and overwrite?

In consequence, we would need different modes for rolling edits versus ripple edits, if I'm not completely wrong?

massimostella added a comment.EditedOct 2 2016, 12:12 AM

I hope I'll be able to clear all doubts.

  • >> Are the "insert/overwrite mode supposed to only work on new clips added to the timeline ?

They are not. Actually, as you can see, if you move a clip which is already in the timeline, in all the 3 modes, it behaves in the related way. What we didn't just decide is, when in insert mode and you move a clip from a position to another on the timeline, if the gap collapses by itself (a sort of extract as happens in AVID). But I guess we can let it as it is now because, personally, I think is better.

  • >> Trim modes are related to edition of clips that are already in the timeline? Because it seems to me that resizing a clip in overwrite mode would in fact do the same as a ripple edit.

I checked that by resizing a clip in overwrite mode Kdenlive sometime allows you to work as during the rolling edit (though it doesn't always let me to overlap the adiacent clip) When it lets me to do it, if I click on the clips in the timeline one at time, the resized one shows the new duration, and the other one shows me the same lenght it had before I performed the operation, as they were overlapped and not cropped. I guess that you are right and this is, probably, some sort of timeline corruption.

Anyway, I don't think that the modes we have at today in Kdenlive has to have something in common with the advanced trimming features.
In other apps, after you stepped inside the Trim mode, the behaviour changes. You can just perform trimming operations.
Then, when you finished, you go back to standard editing function.

For going forward, I must admit that what thediveo wrote is quite correct.
My suggestions about are:

  1. Create a button and a keyboard shortcut for entering in the trim mode. Once we are in the trim mode, the project monitor becomes the trimming window with all its tools and buttons (eg: type of trim feature, +- 1, 5 , 10 frames and 1 second, play, stop and reverse play) and the preview video thumbnails. Then, you can perform your trimming action by using the keyboard, the buttons in the trimming window or the mouse on the timeline. When you complete your operations you exit from the trimming mode by clicking on the close button or on the esc key (as you have to do now when you use the beta rolling ripple feature).
  2. For slip and slide, you select a clips in the timeline and you enter in trim mode. After, you select if you want to slide or to slip by clicking the button in the trimming interface or a keyboard key.
  3. For rolling and ripple, you put the edit line bertween two clips in the timeline, you enter in trim mode and then you choose if you want to rolling or to ripple. If we have a cut between 2 clips at the same time on more tracks in the timeline, we ripple or roll all the tracks which are not locked.

I checked the new updates.
The rolling trim works pretty well. Though, in strict mode, it just trim the video and not the audio.
For the rest, I guess that in the future it'll necessary to replace the name of the different modes with icons as it is in other applications because a lot of people don't know the name and the differences between these trimming features so symbols could be helpful for someone. Of course a tab with the name which shows up when you pass on the button with the mouse could be as well usefull for people who knows the name of the feature and want to learn which symbols Kdenlive is using for indicate the functions.

About the selection mode, I believe it's correct the way it is: if you enter in the trim mode and you select ripple or rolling you'll work on the edit cut closer to the edit line (cursor), if you choose slip or slide you work on the clip where the edit line is placed on.
The only questions I have about this approach are:

  1. When you go in slip or slide mode, will you work on the clip in the target track, if you have a multitrack project and you have not selected any clip? (For rolling and ripple it's not a problem because the closer edit cut it's always the closer one on one or more tracks)
  2. In ripple edit, how you can tell to Kdenlive which is of the two clips the one you want to modify? (the one on the right side or the one on the left side of the edit cut). In other application generally this situation is managed this way:
  • if you use the mouse the cursor change the shape if you move it on the right or left side of the cut telling you on which clip you are performing the action
  • if you use the trim window you can select which is the clip you want to trim generally by clicking on its thumbnail.
  • If you use the keyboard you need to use a key for move from one side to the other one.

Of course mine are just suggestions. I'm waiting to see for new developments of this new important feature.

afarid moved this task from In Progress to Pro Features on the Kdenlive board.Nov 12 2017, 6:58 PM