[Kdenlive-devel] [Mlt-devel] video stabilization

Till Theato root at ttill.de
Fri Aug 12 08:51:06 UTC 2011


On Friday, August 12, 2011 10:14:12 AM Marco Gittler wrote:
> Am 12.08.2011 um 08:05 schrieb Dan Dennedy:
> > On Thu, Aug 11, 2011 at 10:20 PM, Marco Gittler <marco at gitma.de> wrote:
> >> Am 11.08.2011 um 22:54 schrieb Dan Dennedy:
> >>> On Thu, Aug 11, 2011 at 10:33 AM, Marco Gittler <marco at gitma.de> wrote:
> >>>> Hi
> >>>> 
> >>>> i made an mlt plugin, that uses the stabilization from
> >>>> http://vstab.sourceforge.net/. First tests are working very good.
> >>> 
> >>> What a nice contribution!
> >>> 
> >> :)
> >> :
> >>>> There a lots of speed up to be done (cache calculated values in a
> >>>> file, for later usage).>>> 
> >>> I have not looked at this yet, but can you simply put the calculated
> >>> values in a string property (colon-delimited list of numbers or json
> >>> ala rotoscoping). Then, when serializing a mlt composition to xml,
> >>> it
> >>> will be saved. Next, when loading a mlt xml, the plugin can use the
> >>> values from the property instead of calculating them?
> >> 
> >> i implemented this now.
> >> but it looks first it is not working. but  i found out, the filter
> >> will have 2 runs with the video file, started with>> 
> >>  melt ~/Desktop/IMG_0286.MOV -filter videostab -verbose
> >> 
> >> on the first run it "deshakes" for 38 frames (and saves the values)
> >> on 2nd run (the visible on) there are 45 (correct length) frames.
> >> how can the first (false length) run be prevented, else the vector
> >> data are not correct ?
> >> 
> >> i  had also a first run with 45 frames (a lucky moment) , then it will
> >> work perfect.> 
> > It sounds like in the first run, it is frame-dropping if you are using
> > the sdl consumer. Try running with '-consumer sdl real_time=-1'. Hmm..
> > if you run the first pass with '-consumer xml:test.mlt' to save the
> > values then it will not run through all of the frames, so that mode of
> > operation will not work as I originally thought. I think we need to
> > change the XML consumer to add an option to iterate through each
> > frame. This weekend I will download your plugin and figure out what to
> > do.
> 
> some more test with other videos are working. it seems that the problem
> exists only with video @30fps the first run will then be done with 38
> frames (46 at 30 fps= 38 @25 fps with the same time to run) 25fps videos does
> not have this "bug".
> 
> so i don't know if this must be fixed, or if this is a "video profile" thing
> that must be set for this.
> 
> melt -profile ntsc_dvd ~/Desktop/IMG_0286.MOV -filter videostab -verbose and
> melt -profile pal_dvd ~/Desktop/IMG_0286.MOV -filter videostab -verbose the
> video has every time 38 frame (on the 2 runs)
> 
> melt ~/Desktop/IMG_0286.MOV -filter videostab -verbose
> will have first run 38, second 46 frames. (it is a short video from an
> iPhone)

Hi,
you might want to have a look at how I implemented tracking support for 
rotoscoping (it should be mainly in filter_rotoscoping.c):
https://github.com/ttill/MLT-roto-tracking/tree/roto-
tracking/src/modules/rotoscoping
It is also a two pass operation. In your case it should be easier since you 
don't have to interact with the GUI (in case of the roto filter, the GUI needs 
to update the keyframe timeline for the spline parameter when tracking is 
finished) unless you want to give the user the option to delete wrong tracks.

Nice to see a stabilizer upcoming!


regards

Till
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdenlive/attachments/20110812/9bc220ae/attachment.sig>


More information about the Kdenlive mailing list