Smooth, Slow Bar Transition

Hello, I’m trying to make a 60 seconds horizontal bar transition that has a sharp edge but is smootly animated. However the my attempt results in a “laggy” animation, where every 3-4 frames, the bar moves by 2-3 pixels (this is at 1080p30fps).

Does anybody know a solution for this?

When I tried to achieve a horizontal bar transition (wipe) in Kdenlive, the laggy-ness was even worse - - and also looking at the XML files of both Kdenlive and Shotcut revealed quite some differences, so I thought maybe shotcut uses a different feature of MLT.

I realize transitions are not expected to be longer than a few seconds, I’m trying to figure out other solutions, suggestions are welcome of course!

Update: as a reference of what I’m trying to get, Blender was able to do it:

The only solution is to rewrite the MLT luma transition. Currently, it uses yuv422 pixel format with no interpolation, which may have similar limitations to the MLT composite transition (which Shotcut does not use) such that precision is limited to 2 pixels! I suspect the GPU version of this transition may be smoother since it operates in RGB with sub-pixel precision.

Thank you very much for the answer!

I tried shotcut both with and without --gpu flag to render the same .mlt project and didn’t see a difference. Could GPU support have been disabled without me noticing or would shotcut just not have launched if GPU support didn’t work when using the flag?

I used the same .mlt file, I think during non-gpu mode. Do I have to re-create the project while in --gpu mode for it to have an effect or will the transition automatically chose the method based on whether or not --gpu was provided to the running instance of shotcut?

Yes, you need to recreate the project in GPU mode. You should use and check the Settings menu toggle for GPU mode. The project file will have mlt_services that begin with “movit” if you made it in GPU mode. If you use the Horizontal Bar wipe that comes with Shotcut, then it is a 16 bit pgm. The 16 bits does provide a greater precision when determining the current position of the wipe edge. Maybe in Kdenlive, the wipe file is 8 bit, which may explain the more jerky motion.

You’re right!

/usr/share/kdenlive/lumas/HD/linear_x.pgm PGM 1920x1080 1920x1080+0+0 8-bit Grayscale Gray 2.074MB 0.020u 0:00.019

/opt/shotcut/share/mlt/lumas/PAL/luma01.pgm PGM 720x576 720x576+0+0 16-bit Grayscale Gray 829KB 0.000u 0:00.009

/opt/shotcut/share/mlt/lumas/NTSC/luma01.pgm PGM 720x480 720x480+0+0 16-bit Grayscale Gray 691KB 0.000u 0:00.009

If I understand correctly, Kdenlive effectively uses a 256-step horizontal gradient (because of 8 bits) and shotcut uses a 720 step one (because of resolution)

I made a 4K gradient and tested it in both kdenlive and shotcut, both seem to have better results.

convert -size 2160x3840 gradient: -rotate 90 gradient.pgm

I’m not sure whether I managed to create “fair”, comparable projects - especially with kdenlive’s transitions requiring two layers - but if I did, then it looks like shotcut’s lumina wipe bar transition is much more effective:

kdenlive 11m 10s
shotcut   3m 45s

Rendered 1 minute transition between two 4K pngs, on AMD Phenom 9550 4 x 2200 MHz, 64-bit. Both in CPU mode.

I have yet to test very long transitions, which should cause the “it takes multiple frames for 1px jump rather than interpolation”. But I’m happy there was such a simple solution to enhance the wipe.

Thank you for the feedback on your experiments! I will try to increase the resolution of the included wipe gradients.