How Facebook puts users in the middle of 360-degree videos, without buffering

360-degree and virtual reality videos require a lot more bandwidth than regular videos. Facebook uses a technique called cube-mapping to stream 360-degree videos smoothly on phones, tablets, and computers.

A 360-degree video posted to Facebook simulates speeding through the Star Wars landscape.

Facebook

January 22, 2016

In the early days of the World Wide Web streaming video was essentially impossible – it was simply too much data to send over the pokey phone connections most people used to access the Internet. By the late 1990s, video encoding technologies and connection speeds had improved, allowing people to download or even stream low-quality videos on platforms such as RealPlayer. Today, anyone with a reasonably fast Internet connection can stream videos on sites such as YouTube and Facebook more or less instantly, in full resolution.

But what happens when a video has an extra dimension? 360-degree videos, in which the viewer can look around in all directions while a scene plays, and virtual reality videos, which give a sense of depth, require much more bandwidth to transmit than regular, rectangular clips.

Facebook CEO Mark Zuckerberg shared a video on Thursday explaining how the company makes 360-degree videos play smoothly, no matter what device a user is watching on.

In Kentucky, the oldest Black independent library is still making history

“We don’t want to wait for buffering,” software engineer David Pio explains in the video — so the company developed an encoding method that cuts out redundant visual information and reduces warping when a video plays.

The technique, called cube-mapping, works by translating a 360-degree video into six separate flat videos and stitching them together, as though the viewer were standing inside a cube with each face representing a different part of the field of view: front/back, left/right, and top/bottom. This technique allows Facebook to reduce the size of videos by 25 percent, Mr. Pio says, because the pixels don’t get stretched at the top and bottom of the screen the way they would if a spherical video were simply flattened onto a rectangular frame. (To get an idea of the deformation that would occur, Pio says, think of how Antarctica looks long and skinny on maps even though it’s roughly circular on the globe.) Facebook made the code for performing cube-mapping freely available so users can upload videos in the new format.

Virtual reality videos are even tougher to transmit, since they contain two separate streams of visual information – one for each eye. For these videos, Facebook maps the streams onto a pyramid, showing the base of the pyramid in high resolution. As the user looks around the video with a virtual reality headset, the streams switch so that the one that’s in view at any given moment is in high resolution while the others are lower quality. In other words, Facebook doesn’t bother transmitting high-resolution content that’s out of the user’s field of view – the system waits until the user turns to look behind them before it ups the quality.

Facebook now serves up more than 8 billion video views per day – up from 1 billion a year ago. As the number of videos watched, and the visual quality of those videos, increases, clever techniques such as cube mapping help make sure that everything plays smoothly.