I have raised this topic already in the kdenlive-devel mailing list. Hoping that someone reads this here, I would like to propose an effect that allows linear transformation of both videos and still images. The idea came from the famous Ken Burns effect used on some screen savers and commercial slide show and video editing software where you can animate a still image by zooming into it an panning inside of it.
I have tried several other OSS programs under Linux and failed for various reasons:
- Blender ruins image quality because it downsamples every image to video output size BEFORE performing the transformation.
- Cinelerra doesn't work and is badly supported
- Jahshaka doesn't work and is badly supported
The only tool that doesn't fail is DVD-Slideshow. The math is done perfectly right but it is slow because of some parts being inefficiently implemented and the slide show having to be coded in a text file instead of a GUI editor. There exists a GUI frontend for DVD-Slideshow which is however practically unusable (and also unmaintainable because of some Visual Basic lookalike being used as programming language instead of standard stuff like Perl, Python, TCL/TK etc.)
Now Kdenlive just falls short of providing a solution as it nicely and comfortably handles still images and transitions. The only way to achive zooming and panning are however PIP transitions which produce a horrible (jittering, flickering) output, probably due to low integer accuracy. The transition is also very counter-intuitive to use and handling it slows down the work.
My proposed effect would use a linear affine transformation which is a generalized mathematical term for
- zooming
- panning
- rotation
- shear
- change aspect ratio
- perspective
The mathematical operation would just consist of a matrix multiplication of the pixel coordinates and a re-sampling of the transformed image.
The previously proposed perspective effect could be easily made a part of this function.
The editor window for the effect would, besides the parameters for the transformation, show the first and the last image of the transformed sequence. All this is not difficult to implement, just two things need to be taken care of, very seriously:
- Use FLOAT, not integer; everything else creates a flickering, jittering, pixelated mess
- Make sure that the effect works on the ORIGINAL image, not on the image after having been downsampled to output resolution. Otherwise, we would end at the same problem that Blender has.
A few more remarks:
1. I would very much like to work on this myself if just someone could give me a hint where (probably in MLT) I can find the programming interface that enables me to
- retrieve the pixels from the frame
- write transformed pixels to the new frame
- retrieve keyframe parameters for controlling the effect
- attach the filter editor to the Kdenlive GUI
- tell the filter whether to perform a fast/ugly preview or a
precision (floating point) rendering.
2. I have given up looking elsewhere for a solution. Please no comments like "try tool xyz", I have tried too many and they didn't work. This was wasted time that I could have used for developing a solution by myself.
3. Just before someone points me at tools running under Windows: I know that there exist some free (as in beer) programs. I do not have Windows and hopefully never ever have to install it on my machine. I want something that runs under Linux or is cross-platform.
