With its new app, Hyperlapse, Instagram lets users capture and share moving time-lapse videos. At the base of Hyperlapse is apparently a technique called time-lapse photography, but the guys from Instagram are back with a blog post explaining how Hyperlapse works.
Actually, “hyperlapses are a special kind of time lapse where the camera is also moving,” they reveal. Before Instagram’s app, hyperlapses were a laborious process to capture, but now, thanks to this easy-to-use iOS app, it has become a simplified process with built-in video stabilization.
Here is how it works: The app utilizes a video stabilization algorithm called Cinema that uses the phone’s built-in gyroscope to measure and remove unwanted hand shaking. The orientation is then fed into a video-filtering pipeline, and the IGStabilizationFilter then does its job according to the desired synthetic camera orientation.
To achieve the customizable level that Hyperlapse offers — the app allows users to select the time lapse level after they record a video — the developers behind the app modified the Cinema algorithm to compute orientations only for the frames users keep. For example, a time lapse level of 6x corresponds to picking up every 6th frame of the original video, the result being a six-times-faster video.
Cinema and hyperlapse stabilization are complemented by adaptive zoom, which means the app picks the zoom intelligently based on the amount of shaking in the recorded video.
And that’s it. Here is what happens every time you move the slider in Hyperlapse:
1. We request frames from the decoder at the new playback rate
2. We simultaneously kick off the Cinema stabilizer on a background thread to compute a new optimal zoom and a new set of orientations for the new zoom and time lapse amount.
3. We continue to play the video while we wait for new stabilization data to come in. We use the orientations we computed at the previous time lapse amount along with spherical interpolation to output orientations for the frames we’re going to display.
4. Once the new orientations come in from the stabilizer, we atomically swap them out with the old set of orientations.