FFmpeg 7.1
Since* 4.3
#

Convert 360 videos between various formats.

The filter accepts the following options:

input, output

Set format of the input/output video.

Available formats:

e, equirect

Equirectangular projection.

c3x2, c6x1, c1x6

Cubemap with 3x2/6x1/1x6 layout.

Format specific options:

in_pad, out_pad

Set padding proportion for the input/output cubemap. Values in decimals.

Example values:

0

No padding.

0.01

1% of face is padding. For example, with 1920x1280 resolution face size would be 640x640 and padding would be 3 pixels from each side. (640 * 0.01 = 6 pixels)

Default value is 0. Maximum value is 0.1.

fin_pad, fout_pad

Set fixed padding for the input/output cubemap. Values in pixels.

Default value is 0. If greater than zero it overrides other padding options.

in_forder, out_forder

Set order of faces for the input/output cubemap. Choose one direction for each position.

Designation of directions:

r

right

l

left

u

up

d

down

f

forward

b

back

Default value is rludfb.

in_frot, out_frot

Set rotation of faces for the input/output cubemap. Choose one angle for each position.

Designation of angles:

0

0 degrees clockwise

1

90 degrees clockwise

2

180 degrees clockwise

3

270 degrees clockwise

Default value is 000000.

eac

Equi-Angular Cubemap.

flat, gnomonic, rectilinear

Regular video.

Format specific options:

h_fov, v_fov, d_fov

Set output horizontal/vertical/diagonal field of view. Values in degrees.

If diagonal field of view is set it overrides horizontal and vertical field of view.

ih_fov, iv_fov, id_fov

Set input horizontal/vertical/diagonal field of view. Values in degrees.

If diagonal field of view is set it overrides horizontal and vertical field of view.

dfisheye

Dual fisheye.

Format specific options:

h_fov, v_fov, d_fov

Set output horizontal/vertical/diagonal field of view. Values in degrees.

If diagonal field of view is set it overrides horizontal and vertical field of view.

ih_fov, iv_fov, id_fov

Set input horizontal/vertical/diagonal field of view. Values in degrees.

If diagonal field of view is set it overrides horizontal and vertical field of view.

barrel, fb, barrelsplit

Facebook’s 360 formats.

sg

Stereographic format.

Format specific options:

h_fov, v_fov, d_fov

Set output horizontal/vertical/diagonal field of view. Values in degrees.

If diagonal field of view is set it overrides horizontal and vertical field of view.

ih_fov, iv_fov, id_fov

Set input horizontal/vertical/diagonal field of view. Values in degrees.

If diagonal field of view is set it overrides horizontal and vertical field of view.

mercator

Mercator format.

ball

Ball format, gives significant distortion toward the back.

hammer

Hammer-Aitoff map projection format.

sinusoidal

Sinusoidal map projection format.

fisheye

Fisheye projection.

Format specific options:

h_fov, v_fov, d_fov

Set output horizontal/vertical/diagonal field of view. Values in degrees.

If diagonal field of view is set it overrides horizontal and vertical field of view.

ih_fov, iv_fov, id_fov

Set input horizontal/vertical/diagonal field of view. Values in degrees.

If diagonal field of view is set it overrides horizontal and vertical field of view.

pannini

Pannini projection.

Format specific options:

h_fov

Set output pannini parameter.

ih_fov

Set input pannini parameter.

cylindrical

Cylindrical projection.

Format specific options:

h_fov, v_fov, d_fov

Set output horizontal/vertical/diagonal field of view. Values in degrees.

If diagonal field of view is set it overrides horizontal and vertical field of view.

ih_fov, iv_fov, id_fov

Set input horizontal/vertical/diagonal field of view. Values in degrees.

If diagonal field of view is set it overrides horizontal and vertical field of view.

perspective

Perspective projection. (output only)

Format specific options:

v_fov

Set perspective parameter.

tetrahedron

Tetrahedron projection.

tsp

Truncated square pyramid projection.

he, hequirect

Half equirectangular projection.

equisolid

Equisolid format.

Format specific options:

h_fov, v_fov, d_fov

Set output horizontal/vertical/diagonal field of view. Values in degrees.

If diagonal field of view is set it overrides horizontal and vertical field of view.

ih_fov, iv_fov, id_fov

Set input horizontal/vertical/diagonal field of view. Values in degrees.

If diagonal field of view is set it overrides horizontal and vertical field of view.

og

Orthographic format.

Format specific options:

h_fov, v_fov, d_fov

Set output horizontal/vertical/diagonal field of view. Values in degrees.

If diagonal field of view is set it overrides horizontal and vertical field of view.

ih_fov, iv_fov, id_fov

Set input horizontal/vertical/diagonal field of view. Values in degrees.

If diagonal field of view is set it overrides horizontal and vertical field of view.

octahedron

Octahedron projection.

cylindricalea

Cylindrical Equal Area projection.

interp

Set interpolation method.Note: more complex interpolation methods require much more memory to run.

Available methods:

near, nearest

Nearest neighbour.

line, linear

Bilinear interpolation.

lagrange9

Lagrange9 interpolation.

cube, cubic

Bicubic interpolation.

lanc, lanczos

Lanczos interpolation.

sp16, spline16

Spline16 interpolation.

gauss, gaussian

Gaussian interpolation.

mitchell

Mitchell interpolation.

Default value is line.

w, h

Set the output video resolution.

Default resolution depends on formats.

in_stereo, out_stereo

Set the input/output stereo format.

2d

2D mono

sbs

Side by side

tb

Top bottom

Default value is 2d for input and output format.

yaw, pitch, roll

Set rotation for the output video. Values in degrees.

rorder

Set rotation order for the output video. Choose one item for each position.

y, Y

yaw

p, P

pitch

r, R

roll

Default value is ypr.

h_flip, v_flip, d_flip

Flip the output video horizontally(swaps left-right)/vertically(swaps up-down)/in-depth(swaps back-forward). Boolean values.

ih_flip, iv_flip

Set if input video is flipped horizontally/vertically. Boolean values.

in_trans

Set if input video is transposed. Boolean value, by default disabled.

out_trans

Set if output video needs to be transposed. Boolean value, by default disabled.

h_offset, v_offset

Set output horizontal/vertical off-axis offset. Default is set to 0. Allowed range is from -1 to 1.

alpha_mask

Build mask in alpha plane for all unmapped pixels by marking them fully transparent. Boolean value, by default disabled.

reset_rot

Reset rotation of output video. Boolean value, by default disabled.

#

Examples

  • Convert equirectangular video to cubemap with 3x2 layout and 1% padding using bicubic interpolation:

    ffmpeg -i input.mkv -vf v360=e:c3x2:cubic:out_pad=0.01 output.mkv
  • Extract back view of Equi-Angular Cubemap:

    ffmpeg -i input.mkv -vf v360=eac:flat:yaw=180 output.mkv
  • Convert transposed and horizontally flipped Equi-Angular Cubemap in side-by-side stereo format to equirectangular top-bottom stereo format:

    v360=eac:equirect:in_stereo=sbs:in_trans=1:ih_flip=1:out_stereo=tb
#

Commands

This filter supports subset of above options as commands.