Log in

View Full Version : Stabilizing Color Footage


TruthOverFacts
21st March 2025, 19:59
I'm working on some color projects from material transferred from film and need to stabilize the footage. I've only ever used Stab() which I understand can only be applied to black-and-white footage, so I'm looking for the best approach for color material.

Any tips or example scripts would be much appreciated! Thanks

poisondeathray
21st March 2025, 20:42
I've only ever used Stab() which I understand can only be applied to black-and-white footage

Stab is not limited to black and white

johnmeyer
21st March 2025, 21:43
You can look at the long threads about film restoration started by VideoFred. You will find scripts there fore doing all sorts of film restoration, including stabilizing camera shake and gate weave. His scripts use Depan. It's an old technology, but works really well.

I had to adjust this to make it standalone and hopefully I didn't break anything. Here is code to show how it's done:

source=Avisource(film)
stab_reference=source.tweak(cont=0.6).MT_binarize(threshold=80).greyscale().invert()
mdata=DePanEstimate(stab_reference,trust=1.0,dxmax=10,dymax=10)
stab=DePanStabilize(source,data=mdata,cutoff=0.5,dxmax=10,dymax=10,method=1,mirror=15)

TruthOverFacts
22nd March 2025, 15:55
Stab is not limited to black and white

Oh I assumed it couldn't. I saw this on the wiki:

"This filter may not be suitable for color footage; apply with caution."

That scared me away from it.

TruthOverFacts
22nd March 2025, 15:56
You can look at the long threads about film restoration started by VideoFred. You will find scripts there fore doing all sorts of film restoration, including stabilizing camera shake and gate weave. His scripts use Depan. It's an old technology, but works really well.

I had to adjust this to make it standalone and hopefully I didn't break anything. Here is code to show how it's done:

source=Avisource(film)
stab_reference=source.tweak(cont=0.6).MT_binarize(threshold=80).greyscale().invert()
mdata=DePanEstimate(stab_reference,trust=1.0,dxmax=10,dymax=10)
stab=DePanStabilize(source,data=mdata,cutoff=0.5,dxmax=10,dymax=10,method=1,mirror=15)


I'm confused. This script has greyscale in it? I'm working with color.

johnmeyer
22nd March 2025, 16:39
I'm confused. This script has greyscale in it? I'm working with color.It's a mask.

VideoMilk78
23rd March 2025, 00:06
I'm confused. This script has greyscale in it? I'm working with color.

To elaborate on what John said: the grayscale is part a mask used as the Stab Reference, which in turn results in better stabilization