1. A method, comprising: performing, by one or more computers: factoring two-dimensional (2D) feature trajectories from an input video sequence into a coefficient matrix representing features in the input video sequence and basis vectors representing camera motion over time in the input video sequence; applying an energy minimization technique to the basis vectors to generate smoothed basis vectors, the energy minimization technique is configured to treat the basis vectors as unknowns in an optimization framework and compute a solution for each unknown in the optimization framework that minimizes an energy function; generating smoothed output feature trajectories by combining the smoothed basis vectors with the coefficient matrix; and warping the input video sequence according to the smoothed output feature trajectories to generate a stabilized video sequence.