Video Stabilizer
Operator: Abdulla Al Fahad. How tools are built and checked
Handheld shake has two parts that look alike on screen and need opposite treatment: the slow drift of a walking camera, which is part of the shot, and the quick jitter around it, which is not. This page measures how the camera moved between every pair of frames, separates the slow path from the jitter, and moves each frame back by the difference.
Correcting a frame leaves empty borders where the picture has been shifted away, so the whole clip is zoomed by one factor to hide them. A crop limit stops that zoom from growing without bound.
Key features
- Shift, rotation and zoom of the camera measured between frames from about 120 tracked corners
- A strength slider from 0 to 100 that sets how long a stretch of motion counts as intentional
- A crop limit from 3% to 30%, with the corrections reduced rather than the limit exceeded
- A side-by-side preview of the original and the stabilised frame, and an estimate of the shake before and after, in pixels
How the shake is measured, smoothed and hidden
Clips of up to 3 minutes are accepted, because the whole clip is measured before anything is drawn. The result is MP4 or WebM; the size menu keeps the original frame or shrinks the shorter side to 1080, 720 or 480 pixels, and the original sound stays unless you turn it off. A correction can only shift, turn and scale the whole picture: wobble that bends parts of a frame differently, such as the jelly look of a rolling shutter, is not touched.
How it works
The clip plays muted at double speed in a hidden player. Each presented frame, stamped with that frame's own media time, is shrunk to 320 pixels wide and turned to grey, and a worker finds up to about 120 strong corners with the Harris measure, spread over a grid so they do not clump. Browsers without frame callbacks are read with seeks at 20 frames per second instead.
Each corner is followed into the next frame by block matching on a two-level pyramid, refined to a fraction of a pixel. A similarity transform, which is a shift, a rotation and a zoom, is fitted to the tracks with RANSAC, so corners on a person walking through the shot are voted out when the background agrees on one motion, and then refined by least squares on the corners that agree.
The motions are added up into a camera path, and each of its four parts is smoothed with a Gaussian. The correction for a frame is the smoothed path minus the real one. The Gaussian's window is 0.15 seconds at strength 0 and 2.5 seconds at strength 100, and its standard deviation is half of that, so strength 50 smooths over 1.3 seconds.
One zoom, the smallest that keeps every corrected frame covering the output, is applied to the whole clip. If that zoom would be above your limit, the corrections are scaled down together by bisection until it fits, and the page says by how much.
Common use cases
- A 40-second walk-and-talk shot on a phone at 1080p is stabilised at strength 35, so the footstep bounce goes while the deliberate pan toward the door stays.
- A 2-minute concert clip is measured once and rendered twice, at strength 30 and at 70, because each render reuses the measurement.
- A 5-minute clip is over the 3-minute limit and has to be trimmed into two parts first.
How to use this tool
- Drop the video; the original and stabilised previews appear side by side.
- Press Measure the shake and wait for the whole clip to be read.
- Set the strength and the crop limit, read the plan estimate, and render.
- Download the result.
Example
A shaky 960 × 540 clip of a few seconds, strength 50, largest crop allowed 15%
Measure the shake, leave the strength at 50 and the crop limit at 15%The plan estimate under the sliders, roughly
Plan estimate: tracked jitter drops from about 2.7 to about 1.7 pixels per frame, worked out on the 320-pixel-wide copy
The picture is zoomed 15.0%, which is the limit, so the corrections were reduced to 41% of full strength
The estimate comes from the tracked path, not from re-measuring the rendered fileCommon pitfalls
A strong setting treats a deliberate pan as shake. At strength 100 the smoothing window is 2.5 seconds, so the picture lags the pan and the zoom grows to cover the lag.
Plain surfaces give nothing to track. A clip of a blank wall, open sky or snow gives an estimate near zero and little correction, because the corners it needs are not there.
When most of the frame is something moving, such as a bus filling the view, the fitted motion follows the bus rather than the camera.
The zoom is one value for the whole clip, so a single big jolt crops every frame, not just that one.
Rolling-shutter wobble stays. A fast pan on a phone slants vertical lines, and a shift of the whole frame does not undo that.
- Lower the crop limit before you lower the strength when the picture looks too tight: the page then removes the biggest jolts less and keeps the gentle ones fully corrected.
Common errors and how to fix them
- This video is 5:10 long; the limit is 3 minutes because the whole clip is analysed first
- Trim the clip to 3 minutes or less and choose it again.
- Fewer than three frames could be read from this video
- The browser could not step through the file. Convert it to MP4 (H.264) or WebM and try again.
- The browser could not create a drawing surface for the analysis
- Close other tabs that use video or large canvases and reload the page.
Best practices
- Compare the plan estimate at two strengths on the same measurement before rendering, since the measurement is kept and only the smoothing and the zoom are recomputed.
- Render at 720p first for a long clip, to check the crop; the correction is the same at every output size.
What the plan estimate measures
The figure is the root mean square of the frame-to-frame movement of the picture's centre, in pixels, worked out on the 320-pixel-wide analysis copy from the tracked path and the planned correction. The rendered video is not measured again, so treat it as an estimate. It counts only sideways and vertical steps, so a clip whose main shake is rotation will show a smaller drop than it looks. It is a guide for comparing settings on one clip, not a score to compare between clips.
Frequently asked questions
Why can the same clip give a different zoom at a different crop limit?
The zoom is the smallest that hides every border the corrections open up. A lower limit reduces all corrections together until the zoom fits, so the zoom stops at the limit and the estimated drop is smaller.
Does it stabilise vertical phone video in the same way?
Yes. Frames are corrected as a whole in any orientation, and the output keeps the source's shape.