Description: In this paper we present a scheme for integrating a digital stabilizer with video codec of a digital video camera. This integration achieves computational efficiency without affecting the performance of video coding and digital stabilization. The proposed scheme achieves this by confining the global motion estimation to within a small background region determined by clustering the motion vectors generated by the video encoder.