[Cin] Issues related to Motion Plugin

Miroslav Rovis miro.rovis at croatiafidelis.hr
Sun Sep 25 14:15:22 CEST 2022


On 220925-17:39+0700, Georgy Salnikov wrote:
> On Sun, 25 Sep 2022, Miroslav Rovis via Cin wrote:
> 
> > But I plan to make it both a demonstration of this capability
> > and a tutorial so other users can benefit from it, on the one
> > hand.
> 
> Motion plugin algorithm in cingg is rather difficult to understand (the most
> efficient way to understand it is to look inside its C++ code:)
I see. 
> Moreover, it has some tricks that, although can be derived knowing the
> details of the algorithm, are absolutely non-intuitive by themselves.
Sounds a little worrying. Similar to what they kept saying about
OpenSSL code. However, openssl has been fixed pretty well after
probably huge time investment by some devs, and is getting to be
in really good shape now. And it's been there since, I believe
Netscape invented SSL. In good shape again, with all the cludgy
code added in when new ways of TLS and other stuff were
invented, all that either still working, or rewritten (didn't
look it up in any detail, but I needed OpenSSL and I had to get
informed.)
> Moreover, it is rather slow, and the results cannot be visible immediately
> while altering the settings.
I know it very very well. I used to have slower systems than
now, and sometimes it was days work on a say 20m video to get
anything out.
Yes, it is slow, but if you don't have the expensive hardware
called stabilizer, I do not see that there is an alternative.
Did you see the links to the example and the comparison videos
that I gave? 
> If the user needs only a smoothed video, perhaps he should not do it with
> the Motion plugin. The ffmpeg's vid.stab plugin is much easier to use, it is
> faster, and gives very good results.
Huh! I'll try and see what that is. But where is it? Search
'vid.stab' in ${cin_src_root}/ gives nothing.
Also:
 -name '*stab'
nothing.
And
 -name '*stab*
gives a lot, of which:
$ find /mnc/src_n0/Cin/cinelerra.BUILT/cinelerra-5.1/ -name
'*stab*' | grep ffmpeg-5.1 | grep libavfilter
/mnc/src_n0/Cin/cinelerra.BUILT/cinelerra-5.1/thirdparty/ffmpeg-5.1/libavfilter/vf_vidstabtransform.c
/mnc/src_n0/Cin/cinelerra.BUILT/cinelerra-5.1/thirdparty/ffmpeg-5.1/libavfilter/vidstabutils.c
/mnc/src_n0/Cin/cinelerra.BUILT/cinelerra-5.1/thirdparty/ffmpeg-5.1/libavfilter/vidstabutils.h
/mnc/src_n0/Cin/cinelerra.BUILT/cinelerra-5.1/thirdparty/ffmpeg-5.1/libavfilter/vf_vidstabdetect.c
$
So that must be what you mean.
But where is it in the GUI? Right click on a video track,
"Attach effect" and under "Plugins" there is nothing that starts
with Stab or Vidstab...
(And are you sure it is so good in comparison to the Motion
Plugin?
However, this will put off my plans if it is so.)
> CinGG's Motion can be powerful, if you need either to freeze motion
> completely, or you need motion tracking instead of motion stabilization.
> 
> > The fist issue:
> > When using Motion Plugin, a last-used setting (previusly used,
> > even in a different video) is written in the new XML along with
> > the newly setup numbers for a particular part of a video to
> > which Motion Plugin Effect is attached. And it sometimes messes
> > up the XML, and rendering does not get what the user put in.
I read and I may still get back later to your reply w.r.t. this
cache issue. Thanks for the explanation!
> Yes, it is the intentional behavior. Not only Motion, but all the cingg
> plugins save their settings in their defaults, and reuse them in new XML
> projects. Usually this behavior is convenient. In any way, the user has to
> reinspect the settings of the used plugins to make sure they are set as
> intended.
> 
> > The second issue:
> > And, sometimes, there appear to be problems with some Cinelerra
> > cache somewhere so bad that tweaking the Motion Plugin settings,
> > while written correctly in the new XML, do not actually apply.
> > The rendering gets the user the earlier tweaked result no matter
> > the new editing.
> 
> The Motion plugin cache is an ingenious thing, and sometimes allows to play
> with very sophisticated techniques. For example, by editing the cache (it is
> a simple text file), perhaps with some custom script, you can induce some
> kind of motion which would be difficult to make in other way. But in the
> same time the existence of the cache file can trigger user's mistakes. So
> you must always pay attention, which cache file may be used in the moment.
> 
> Motion's cache data are absolute-frame-number based. If you insert some
> small piece of video before that where the plugin was attached, the frame
> numbers get displaced relative to the cached numbers, and the result may
> become incorrectly stabilized.
> 
> It is not possible to switch Motion cache off. While working, Motion always
> looks in its cache. If it contains some data assigned to the current frame
> numbers, that cached data will be used unconditionally. If not, that data
> will be calculated, stored in the cache, and later reused, also
> unconditionally.
> 
> In the Motion plugin dialog there is a button 'Clear cache contents' (or
> something like this). When in doubt, you can press this button, the cached
> data will be erased and fresh recalculated on the next pass.
> 
> It is quite usual to wish independent caches for different parts of video.
> It is possible to set such distinct cache file names (either manually, or
> let software generate them). When you generate new names, the plugin
> automatically switches Calculation off, just for security. You switch it on
> again when needed.
> 
> If 'play track' is switched off for the track where the Motion plugin was
> attached, the plugin will calculate nothing. Also, if 'Play every frame' was
> not active in Preferences, some video frames can get skipped from
> processing.
> 
> > I want to do it along with demonstrating a very good motion
> > stabilization on not-too difficult parts of a 1m 30s video that
> > otherwise would be almost bad for viewing.
> 
> Phyllis has such a very shaky example. May be, I have yet a cingg project to
> stabilize it using Motion plugin keyframes. Should I search for it?
If you think so.
I don't know if I will use it, as yet, because I thought my 1m
30s video would be great for demonstration.  Did you consider it
at all?
Also let me first understand what you wrote about the vid.stab,
and let me see what that vid.stab is (as I asked above). 
> _______________________________________________________________________________
> 
> Georgy Salnikov
> NMR Group
> Novosibirsk Institute of Organic Chemistry
> Lavrentjeva, 9, 630090 Novosibirsk, Russia
> Phone   +7-383-3307864
> Email   sge at nmr.nioch.nsc.ru
> _______________________________________________________________________________
> 

-- 
Miroslav Rovis
Zagreb, Croatia
https://www.CroatiaFidelis.hr
my PGP-key:
https://www.croatiafidelis.hr/FCF13245ED247DCE443855B7EA9884884FBAF0AE.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20220925/51776145/attachment.asc>


More information about the Cin mailing list