Video stabilization in JavaScript