Stabilizes videos by compensating for camera motion