On Fri, Oct 9, 2020 at 10:19 PM linux...@tin.it <linux...@tin.it> wrote:

> Hi all. I am writing a basic video editor based on MLT. At the moment,
>
> I use an mlt_playlist, which lets me append video files, break them in
> clips, and connect different filters to different clips. So far so
> good, I appreciate
> the clean C interface of MLT: congratulations. But
> now I'm facing a problem
> I don't know how to manage. In my editor, I
> would like to always see two
> pictures, the original one and the
> manipulated one. I thought I could use
> a "multi" consumer, but this
>

That will not work. MLT does not have a general tee-like component. The
consumer always goes at the "end" of the pipeline or graph like a sink.
multi consumer was designed primarily for use with the avformat consumer to
provide different renderings/encodings of the same composition.


> multi consumer should not be attached to the playlist itself because, I
> suppose, the playlist spits out frames already processed by the
> different filters attached to the single clips.
>
> Perhaps I should
> attach a multi consumer to *every* clip I append in the playlist?
>

That is not how a consumer is used. MLT does not well support arbitrarily
combining things in weird combinations. There are tried and true patterns
exercised and tested by the demo scripts, melt command line, and the 3
popular open source video editors that use MLT.


> Could
> it work? Then every clip would have a multi consumer which would
>
> duplicate the frames: one leg would go to the subsequent filter chain,
> and
> the other leg would send unprocessed frames to my "original clip"
> window.
>
> Or is there another way, more simple?
>
>
I have never tried to do what you are doing, but I think you are going to
have to compose and run distinct graphs: one that is unfiltered and another
that is filtered and attach a consumer to each. Alternatively, you could
write a new filter that stores a snapshot of the frame's current image to
some unique property. Add this filter before all other filters. Then, when
the consumer emits a frame-displayed event, get this snapshot image from
the frame to display in another window.
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to