Registered Member
|
I noticed that using some effects or transitions results in massive image quality loss even if no resizing is occurring. The resulting image almost looks like it was decimated to half resolution and resized back up. For example, the loss of quality is very obvious when using Affine Composite instead of Composite even when affine composite is set to have the identity transform. You can also see it when adding the Pan and Zoom effect without any panning or zooming.
I've attached frame grabs taken using VLC of a lossless H.264 rendering of a clip that consists of one png file. You can see that with pan and zoom the image quality is much worse. I am working with some screen capture video (from CamStudio) and some DV. I am trying to cut out parts of the screen video and overlay it on top of the DV. The screen capture resolution is 640x480 and the project target is VGA NTSC so no scaling is needed if I want 1 to 1 pixel mapping. I was able to get 1 to 1 cropping by using the Scale0tilt effect. There is no apparent quality loss with Scale0tilt as long as the crop boundaries are multiples of 4. I was not able to use crop because it always scales so that the pixel aspect ratio is preserved but the cropped out portion is as big as it can be given the output size. Any ideas on how to work around the image quality loss? I have not found a workaround to using Affine Composite or Pan and Zoom to move the cropped out video around within the image frame. |
Registered Member
|
Both AffineComposite and Pan&Zoom perform affine transformations on the pixels with no interpolation. So, yeah, their quality is not very good. That is just the way it is for now and the near term. I recently did some rework on Crop - in particular, when using still photos. I am trying to better understand your use case that makes Crop not effective. If you use it with Composite, then it does not automatically scale unless you reduce the size of the compositing rectangle below the cropped size or unless you enable the Fill or Distort checkboxes.
What is wrong with Scale0tilt besides the multiple of 4? Also, "move the cropped out video around within the image frame" is not clear. Does move mean animate or statically position? Which "image frame" do you refer to? |
Registered Member
|
Even with no interpolation, I would expect AffineComposite or PanZoom with no scaling, no rotation, and integer (or no) translation to produce pixel perfect shifts. I'm guessing you are using nearest neighbor (aka point) sampling. If so, the sampling grid must be off, otherwise the identity transform like in my example above should have the same input and output.
As for crop... What I am trying to do is cut out a rectangle of the screen cap (e.g. 100,100 to 200,300) and have the rest of the image frame completely transparent so I can composite it on top of the other video. As far as I can tell, when I use Crop and cut out 100,100 to 200,300 in a 640x480 image frame, it scales the width of the resulting rectangle from 100 to 640 pixels wide. Scale0tilt does what I expect as long as I don't change the scale, rotation, etc. parameters. What I tried to do with AffineComposite and PanZoom is to move the cut rectangle so that it is not located in the same place as it was before cropping. For example, move the cut out rectangle so that the upper left corner is at 0,0 instead of 100,100 in the composited image. This is a static position change (i.e. it does not change from frame to frame). Although, the option to animate the move would be nice as well. |
Registered Member
|
Yes, by intentional design, Crop, when applied to a clip _not_ being composited will scale. What you want to do, then, is apply Crop to the upper clip of two clips with the Composite transition between them. In the Composite transition parameters, do not adjust the size of the compositing rectangle, just its position.
I still do not fully understand the last paragraph with respect to positioning, but maybe you can do what you want if you make a composite, apply crop to the top clip, cut/razor the top clip and then adjust the crop parameters on the second shot. Or, if my understanding is inverted, then use two composite transitions side-by-side with different positions in the composite rectangle. |
Registered Member
|
To test I tried applying crop to the upper clip then compositing on to a lower clip that is a plain blue square. The result is that the image is not cropped but scaled to the crop size. On the upside, I can reposition the result by moving the compositing rectangle.
Without the composite operation, I get the image cropped but scaled to the full frame size. I've attached the source image used as the upper clip and the result of the crop + composite. The crop settings are Top: 100, Left 100, bottom 189, Right 300. |
Registered Member
|
I think your versions of MLT and Kdenlive are old.
|
Registered Member
|
I've had quality issues doing certain tasks (in version 0.7.5 on Kubuntu 9.10) and it seems to me they're related. First, I accidentally shot some video with a tilt. To remedy it I used a rotation and a scale (to hide the black corners that appear on rotate). The second was to use the AffineComposte to pan across a high-resolution still image and make it look like video. In both cases the resulting quality was too poor to use. As others have noted, the first is like it's working at a much lower resolution that that available. The pan was extremely juddery except for particular scaling factors, suggesting that all the arithmetic was integer.
I've been using Kdenlive for about a year and 0.7.5 was so much of an improvement on what went before it suddenly became a joy to use. I sing its praises to anyone who'll listen. But prior to that I'd been out of video editing for quite a while and my previous experience was with Ulead Media Studio V6 on Windows. This is a fine program, though now ten years old and with noticeable defects in handling new file formats and widescreen. But I still keep a copy on a VirtualBox Win2k image and I found its Moving Paths able to handle both the above and give excellent quality, which at least solved the immediate problems. But it would be greatly preferable to be able to do it all on one program, preferably Kdenlive, as it's a lot of hassle moving projects between OSes. So that would be my plea. I don't know how complex the job is; I assume some kind of area averaging with floating point values is needed rather than simply grabbing the nearest pixel. But it would be such a help and I could finally consign MSP6 to the archive bucket. |
Registered users: bancha, Bing [Bot], daret, Evergrowing, Google [Bot], sandyvee, Sogou [Bot]