Continue last frame of clip until next clip

I used Shotcut to make this video, and it’s been pretty great to use. I’m about to make another, and I just have one thing that was kind of a pain last time.

I have a lot of clips that I need to cut up to sync with the audio narration. I end up with a swiss cheese of clips. There are hundreds of gaps for me to fill. What I want is for the last frame of the previous clip to continue until the next frame starts. What actually happens is I just get a black screen. So last time, I had to export the last frame to a png, then import it, then size it to fit the gap. It worked, but it was super annoying to do.

Is there a setting I can change to get the last frame to continue in between the clips, rather than showing a black screen? If not, is it possible to write a plugin to do this? I’m a coder so I’m happy to write the plugin myself if it’s possible. The docs say that only filter plugins are supported atm, but it’s not clear to me what that means for my use case.

Either way you may need to extend the Duration in Properties. If the last clip is at the very end (untrimmed) of the source clip, then it repeats the last frame to fill after extending the clip further on the timeline. If you want to repeat the last frame of a trimmed clip, you use the Time Remap filter. Go the last frame of the clip, add the filter, in the filter UI click >, set the value to 0 in the dialog that opens, and then extend the clip.

Time Remap may require your clip to be converted if it has B frames, which might be inconvenient even though it does automatically replace instances of the clip to the converted counterpart for you. Since your last video, there is one thing to make using an exported frame easier: an automatic filename. If you end up going that route, also note that exporting a frame adds the file to the top of Recent; so you can double-click it to open it and then drag it from the player.

Thanks for your response. I just tried those options, but they’re both more effort than exporting the frame (hotkeys make exporting the frame pretty quick).

The UI I’m imagining is a project-wide setting, where you can change the default color to something other than black, or set it to just continue the last frame. That way there would be no extra steps at all, after I’ve cut up my clips and shifted them to line up with the narration.

This is simple to do. Create a new track and move it to track V1. Put a color clip on it the color you want et voila.

I’m not convinced this is more work…

With an exported frame, you have to:

  • Move the playhead to the last frame of the clip.
  • Use the hotkey to open the frame export window.
  • Ideally, give the exported frame a name, for the sake of clarity.
  • Press Save
  • Drag the clip to the timeline.
  • Trim it or extend it to fill the gap.

With the first method suggested by @shotcut:

  • Select the clip.
  • In the property panel, add the number of seconds (or frames) needed to fill the gap. Be generous, if the gap is 1.5 seconds long, add 2 seconds. If the gap is 3 seconds long, add 4 seconds. You’ll only use what you need.
  • Press Apply.
  • Extend the clip to fill the gap.

Other advantage, you don’t end up with all those extra files in your project.

You are basically asking for an option to show something in the gaps or blank sections of the timeline. That will never be accepted.

I’m not really asking for a UI change to Shotcut itself. I know you’re not going to change the UI for everyone just to suit my use case. That’s why I’m asking whether it’s possible to do this with a plugin.

You have to do the efficiency calculation from the perspective of someone doing hundreds of these interactions and putting effort into optimizing it. I don’t need to change the name of the export, so I just press ctrl+shift+E, then enter. I already have the destination folder open (a sub folder of the project, to keep things neat), sorted by creation time, so the frame appears at the top, and I just drag it in. So that’s 1 click to scrub to the last frame, 2 key combos to export, 1 click+drag to import the frame, and 1 more click to adjust the duration of the frame.

There’s no hotkey to open the property panel, as far as I know, or to move the UI focus to the duration box, and it takes 2 clicks on the duration box to focus on the seconds, then you have to type about 2 numbers. Assuming the property panel is already open, that’s 1 click to select the clip, 2 clicks to go to the seconds, 2 keyboard presses to type a new number (importantly, these new numbers will be different for every clip, so you can’t use muscle memory), and 1 more click to adjust the length of the clip in the timeline. If there was a way of telling shotcut to allow extending the length of a clip in the timeline past its duration, effectively skipping the property panel step, then this would indeed be easier.

Also, it doesn’t work for the case where the clips are cut out of longer videos (almost all my clips fall into this category, because I’m trying to sync up narration with a video), and the Time Remap filter solution is harder.

The plugin solution I’m imagining would be 0 clicks.

I’m looking forward to test your plugin :wink:

There’s no hotkey to open the property panel

It’s shows itself in the View menu or Help > Actions and Shortcuts.

No, it is not possible to make a plugin to do this, but you can fork the project and make your own build.

I have used this “freeze framing” technique many times when I made some Shotcut tutorials for YouTube a while ago. Personally I wish it was a feature. Movie Edit Pro has it. Just right-click the gap and select “fill gap with photo” (or similar - I can’t quite remember the exact wording)…

HOWEVER, I developed a way of semi-automation the process with Auto Hotkey (Windows users only, unfortunately).
So I wrote a script which works like this:
Once the AHK script is running: Pressing the CTRL/1 (this is customisable) does this:

  1. Moves the playhead to the end of the clip
  2. Moves the playhead 1 frame backwards
  3. Selects CTRL/SHIFT/E to export the frame
  4. Selects RETURN
  5. (I added a few lines in the script to select “left arrow” then “return” again, to cater for
    instances where the frame has already been exported and you wish to overwrite it)…"
    5.Moves the mouse to position x=1663 pixels, y=155 pixels, from the edge of my computer screen. This is the top line of my “recents” pane, where the exported frame appears. NB this will likely have to be changed to suit the user’s co-ordinates…
  6. Double-clicks the top entry to get it onto the preview pane.

THEN: you DRAG from the preview screen down to the timeline and put the image on V2.

THEN,
Press CTRL/2 to:

  1. Move the playhead to the end of the clip
  2. Press “O” to trim the end of the clip.

THEN…
Press CTRL/1 again and repeat the process if required…

I made a tutorial video to show it in action…

Here’s my script. PS I added several pauses (“sleeps”) of 200 or 300 milliseconds to make sure the AHK script doesn’t go faster than Shotcut…

 SetKeyDelay, 100			   ; ^ =ctrl  +=shift  !=alt
 SetNumLockState , on
 CoordMode, Pixels, Screen
 
 ^q::suspend
 
 ^w::exitapp
 
 ^1::
 send, !{right}
 send, {left}
 sleep, 200
 send,^+e
 sleep, 500
 SEND, {return}
 sleep, 200
 send, {left}
 sleep, 200
 SEND, {return}
 sleep, 200
 SEND, {return}
 sleep, 300
 MouseMove, 1663, 160
 Send, {Click 2}
 return
 
 ^2::
 send, !{right}
 sleep, 200
 send, !{right}
 sleep, 200
 send, o
 return

It is already feature in the Time Remap filter. We will try to add a variant of Time Remap that is forward direction only so conversion of clips with B-frames is no longer required.

And Shotcut has the Replace function in the Timeline that does the same thing except with anything in the Source player and not just an image including respecting the in point on audio/video clips.

1 Like

Wow, that is useful! I hadn’t used “Replace” before- I was rather unsure how it worked. So after exporting the last frame and double-clicking it in “recents”, there’s no need to drag and trim. Excellent tip, thanks @shotcut.