Hi all,
I am writing a video editor using mlt. The editor basically
edits a playlist, inserts filters, and does preview via a swallowed SDL
window. When requested, the editor generates an XML file to be fed to
melt(1). So far so good.
In order to crop clips, I used until now the
stock "crop" filter; it works well but, in the editor, I have to put
two instances of it, otherwise the crop is not performed. So, I wrote
my own crop filter, which crops in-place instead of setting some
properties and letting another instance of itself to do the work. The
filter works well when used in the editor ("internal instance") but,
when used by melt(1), the result is wrong. I am sure my filter does the
correct job, but it seems the image it receives, to be cropped, gets
scaled down, even if width and height are correct.
For example, I take
a 320x240 clip and crop 160 pixels from left. In the editor, the result
is a 160x240 picture - correct. When using melt, the output written in
the file (consumer avformat) is correctly 160x240, but the contents are
the wanted picture 80 pixels wide, padded to the right with 80 blank
pixels.
It is about a week I am trying to solve. I tried to set frame
properties in the filter, "resize_width", "resize_height", with all the
possible values, before and after the cropping - nothing happens, the
result is always the same.
Then I ran melt with -debug, and saw that a
swscale filter kicks in and resizes 320 -> 160. Of course, no resizing
should be done, and in fact this does not happen when I am using my
interactive editor. Still this does not explain why the final image is
blank-padded on the right, maybe another unwanted filter kicks in.
My
question is: why melt uses somewhere a rescale filter, when nobody
asked for it? How can I just take the original frame, crop/resize it at
will, and pass it to the consumer (or other filters)? When the
"pipeline" is constructed in the editor it works well, apparently melt
does something under the hood which I need to exclude. What should I do
to make melt replicate the same behavior of the interactive editor?
Regards,
linuxfan
_______________________________________________
Mlt-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mlt-devel