A novel video stabilization algorithm based on preferred feature trajectories is presented. Firstly, Harris feature points are extracted from frames, and foreground feature points are eliminated via K-Means clustering algorithm. Then, the effective feature trajectories are obtained via spatial motion consistency to reduce false matches and temporal motion similarity for long-time tracking. Finally, an objective function is established, which contains both smoothness of feature trajectories and degradation of video qualities to find a set of transformations to smooth out the feature trajectories and obtain stabilized video. As for the blank areas of image warping, optical flow between the defined area of current frame and the reference frame is used as a guide to erode them, mosaicing based on the reference frame is used to get a full-frame video. The simulation experiments show that the blank area of the stabilized video with the proposed method is only about 33% of that with Matsushita method, it is effective to dynamic complex scenes and multiple large moving objects, and can obtain content complete video, the proposed method can not only improve the visual effect of video, but also reduce the motion inpainting.