[Kdenlive-devel] image clips improvements

jb jb at ader.ch
Sat Dec 30 18:23:41 UTC 2006

On Friday 29 December 2006 15:18, Carsten Pfeiffer wrote:

> in the video from my last vacation, I want to mix quite a few video clips
> and image clips. Creating image clips is currently a bit tedious -- you
> have to create every single clip for every image manually. A "batch
> creator" would be nice, where you simply select all the filenames and set a
> default duration. I'll see if I can come up with a patch for that.


> More problematic however, is that the images will be stretched to the
> output size. If you have a rotated image (i.e. height > width), then this
> image will be stretched to fit to your output format (e.g. 4:3), making it
> look ridiculous. It would be nice to have an option to either perform the
> stretching or to keep the size ratio and fill the rest with a configurable
> background color.
> If anyone can give me a pointer where to add this (mlt, I suppose), I might
> have a look at implementing this.

I just checked and in fact the streched resizing is done by Kdenlive. By 
default, MLT proportionally resizes the image, which is of course probably 

Kdenlive adds an "aspect_ratio" parameter to the image producer so that it is 
streched to completely fill the project's frame size. (you can find this in 
docclipavfile.cpp line 383 for clips showed on the clip monitor and in 
clipmanager.cpp line 599 for the timeline clips)

When MLT resizes the image, it does not fill the borders with another color. 
Instead it creates a video clip with the image size.
Let's say you have an image with size 200x576, the resulting image clip will 
keep this size. The problem is that if you attempt to make a push transition 
between a normal clip and this image clip, you will get weird results since 
the transition movements are defind in % of a frame.

The best solution would probably be as you suggested to offer an option in the 
MLT image producers to fill the borders of an image with a definable color. 
If you want to have a look, there are 2 main image producers in MLT:

pixbuf found at: modules/gtk2/producer_pixbuf.c and
qimage found at: modules/qimage/producer_qimage.c

Then it would be easy to switch in Kdenlive from current policy to 
a "proportional resizing".


More information about the Kdenlive mailing list