Imported from https://github.com/MeiguangJin/slow-motion