Hello,

I've commited a change with a new filter combining both detect and
transform filters. Also, I've cleaned up code and added a reset on seek in
the deshake filter, but be aware that it expects continuous frames to work
now, so for example, it won't work when frames are dropped.
Also, I had an issue with switching from detect to transform pass, because
there is no clear indication when the filter has finished processing
frames. Of course, there is frame counting, but somehow the filter_process
function is called several times for the last frame. ;( In a result, the
filter may switch to transform too early, but at this point it shouldn't be
a problem.

https://github.com/jksiezni/mlt/commit/91064defbd89c12ff28acdd5362cb96317053a36

--
Regards,
Jakub Ksiezniak


2014/1/8 Brian Matherly <pez4br...@yahoo.com>

> >> Based on my analysis, I don't think it will work
> >> very well to encapsulate detect and transform. I
> >> think we should simply combine the detect and
> >> transform filters into a single filter. In
> >> "vid.stab.detect", you used a clever trick to
> >> rename "mlt_service" to "vid.stab.transform" so
> >> that running melt with the MLT XML will cause the
> >> transform filter to be used on the second pass.
> >> This is a very clever use of properties, but it
> >> only works for the two-pass melt method and isn't
> >> friendly for an application which will keep an
> >> instance of the detect filter and re-run that.
> >> Also, changing the "mlt_service" property is not
> >> a precedent we want to set.
>
>
> >> The new filter name could be "vidstab" (notice there
> >> is no "eo"). The behavior should be the same as the
>
> >> "videostab2" filter.
>
> >> Jakub,
> >> Would you be willing to combine the detect and
>
> >> transform filters? If not, I should be able to
>
> >> get around to it in the next week or so.
>
> > Sure, I can do it. I've already got an idea to add
> > an if() to process_filter functions, so it would look like:
> >
> > if(there are no vectors) {
> >   mlt_frame_push_get_image(frame, get_image_and_detect);
> >
> > } else {
> >   mlt_frame_push_get_image(frame, get_image_and_transform);
> >
> > }
>
>
> Yes, that should be all it takes to make it work.
>
>
> >> Also, the deshake filter looks good. But it will
>
> >> provide strange results when seeking because it
>
> >> will be using information from frames that do not
> >> immediately proceed the frame being processed. It
>
> >> might be a good idea to detect seeking and call
>
> >> clear_deshake(). I'm willing to commit the module
>
> >> without this change, but I thought I would mention it.
>
>
> > Hmm, there is a "refresh" property that controls when the
>
> > stabilization data should be reset. Wasn't it supposed to
>
> > be used in cases like seeking, etc.?
>
>
> The "refresh" property is OK in cases where the application is changing a
> filter parameter because it knows what filter it is operating on. But it
> does not work well for seeking because the application may now know what
> filters are attached to a producer it is seeking on. Some services check
> for parameter changes with each processed frame to avoid "refresh" type
> properties.
>
>
> > However, clearing this data won't help much, as in your
> > case it is almost impossible to always get the same
>
> > transformation without knowing backward frames. Almost,
> > because there is a possibility to save frames while
>
> > playing, so they could be replayed by the filter when
>
> > necessary.
>
> I understand your point - that a seeked frame will not receive the same
> transformation is it would if its predecessors were played before it. My
> thinking is that in the case of seeking, it might be more visually
> appealing for the filter to restart on the new frame with no vectors,
> rather than some random vectors from some completely unrelated frames. It's
> a minor nit for your consideration.
>
> ~Brian
>
>
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to