Log in

View Full Version : An advanced stabilisation script


videoFred
19th August 2018, 14:51
Hello everybody,

I have made a stand alone stabilisation script with some additional options like cropping, resizing, fast preview, source info etc....
All parameters can be set with AvsPmod sliders.

After many tests, I found out that the best way to stabilize with Avisynth is by using Msuper().MAnalyse() to create the vectors, followed by MDepan() to create the data file, used by DePanStabilize().

MSuper(), MAnalyse() and MDepan is from the MVTools2 package, DePanStabilize is from Fizicks Depan() package.

I have also found a very important parameter to control the scene change detection: it is the "error" parameter from MDepan().
This is not mentioned in the docs from MVTools.

The script is made to be used with AvsPmod and Avisynth+ and it is for advanced users, you will have to do some effort to get it running. :D

download link:
http://www.super-8.be/avisynth/200_Stab_Package.7z

Feedback is welcome as usual,
Fred.


------------------------------------------------------
Required plugins (this text is also included in the script)
------------------------------------------------------
1) Avisynth+
---------------
Avisynth+ is in full progress and it's getting better and better.
I strongly suggest to always use the newest version avalable.

Groucho's exellent UniversalAvisynthInstaller can be found here:
http://www.iol.ie/~schubert/gas/gas.html

2) Avspmod vs. 2.5.1.0 modified version by vdcrim
-------------------------------------------------
https://forum.doom9.org/showthread.php?p=1801766#post1801766

3) depan.dll vs. 2.13.1.3 or higher modified versions by Printerf
mvtools2.dll vs. 2.7.23.0 or higher
-------------------------------------------------------------
https://github.com/pinterf/mvtools/releases

4)ffms2.dll vs.2.2.21 or higher
------------------------------
https://github.com/FFMS/ffms2/releases

5)histogramRGBparade.avsi
--------------------------------
this is not needed for stabilisation, but it gives you a nice RGB histogram on the preview from the source file.
https://forum.doom9.org/showthread.php?p=1570968#post1570968

johnmeyer
19th August 2018, 18:33
Interesting idea to use the vectors from MVTools2 to power MDepan. I look forward to trying this.

I thought the original Depan settings you used in your original versions of the script worked pretty well, and seldom saw any issues, so I'll be interested to see what sort of improvements I get with this.

videoFred
23rd August 2018, 11:11
Interesting idea to use the vectors from MVTools2 to power MDepan. I look forward to trying this.

It's not my idea, it's from the MVTools2 docs. :o


I thought the original Depan settings you used in your original versions of the script worked pretty well, and seldom saw any issues, so I'll be interested to see what sort of improvements I get with this.

Yes, but some scenes where still very hard to stabilize with the original versions, using DepanEstimate(). This new approach works much better.

A few example clips: (please set Youtube quality to 480p)
https://www.youtube.com/watch?v=e6fGo9-RcZU
https://www.youtube.com/watch?v=QRKDxGhQMak
https://www.youtube.com/watch?v=ncPlcEyi_LU

Fred.

johnmeyer
23rd August 2018, 16:03
Nice looking stabilization!

BTW, one thing I use is "Mirror=15" for Depanstabilize. It does a pretty decent job of filling in the borders so you don't have to zoom in as much to hide the stabilizing black borders. When transferring small-gauge film, every pixel is precious because almost any amount of zooming to cover up the borders is going to make the result look fuzzier.

P.S. Are you able to re-use the MVTools motion vectors from denoising? I would think that it might be possible to denoise and then, since all objects are still in the same location, feed those same exact vectors to Depanstabilize.

videoFred
24th August 2018, 08:52
BTW, one thing I use is "Mirror=15" for Depanstabilize.

Yes, the option "mirror" is available in the script. I use it all the time myself!


P.S. Are you able to re-use the MVTools motion vectors from denoising? I would think that it might be possible to denoise and then, since all objects are still in the same location, feed those same exact vectors to Depanstabilize.

I have tried this in the past, but for some reason it did not work. But it's a good idea and I might have a better look at this later.

Fred.

sys32768
30th January 2019, 19:46
Hi Fred, I tried this but kept getting unknown function "histogramRGBLevels". I finally copied that function from another thread into your script and it worked. Did I overlook something?

Edit: I was also curious of your opinion of me updating your script to include RoboCrop() to remove borders on my 1920x1080 sources. I've determined the left and right borders are consistently 182px on my 16fps regular 8 HD .MOV footage. When I do that, however, I get strange mirroring artifacts; not sure which bothers me more, the mirroring or the moving black borders. ;)

videoFred
31st January 2019, 12:22
Hi Fred, I tried this but kept getting unknown function "histogramRGBLevels".

My mistake... I forgot to add histogramRGB.avsi in the plugins folder. :o
histogramRGB is not needed for stabilizing but it's always nice to check the source.
I have corrected this on the first post.


Edit: I was also curious of your opinion of me updating your script to include RoboCrop() to remove borders on my 1920x1080 sources. I've determined the left and right borders are consistently 182px on my 16fps regular 8 HD .MOV footage. When I do that, however, I get strange mirroring artifacts; not sure which bothers me more, the mirroring or the moving black borders. ;)

You can disable mirroring. And you can limit stabilisation both horizontal and vertical. But if you do not want any borders after stabilizing, you will have to crop them out and then resize to whatever you want as output.

Fred.