1. A method for editing an input video to produce an output video, comprising a processor for performing steps of the method, comprising the steps: partitioning pixels of the input video into sets of pixels, wherein the pixels in each set are adjacent, and for each set of pixels, further comprising the steps of: defining a trellis having nodes connected by directed links, wherein each node corresponds to one of the pixels in the set of pixels, and each node is associated with an action and location of the pixel in the output video; assigning costs to the nodes and the links, wherein the costs are on apparent motion in the input video; determining a path through the trellis, wherein the path has a least cost; and applying, for each node on the path, the action associated the node to the corresponding pixel in the input video to edit the corresponding pixel at the location in the output video associated with the node.