Convert Equirectangular to Stereographic in FFmpeg
This article provides a straightforward guide on how to use the
FFmpeg v360 filter to convert 360-degree equirectangular
video into a stereographic projection, commonly known as the “little
planet” or “tiny planet” effect. You will learn the exact command-line
syntax, the key parameters of the v360 filter, and how to
customize the camera angle and field of view to achieve the perfect
visual result.
The Basic Command
To project an equirectangular video to a stereographic projection,
use the v360 video filter. Below is the standard FFmpeg
command to perform this conversion:
ffmpeg -i input.mp4 -vf "v360=input=equirectangular:output=stereographic:yaw=0:pitch=-90:roll=0:fov=180:w=1080:h=1080" output.mp4Parameter Breakdown
The v360 filter relies on specific parameters to define
the input, output, camera orientation, and dimensions:
input=equirectangular(ore): Specifies that the source video is in the standard 360-degree equirectangular format.output=stereographic(orsg): Specifies the target projection format.yaw,pitch, androll: These control the rotation of the camera in degrees.- Setting
pitch=-90points the camera straight down, which wraps the ground into a sphere to create the classic “little planet” effect. - Setting
pitch=90points the camera straight up, creating an inverted “sky tunnel” or “inverted planet” effect.
- Setting
fov: Controls the Field of View in degrees. For a stereographic projection, a value between180and220is recommended to capture enough of the surrounding environment to form the “planet” shape.wandh: Sets the width and height of the output video. Because stereographic projections are circular, a 1:1 square aspect ratio (like1080x1080or2160x2160) is ideal.
Customizing the Projection
You can adjust the parameters to change the appearance of your output video:
Changing the Planet Center
If you want to spin the “planet” horizontally to center a specific
subject, adjust the yaw parameter:
ffmpeg -i input.mp4 -vf "v360=e:sg:yaw=120:pitch=-90:roll=0:fov=190:w=1080:h=1080" output.mp4Adjusting the Planet Size
To make the central planet smaller and show more of the horizon,
increase the fov value. To zoom in closer to the center,
decrease the fov value: * Zoom Out (Smaller
Planet): fov=220 * Zoom In (Larger
Planet): fov=150