You described the problems perfectly. A clip with slow-motion in the middle needs to be made longer to accommodate the slow part. Also, the part after the slow-motion section will play faster than 1x speed to make up for lost time.
Here’s the process I use to introduce slow-motion sections. I admit it is a little convoluted. I would love to know if someone else has a faster way. However, this method is all-powerful for anything you want to do.
This is the start point of my project. The clip is the standard 10-to-Zero countdown timer, with one second of screen time per number. As noted in the Properties panel, the duration is 10 seconds.
The clip must be extended to accommodate a slow-down section in the middle. This is done by manually changing the Duration in the Properties panel to something large enough to hold my modifications. Sometimes I just double the value and call it a day. Then, I stretch the clip on the timeline from the 10 seconds it was imported as, into the 20 seconds I manually changed it to. The extra 10 seconds will be filled with a freeze frame of the clip’s last frame. Now, we have room to work.
Note: If doing Time Remap on a busy timeline, it may be best to create a new empty track at the top and get this clip set up with plenty of open space on the sides.
Now I add the Time Remap filter. Notice that the speed defaults to 1x, but that 1x applies from 0-20 seconds rather than 0-10. This is convenient because it gives us a keyframe automatically at the very end.
For this example, I want the #5 in the countdown to take three seconds instead of one second. I put the playhead at the beginning of the #5 section, add a keyframe at the playhead, and note that #5 started at the 4;00 input timestamp in the Properties panel.
Now I advance the playhead by three seconds. I want this to be the end of #5 and the beginning of #4 in the countdown. But it currently shows #2 because the video is playing at 1x speed. So I drop a keyframe here and change the input time to be 5;00 (which is an advancement of only one second since the last keyframe). As we can see in the Keyframes graph, we have a flatter spot on the graph that represents the slower passage of time.
However, we also notice that the speed of time for the remainder of the clip has changed to 1.15424x in order to make up for the slow part and still reach 100% playback by the end of the clip. What we need is a way to change the “outgoing speed” of this keyframe to 1x instead of 1.15424x.
Click the right-arrow button in the Time Remap filter to get the Set Speed dialog. By choosing “Lock current mapping”, we tell Shotcut to modify the next keyframe in whatever way necessary to restore the graph to 1x playback speed. Visually, this means the final keyframe will be lowered, which means 100% playback will not be accomplished by the time the clip ends. This is okay, because the end of the clip is a freeze frame that nobody is going to see anyway.
Now that the graph is at 1x speed after the slow-motion section, all we need to do is find the end of the clip (or whatever point we want to stop at), and hit the “o” key to mark this as the clip’s Out point. The freeze frame portion will now be chopped off, and the clip will look normal.
Depending on where and how these settings were edited, keyboard focus may not be on the timeline, causing the “o” shortcut key to not work. Either click in the timeline area, or use the Shift+Esc shortcut to reset focus for the “o” key to work again.
At this point, the clip can be moved to its final position in the timeline among other clips.
The main complication is first extending the clip to give yourself room to make adjustments. It’s pretty straight-forward after that. Not to say that it’s simple or intuitive, but at least the tools work as expected once the clip is long enough to play around.
Here is the countdown clip if anybody wants to follow along with the screenshots. The player widget provides a Download option.