Quantcast Stabilization Tools Pack v1.7 for Avisynth [DOWNLOAD] - digitalFAQ Forum
Go Back    Forum > Digital Video > Video Project Help > Restore, Filter, Improve Quality

Reply
 
LinkBack Thread Tools
  #1  
04-26-2015, 01:25 PM
Dogway Dogway is offline
Free Member
 
Join Date: Apr 2015
Posts: 4
Thanked 0 Times in 0 Posts
Stabilization Tools Pack v1.7

I developed a set of tools to work with common stabilization issues, mainly from telecine process.
For aggressive handheld camera shaking I still recommend vdub's Deshaker.


FilmGateFix()

First there is FilmGateFix() which is very straight forward although the least out-of-the-box experience from the pack.
I set defaults to my needs and although very conservative worked quite well. It's still open to suggestions and somewhat experimental. This function does 2 assumptions. That after a scene change the worst film gate frame is the second, and the third frame is stable. And two, that the source is cel animation based since simple freezeframe() filters are being used.
The function can be expanded in the future with frame interpolation for live footage, and refactored settings for better results. Test and share your experience, don't forget to upload a chunk of the source so I can check.


FillBorders()

The other two tools are related mainly to stab(). This is my main stabilization filter because it's very production friendly; works fine in one pass without too much parameter tweaking.
As all deshakers go there is one main problem, mismatches. This generally creates black borders around the source frames to compensate for the stabilization, for that in stab() you can use the "mirror" parameter, something like mirror=15 will do the job, this can be called the "patchy" method. It won't fix the huge (over 5px) stabilization mismatches specially problematic in tilts and pans. This method requires you to go through the whole source and check carefully where stab() failed, sometimes not as evident as we used the mirror edge filling feature.

A nicer more passive method was in need so I made the next two functions. After Stab() without the use of the mirror option I recommend to crop by at least 2 pixels on all sides, then we apply a pass of the new filter FillBorders(). This will fill dark borders with adjacent content, it uses AVSInpaint plugin hence results are much nicer than simple mirror filling. This filter will also work with retail sources that present random black borders, by using the "thr" setting you can tell how dark it must be to be validated as a border. Do tweaks while in debug mode.

RAW........................................ ... FillBlackLines().............................. FillBorders()
......................


FindBlackBorders()

The previous FillBorders() will work with black borders up to 3px, let's call this false positives because they are inherent stabilization borders we decided to fill rather than crop. After that threshold of 3px (plus 2px previously cropped) we are still left with some thick borders result of serious stab() mismatches, the better approach here is to trim out the whole scene. To avoid the tedious process of carefully rewatching the film/episode from start to finish, I created a second function, FindBlackBorders(). This will detect if any of the borders present a black or "thr" defined border and report to a statistics file. Meanwhile it will output the input clip untouched so you can do two things at the same time, render a preview clip to check stab() mismatches, and WriteFile border statistics to a file. This comes handy with very heavy filters or long episodic series.


Examples:

So far our script looks like this:

First/Debug Pass
Code:
# stabilization pass
stab(ts=7,range=5,dxmax=15,dymax=15)

# Crop some border garbage
Crop(2, 2, -2, -2)

# Clean stab() garbage a bit further (up to 3px)
FillBorders(debug=false)

