Minimum Latency Deep Online Video Stabilization

Zhuofan Zhang, Zhen Liu, Ping Tan, Bing Zeng, Shuaicheng Liu · DOI

Introduction

Video stabilization is a critical post-processing step for removing unwanted camera shake while preserving intentional movement. While offline methods can achieve high-quality results by analyzing entire video sequences, they are unsuitable for real-time applications like live streaming. This paper introduces a deep learning framework for online video stabilization that achieves state-of-the-art results with minimum latency by decoupling motion estimation from path smoothing.

The Challenge of Online Stabilization

Traditional stabilization involves three steps: motion estimation, path smoothing, and frame warping. Online methods must stabilize frames as they arrive, which makes it difficult to distinguish between "low-frequency" shake (slow drifts) and intentional panning without access to future frames. Previous deep learning attempts often used "black box" networks that handled all three steps simultaneously, frequently resulting in visual artifacts like "jello" effects and poor generalization across different scenes.

System Architecture

The proposed pipeline separates the geometric problem of motion estimation from the logic of path smoothing.

1. Motion Estimation

Instead of training a network to learn geometry from scratch, the system uses an off-the-shelf deep meshflow model. This represents motion as a flexible grid (mesh), which is more expressive than global transformations but more efficient than pixel-level optical flow.

2. Camera Path Smooth Network

The core of the system is a 4-stage UNet architecture with Channel Attention (CA). It processes a sliding window of the previous 15 frames of motion data to predict a stabilizing warp field for the current frame. By processing motion vectors rather than raw RGB pixels, the model remains lightweight and invariant to scene textures or lighting.

3. Hybrid Loss Function

To ensure natural-looking output, the authors employ three specific losses:

  • Motion-consistency (MC): Ensures smooth transitions between stabilized frames.
  • Shape-consistency (SC): Prevents mesh distortion to avoid shearing artifacts.
  • Scale-preserving (SP): Maintains consistent frame scaling.
Diagram of frame relationships and consistency mapping used in the stabilization logic.

Dataset Synthesis via Motion Transfer

Training effective stabilization models requires pairs of shaky and stable videos. To avoid the "parallax problem" (where shaky and stable cameras are physically separated), the authors developed a novel Motion Transfer technique.

They filmed 110 stable videos using a gimbal and collected 150 shaky videos from the web. By transferring the motion profiles from the shaky footage onto the stable videos, they created a "MotionStab" dataset. This synthesized footage contains realistic camera shake while perfectly matching the content of the stable ground truth.

Illustration of the dataset synthesis process and a comparison of stable, unstable, and synthesized motion paths.

Key Results and Performance

The proposed method was evaluated on the standard NUS dataset, outperforming existing online methods like Meshflow and StabNet in both cropping ratio and distortion values.

  • Real-Time Speed: The entire pipeline processes a frame in approximately 26ms (12ms for motion estimation, 10ms for smoothing, and 4ms for rendering). This comfortably fits within the 33ms window required for 30fps real-time video.
  • Visual Quality: Qualitatively, the method avoids the shearing and wobbling common in other deep learning approaches. In user studies, participants preferred this online method over the state-of-the-art offline method (PWStableNet) nearly 60% of the time.

Conclusion and Future Work

By decoupling motion estimation from smoothing and utilizing a motion-transfer synthesis strategy, this framework provides a robust solution for real-time stabilization. While it excels at handling typical camera shake, future work may involve integrating more sophisticated attention mechanisms to better suppress aggressive low-frequency drifts that currently favor offline global path optimization.

Summary updated

BibTeX
@misc{zhang2022minimum,
  author = {Zhuofan Zhang and Zhen Liu and Ping Tan and Bing Zeng and Shuaicheng Liu},
  title = {{Minimum Latency Deep Online Video Stabilization}},
  year = {2022},
  eprint = {2212.02073},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2212.02073},
}
Figure