[Custom Plugin] OmniSwipe (swipe/slide transition)

This is my second custom plugin, after making Camera Shake Organic.

I wanted to make a custom transition plugin that can handle pretty much any swipe/slide transition, without having to load or tweak multiple plugins.

I used Grok(AI) in actual coding (since I have literally zero background knowledge in programming), but I spent a lot of time trying to understand and design the abstract-level architecture and data flow myself.

I also ran into a lot of technical API limitations in Kdenlive / frei0r that made me seethe and pull my hair out. (There seems to be many weird things going on there…) But in the end, I managed to solve or work around them all eventually.

I’m happy about how it came out.

Features

  • Arrival Direction Axis / Wheel: Controls the angles at which the incoming clip enters.
  • Departure Direction Axis / Wheel: Controls the angles at which the outgoing clip disappears (when moving).
  • Outgoing Behavior: Static / Move / Fade.
  • Speed Curve (%): Higher % = stronger acceleration.
  • Gentle Arrival (%): Add smooth slowdown to the clip’s movement. It switches between 2 mechanisms depending on the Speed Curve’s state.
    • When Speed Curve is at 0%: Gentle Arrival acts like a reverse Speed Curve, adding a negative logarithmic curve to the speed. As you dial up Gentle Arrival, the curve will become stronger, and clips will start fast and decelerate towards the end.
    • When Speed Curve is used: Gentle Arrival’s intensity will symmetrically mirror Speed Curve’s logarithmic curve. And as you dial up Gentle Arrival, it will expand the ‘effective zone’ from the clip’s end. The clips will start to slow down as the playback enters this zone. At 100%, the entire clip is under Gentle Arrival’s control.
  • Motion Blur (%): Add directional blur to the moving clips.
  • Edge Smoothing:
    • ON: Smoothing out the clip’s edge pixels.
    • OFF: The clip’s boundaries are exactly snapped to its actual content.
  • Invert: Invert the effect.

Demo

https://i.imgur.com/raFkK4e.mp4

Limitations

1. The current motion blur is very low-res to prioritize performance.

I’m not sure why, but blurring or anything that involves higher sampling seems extremely costly in Kdenlive plugins. (I cross-checked it by adding bilinear sampling to other official plugins.)
I didn’t add controls for blur quality since I thought it was not that important, but if anyone requests, I might later.

2. ‘Edge Smoothing’ introduces dark edges on blurred clips.

(I almost puked while dealing with this issue.) This is seemingly due to Kdenlive’s limitations. When the plugin receives the clip data from Kdenlive, it seems to come with an invisible padding around the actual content clip, matching the project’s entire resolution. This invisible area lives in the buffer, though it’s typically invisible in the output/preview.


(Pardon the image. Art credit: @QupoStuv35)

As you can see in this debug image I used, what the plugin recognizes as ‘a clip’ is actually this entire area that includes this buffer. (The magenta part in the picture is what the plugin thinks is the ‘outside area’.)
This becomes problematic when you try to add blur or any feature that involves fuzzy pixel sampling. The fuzziness pulls this black area into the visible area at the clip’s edges, and ‘black edges’ appear out of nowhere.

From the plugin’s perspective, this padding seems to be literally merged with the clip’s content and is inseparable. :expressionless_face:
To solve this problem, I added a ‘content detection’ in the code. It scans the image to detect where the black/transparent area ends, and strictly crops the processing area to the actual content.
However, this approach makes the edge sharp or jaggy in some cases, because the cropping is extremely strict to prevent the black from leaking in. That’s why I made it an option to give users more control.

  • When ‘Edge Smoothing’ is on: This content detection mechanism is disabled, and the plugin samples the entire area with the invisible black padding. (That being said, the black edge will appear with this option, especially if the clip is blurred.)
  • When ‘Edge Smoothing’ is off: The content detection is enabled, snapping the processing area to the clip’s actual content.

(In Camera Shake Organic, I additionally implemented additional padding to smooth out all 4 edges.)

3. Minor issues

  • It doesn’t support keyframes.
  • The thumbnail is not generated in the docker.

I couldn’t figure out how to do them. I’m not sure if Kdenlive supports them or not with the custom plugins in the first place, tho.

License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0).


It’s been a long, hard journey.

As a disclaimer, it works well on my PC, but I cannot guarantee that it will for you. Use it at your own risk.

3 Likes