SphericalMapping

data class SphericalMapping(val projection: SphericalProjection, val yaw: Double, val pitch: Double, val roll: Double)

How a stream's pictures map onto a sphere around the viewer, as its container states it: in MP4 or MOV through Google's spherical video boxes or Apple's video extension box, in Matroska through the track's Projection element. FFmpeg reads it into the stream's AVSphericalMapping and applies none of it, so a renderer that draws the picture flat shows a 360 degree video as a stretched panorama.

The picture is mapped onto the sphere by projection, and the sphere is then turned around the viewer, who stays at its centre: by yaw, then pitch, then roll. The axes are OpenGL's, x to the viewer's right, y up and z out of the screen toward the viewer, so the turn is the rotation Ry(yaw) * Rx(pitch) * Rz(roll). Each angle is in degrees and is exactly the number FFmpeg holds, which is 16.16 fixed point and fits a Double without rounding. FFmpeg documents yaw and roll from -180 to 180 and pitch from -90 to 90, and passes on what the container says.

Constructors

Link copied to clipboard
constructor(projection: SphericalProjection, yaw: Double, pitch: Double, roll: Double)

Properties

Link copied to clipboard

Degrees about the right axis. A positive pitch moves what is in front of the viewer up.

Link copied to clipboard

How the picture covers the sphere, with what that projection alone carries.

Link copied to clipboard

Degrees about the forward axis. A positive roll tilts what is in front of the viewer to their right.

Link copied to clipboard
val yaw: Double

Degrees about the up axis. A positive yaw moves what is in front of the viewer to their right.