# Now we have a clean slate to detect big stab() mismatches
FindBlackBorders(path="C:\") # output statistics for ClipClop

# For debug purposes you can test results of FilmGateFix() if you want
FilmGateFix(debug=false)

# Output to half the size for debugging doing trims with ClipClop
RatioResize(0.5,"%")

# Encode with x264 fast presets
With the rendered output clip (now with most borders already cleaned) we load it in avspmod and load as well the statistics file using the Macro "Import Bookmarks from File".
Now all we need to do is use F3 to jump through all bookmarks and manually trim out problematic scenes, hopefully saving us a few precious hours and eye health issues.

For the trims I like using ClipClop() by StainlessS. After we finished, we replace our FindBlackBorders() line with the new ClipClop() one and render our main script.

Second/Final Pass
Code:
unstab=Crop(2, 2, -2, -2)
stab(ts=7,range=5,dxmax=15,dymax=15)
Crop(2, 2, -2, -2)

FillBorders(debug=false)
FilmGateFix(debug=false)

# recover problematic scenes from the unstab variable
# also those from FilmGateFix(), although by default it's very conservative
ClipClop(unstab,SCmd="1(20000,30000);1(80000,100000)")

Changelog:
Code:
v1.7 - Refactored FindBlackBorders() again for TRUE border detection
v1.6 - Refactored FindBlackBorders() a bit and fixed some bugs along
     - Small ternary change in FillBorders()
v1.5 - Documentation fix (InpaintLogo is spatial, Average.dll thread link)
     - Overall script cleaning and reformat
     - Fixed a mod crop issue in FilmGateFix()
     - In FilmGateFix() swapped mt_lutspa() with PadInwards() (custom helper function)
     - Huge overhaul and optimization of FillBorders()
v1.0 - Initial release

How / Where to Download the Files?
You'll find the attached file downloads at the bottom of this top post. Files are provided for the convenience of our members. To get download access, simply join the forum as either a Free Member or Premium Member. We don't send spam or sell your email addresses. If you're not sure what to do with .zip or .rar files, see this help post.


Attached Files
File Type: zip Stabilization Tools Pack v1.7.zip (4.0 KB, 27 downloads)
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
04-26-2015, 10:59 PM
lordsmurf's Avatar
lordsmurf lordsmurf is online now
Site Staff | Video
 
Join Date: Dec 2002
Posts: 8,797
Thanked 1,466 Times in 1,283 Posts
Remember to attach files to the forum. External links too often disappear, are subjected to malware, etc.
And anytime you have updates or new versions, just attach those in a reply, and we'll get it sorted for you (added to original post, etc).

- Did my advice help you? Then become a Premium Member and support this site.
- Find television shows, cartoons, DVDs and Blu-ray releases at the TVPast forums.
Reply With Quote
  #3  
04-27-2015, 08:17 AM
Dogway Dogway is offline
Free Member
 
Join Date: Apr 2015
Posts: 4
Thanked 0 Times in 0 Posts
If I attach the file outsiders can't download the script. I want everyone to use my tools without constraints, is it possible to add both options?
Reply With Quote
  #4  
04-27-2015, 09:29 AM
lordsmurf's Avatar
lordsmurf lordsmurf is online now
Site Staff | Video
 
Join Date: Dec 2002
Posts: 8,797
Thanked 1,466 Times in 1,283 Posts
All anybody has to do is register for the forum.
But sure, you can do both. At minimum, however, it needs to be attached for longevity.

- Did my advice help you? Then become a Premium Member and support this site.
- Find television shows, cartoons, DVDs and Blu-ray releases at the TVPast forums.
Reply With Quote
  #5  
04-27-2015, 07:02 PM
Dogway Dogway is offline
Free Member
 
Join Date: Apr 2015
Posts: 4
Thanked 0 Times in 0 Posts
Can I edit posts? I can't find how.
Reply With Quote
  #6  
04-27-2015, 07:15 PM
lordsmurf's Avatar
lordsmurf lordsmurf is online now
Site Staff | Video
 
Join Date: Dec 2002
Posts: 8,797
Thanked 1,466 Times in 1,283 Posts
You can edit posts for 60 minutes. See also: Forum Policies and Membership Agreement
After an hour, just post a reply.
Site Staff will help maintain posts like this, by merging or editing to keep it updated.

- Did my advice help you? Then become a Premium Member and support this site.
- Find television shows, cartoons, DVDs and Blu-ray releases at the TVPast forums.
Reply With Quote
The following users thank lordsmurf for this useful post: Dogway (04-27-2015)
Reply




Tags
deshaker, dogway, jitter, stab, stabilization

Similar Threads
Thread Thread Starter Forum Replies Last Post
Advice on VHS capturing tools? Simon76 Capture, Record, Transfer 1 02-12-2018 05:47 AM
Help converting VHS to DVD with the best tools! Espanol Project Planning, Workflows 9 08-25-2013 11:29 PM
SoundForge Audio Filter Presets Pack [DOWNLOAD] admin Restore, Filter, Improve Quality 22 02-24-2013 07:07 PM
Can't access Sound Forge plug-in pack download page kctexan General Discussion 3 03-10-2011 12:18 AM
AVISynthesizer: Build complete Avisynth scripts using pre-made templates [DOWNLOAD] lordsmurf Encode, Convert for discs 0 11-09-2010 01:13 AM

Thread Tools



 
All times are GMT -5. The time now is 02:51 PM