Convert Cubemap 360 Video to Equirectangular in FFmpeg
Converting a 360-degree video from cubemap format to standard
equirectangular projection is a straightforward process using FFmpeg’s
built-in v360 filter. This guide provides the exact
command-line syntax required to perform this conversion, explains how to
match your source cubemap layout, and details how to set the correct
output resolution and encoding parameters for optimal video quality.
Basic Conversion Command
The fundamental syntax to convert a 3x2 cubemap into an equirectangular video is:
ffmpeg -i input_cubemap.mp4 -vf "v360=c3x2:equirect" -c:v libx264 -crf 18 -c:a copy output_equirectangular.mp4Specifying the Correct Input Layout
Cubemaps come in various geometric layouts. You must specify the
exact layout of your input file using the input projection parameter in
the v360 filter:
- 3x2 Cubemap Grid (
c3x2): Commonly used by default where 6 faces are arranged in a 3-column, 2-row grid. - 6x1 Horizontal Strip (
c6x1): All 6 cube faces aligned in a single horizontal row. - 1x6 Vertical Strip (
c1x6): All 6 cube faces stacked in a single vertical column. - Equi-Angular Cubemap (
eac): A modified cubemap layout often used by YouTube (typically in a 3x2 arrangement).
Example for converting an Equi-Angular Cubemap (EAC):
ffmpeg -i input_eac.mp4 -vf "v360=eac:equirect" -c:v libx264 -crf 18 -c:a copy output_equirectangular.mp4Setting Output Resolution
Equirectangular videos require a 2:1 aspect ratio (width is twice the
height). By default, v360 calculates the output size
automatically, but you can explicitly specify the dimensions using
out_w and out_h:
ffmpeg -i input_cubemap.mp4 -vf "v360=c3x2:equirect:out_w=3840:out_h=1920" -c:v libx264 -crf 18 -c:a copy output_equirectangular.mp4Common standard 2:1 resolutions include:
- 4K:
out_w=3840:out_h=1920orout_w=4096:out_h=2048 - 8K:
out_w=7680:out_h=3840
Improving Visual Quality with Interpolation
Pixel resampling during reprojection can introduce softness or
artifacts. Use the interp parameter to select a
higher-quality interpolation algorithm:
linear(Bilinear - fast, default)cubic(Bicubic - balanced sharpness)lanczos(Lanczos - highest sharpness)
Example using Lanczos interpolation:
ffmpeg -i input_cubemap.mp4 -vf "v360=c3x2:equirect:interp=lanczos:out_w=3840:out_h=1920" -c:v libx264 -preset slow -crf 17 -c:a copy output_equirectangular.mp4Adjusting Initial Camera Orientation (Yaw, Pitch, Roll)
If your output video needs rotation to correct the default forward-facing view, append rotation parameters directly to the filter:
yaw: Rotates horizontally (-180 to 180)pitch: Rotates vertically (-90 to 90)roll: Tilts side-to-side (-180 to 180)
Example rotating the forward view 90 degrees horizontally:
ffmpeg -i input_cubemap.mp4 -vf "v360=c3x2:equirect:yaw=90" -c:v libx264 -crf 18 -c:a copy output_equirectangular.mp4