On Wed, Jan 1, 2014 at 5:58 AM, Jakub Księżniak <jksiezn...@gmail.com> wrote:
>
> W dniu 31.12.2013 19:08, Dan Dennedy pisze:
>> On Tue, Dec 31, 2013 at 3:21 AM, Jakub Księżniak <jksiezn...@gmail.com> 
>> wrote:
>>> Hello,
>>>
>>> I've implemented a new module for video stabilization using the vid.stab
>>> library (from https://github.com/georgmartius/vid.stab).
>>>
>>> The reason to this work, was mainly due to a bad performance of videostab2
>>> filter. Later, I've learned that this filter used an old version 0.75 of
>>> vid.stab library. So I took the code from videostab2 module as a model and
>>> created 3 new filters in a 'vid.stab' module:
>> Thank you for your contribution!
>>
>>> vid.stab.deshake - A single-pass video stabilization filter.
>>> vid.stab.detect - 1st-pass filter, detects motions in the video.
>>> vid.stab.transform - 2nd-pass filter, applies transformations to the video.
>> You could please combine detect and transform, or make a new service
>> that encapsulates and switches between them? Otherwise, it will be
>> quite tricky for most MLT apps to integrate them. Quite a bit of new
>> code would need to be written to handle this. There are a few examples
>> of services the encapsulate or wrap other services: loader producer,
>> melt producer, watermark filter, dynamictext filter.
> Sure, I can combine detect and transform filters, just like in
> videostab2 filter, but it isn't clear to me how other apps know which
> pass is performed by the filter.
> The videostab2 filter determines it by checking if exists the "vectors"

That is how Shotcut checks whether the first pass was completed as well.

> property. In my approach, I rename the vid.stab.detect filter to
> vid.stab.transform when running the detection filter:
>
> mlt_properties_set(properties, "mlt_service", "vid.stab.transform");
>
> It works very well in a command-line environment, when I use the
> vid.stab.detect filter with a xml consumer, though it's a bit ugly.

Yeah, command line is not a problem. but in a GUI app, the detect
filter may be initially created and attached as a by-product of how
filters are integrated in general. Then, first pass is launched as
background process. Upon completion, the user can preview the results
via second-pass mode. If the service name needs to change, that's
where things may get a bit ugly for some GUI apps because the existing
filter needs to be detached, and the new one created and attached
seamlessly to the user. Also, when loading a project, attached filters
are listed and UIs presented, and that may be controlled by
mlt_service. Then, let's say the detect pass needs to be re-run
because the user is choosing only to run detect on a trimmed clip to
save time but has changed the in/out. Then, again, something similar
needs to happen. This is the first time we have seen where filters can
swap around like this in MLT, which presents new challenges for apps.

> Also, examples you mentioned do not require multiple passes (or am I
> wrong?), so I'll just stick to the solution from videostab2 filter.

The examples were only about encapsulation or fronting other services
(loader, melt). By "fronting" I mean the service creates another
service and returns a pointer to that instead of creating its own
service. Fronting is not a good fit here. What I am proposing is that
there can be a fourth vid.stab filter that encapsulates and switches
out the underlying filter based on some property much like videostab2.
That way you can keep things neatly separated as they are. Or, like I
said, you can leave it as a nice little task for someone else since it
sounds like you do not need it.

>>> The code is not perfect, but it works great for me. :)
>>>
>>> In order to compile and use the new module, you need to download and build
>>> the vid.stab library first. All filter parameters are the same as in
>>> videostab2.
>>>
>>> The source code is available here:
>>> https://github.com/jksiezni/mlt/tree/master/src/modules/vid.stab
>>>
>>> Feel free to modify this code or integrate it back to videostab module.
>> Or perhaps someone else can volunteer to do that.
>>
>>> --
>>> Happy New Year!
>>> Jakub Księżniak
>> +-DRD-+
>
> --
> Best Regards,
> Jakub Księżniak
>



-- 
+-DRD-+

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&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