Image Stabilization

Does anyone have a process for image stablization, I guess there's no Frei0r plugin for this. I'm looking at Deshaker for VirtualDub but really how many times does anyone want to render their footage out through one work around or another. Thanks.

Keeping to the subject of stabilization in MLT, integration in kdenlive, ;-) I'm more than happy to test with a number of video formats I use but I really have had little success building from source in the past and this is why I find sunabs svn PPA such a blessing. But I do realize this is Ubuntu only.

What version of ffmpeg should a builder be using? Mine's from ffmpeg git presently.**EDIT** Removed and now using 0.7.2-4:0.7.2-1ubuntu1 :-)

I'm not a KDE fan so really don't want tons of KDE development libraries on my machine if possible especially as I'm going to be adding all this for nothing more than a small gui addition in kdenlive everything else already resides on my machine from sunabs PPA.

Is it possible to have both the stabilize branch and git PPA resident on a machine?

As I already have a 'working' MLT with the stabilize functions (stable or unstable as they may be) in it and it's only the access to the kdenlive gui missing is there no simple way to have this as a tick box inclusion / omit in the svn kdenlive preferences as a temporary measure and WARNING message against it like the threads whatnot already there, that way access to the stabilize functions for testing is open to a wider audience than those willing to compile a separate branch.

Stabilization is a long awaited 'feature' for kdenlive, with an active and willing developer, thanks marco. :-) Be good to see help for users to push the testing of this, to get it into kdenlive.

@betaversion, sorry I missed your previous query to me, my apologies for not responding.

I'm using ffmpeg 0.7.2-1ubuntu1 too.
And... don't worry.
If you'll give stabilization in kdenlive, you'll give stabilization for entire Linux. ;)

Has the stabilize reached sunab's repos yet? I see the menu items but nothing happens after selecting one of the two menu items. No progress bar, no cpu load.

not yet. some little changes and after the release of i think i can merge the stabilizing.
Some more tests can then follow until next release.

Now that is released, admittedly only very recently, would it be possible to add the stabilize GUI to kdenlive git to test. :-)

Pretty please?

(I've been searching for a gui wrapper for MLT/videostab2 as I'm not real good at command line hijinks)

i merged the changes into master. Some test would be nice, but do not use this for production (without saving your project before).
the GUI should be stable, the filter itself should get some more attention.

marco, excellent, looking forward to trying this, just waiting for updated sunabs PPA.

Hi, I used the build script to build kdenlive and associated apps to get an upto date git build to try stabilize. I only testef one clip so far, a Canon DSLR h264 file, after stabilizing finished it was added to the project as a .mlt file then proxy creation started for the clip as expected project settings.

At that point kdenlive crashed.

Other comments on process:

1. Is a separate window for each clip the best choice, I understand this is WIP but I feel a panel might be more suitable or actually handling in the GUI like proxy generation, this may be more difficult if there is going to be parameters exposed needed to be tweaked for each clip. But a new window for each clip could get messy.

2. Whilst stabilizing is happening no proxys get made for any additional clips added to the project tree.

3. Whilst stabilizing no thumbs ie start and end thumb appear on any clip added to the timeline whilst stabilize is running.

4. Whilst stabilizing any additional clips added to the Project Tree have 'Loading' against them, trying to drag onto the timeline fails with warning sound and told 'Clip Not Ready'

Test was done with vstab only not transcode.

Will do many more tests, looking forward to stabilize being stable. :-)

Great to see it added.

Great to see image stabilization has arrived at the main branch and in sunab's ppa repo. Thank you very much for this work!

One thing I noticed that is lacking is support for multi-core systems: both transcode as well as vstab use only a single thread/core -- which is rather boring on a quad core system. ;)

BTW -- for GUI consistency, the job status indication should be an ordinary progress bar and not a slider as used for input.

Opening up the project that crashed and doing an auto recover shows that a proxy had been generated for the .mlt stablizized clip so appears the crash happened after that completed.

Playing the stabilized .mlt clip shows some weird horizontal and vertical smearing of the pixels from areas within the frame smeared out to the edges of the frame, the smearing appears at a point a minute or so into the clip to the end of the clip and varies in it's starting position from frame to frame but always smears out to the edges of the frame.

Doing some more testing, but is slow on my old Sempron. :-)

The proxies for the mlt video files are broken. If you disable and delete the proxy for the .mlt file, you will see the stabilized video result instead of just strange color effects.

Unfortunately not. :-(

Playing the .mlt files back with Melt on the CLI shows the same smearing. :-(

Further test this time with interlaced DV sources and no proxies results are the same, crashing after stabilize / add to project and smearing pixels at perimeter to frame on all edges playing and when encoding via the MLT xml file :-(

I'm assuming theres some problem with the vstab plugin processing the vectors included in the .mlt file.

thats bad. coudl you upload the resulting mlt file and maybe the source video, so that i can check this ?

the interlace code for yuv seem to have some problems.
i hope i find some time next, to fix this.

EDIT: after some tests, i found, the first image is corrupted in filter, the last image is free'd to early, so it segfaults.

the problem seems to be only in the filter itself

fix for both problems is in and will be (i hope) merged next.

after that i'll commit some sse2 speedup fixes (short review needed)

hi marco, I rebuilt MLT & kdenlive from the excellent build scripts on the Wiki about 8 hrs ago, not sure if it included your fixes so will try again later but there did seem to be some improvement in far less smearing but stability was terrible, lots of crashes :-) I tested interlaced DV, not ideal I guess regarding your comment on deinterlacing although I left it interlaced.

I chose DV just because of speed. 15sec clip stabilizes in about 10mins on my old Sempron, a 15sec HDV takes just under an hour, a DSLR HD 15sec nearly two hours, not complaining and only to be expected on my test hardware but adding the mlt files to the timeline crashes kdenlive in a number of ways:

1. Scrubbing through the clip in the Clip monitor

2. Adding the clip to the timeline and moving or scrubbing.

3. Trying to render a clip off the timeline.

I had found I could render a clip with the previous version of the day before yesterday.

Will test again tonight on alternative hardware for comparison.


the fix provided does not solve the problems as i see.
please wait unil i found a sopultion.
when using sse2 optimized version is will work a lot faster.
maybe later i could add also multithreading (but this will not happen next time)

ok, will do, many thanks.

I'm trying Stabilize in Ubuntu svn version.
The transcode version is simply great!


Seems that FFMPEG has sprouted its own stabilization tool!
While browsing the latest FFMPEG sources, I came across this:


haven't yet tried it.

Not sure if you've seen it, but also the transcode vid.stab now has a one-pass 'deshake' filter. From the web page:

The single pass version has the combined options of the two-pass filters. It produces less good results since it only uses past frames, whereas the two-pass version uses future frames as well.

Only a quick test, and on a wide-angle movie (GoPro) which is difficult to correct anyhow: Indeed at the same settings it is slightly inferior to the two-pass solution, but it does make things a bit easier....
(tested vid.stab 0.93 on transcode 1.1.5)

So Kdenlive ver 0.9 is suposed to come with frei0r video stabilizer. Does anyone know where to find it in the app and how to use it?

Just right click on the clip in the Project tree and it should be down there under Transcode.

And there it is. Stabilize > Videostab (vstab) and Stabilize > Videostab (transcode)

I created a job which then appears as "one pending job" and I can see a little progress bar on the bottom of the clip in the project view. Neat
I wonder what happens once the job finishes.

Well, what would you expect the program to do, if you give a file destination and there is a tag in the checkbox "Add clip to project". ;-)

After stabilization it will appear in the project tree. Great feature.

Yep. The stabilized clip appeared in the project tree. Yay. It is a cool feature.

BTW - what does Shutterangle do?

"what does Shutterangle do?" - Shutterangle is the Angle that Images could be maximum rotated for stabilization.

And yes I often talk to myself !


I like to start that thread again, after half a year of silence. I am an video editor for 20 years now and as I am fed up with windows I changed to Ubuntu 12.04 half a year ago. So far everything is moved to Linux except for video editing, so I gave Kdenlive a try. Playing round with vstab, I do not get any real results. Are there some magic parameters for running it? I did stab with vdub before which gave good results, but I cannot transcode single clips from the project tree to avi format, do I miss something here?


I have written up a bit of doco on this here

That page has some clips showing a comparison between the transcode and vstab methods.

Right now for me the transcode method crashes kdenlive with some file formats. For me it crashes with .mov, works with .dv

What version of kdenlive and melt are you using?

You could add comments to this bug report

I am using for all the latest versions, except for ffmpeg I am not sure.

"all the latest versions" from where ? Because, for example, "the latest version" from Ubuntu software center is not the latest version.

And when you do not "get any real results" do you mean the stabilize is crashing or just that you are not happy with the result?

All latest from sunab ppa. No the clips crash and if not the result has no effect. The software crashes with my system continuesly so I suppose something must be wrong in general, as I cannot image that this software does not work at all.