Convert Dual Fisheye 360 Video to Flat in FFmpeg

This article provides a straightforward guide on how to convert a dual-lens fisheye 360-degree video into a standard, flat (rectilinear) perspective video using FFmpeg's powerful v360 filter. You will learn the exact command syntax, how to configure the input and output parameters, and how to adjust the camera angle and field of view to get the perfect flat frame.

The Basic FFmpeg Command

To convert a dual-lens fisheye video to a standard flat video, use the v360 filter by defining the input format as dfisheye and the output format as flat.

Run the following command in your terminal:

ffmpeg -i input_360.mp4 -vf "v360=input=dfisheye:output=flat:h_fov=100:v_fov=60" output_flat.mp4

Parameter Breakdown

To customize the output to your specific needs, you can adjust the following parameters within the v360 filter:

  • input=dfisheye: Tells FFmpeg that the source video consists of two circular fisheye lenses side-by-side.
  • output=flat: Directs FFmpeg to project the video into a standard, flat (rectilinear) perspective.
  • h_fov (Horizontal Field of View): Sets the horizontal viewing angle of the output video in degrees. A value between 90 and 110 is typical for a natural look. Higher values zoom out, while lower values zoom in.
  • v_fov (Vertical Field of View): Sets the vertical viewing angle of the output video in degrees. This should scale proportionally with your output aspect ratio (e.g., 60 for a 16:9 widescreen layout).

Adjusting the Camera Direction (Panning)

By default, the filter points the camera straight ahead. If the action in your video is happening to the side, above, or below, you can rotate the camera using the yaw, pitch, and roll parameters (values are in degrees):

  • yaw: Pans the camera left or right (range: -180 to 180).
  • pitch: Tilts the camera up or down (range: -90 to 90).
  • roll: Rotates the camera clockwise or counter-clockwise (range: -180 to 180).

Example with rotation:

To pan the camera 45 degrees to the right and tilt it 10 degrees up, use:

ffmpeg -i input_360.mp4 -vf "v360=input=dfisheye:output=flat:h_fov=100:v_fov=60:yaw=45:pitch=10" output_flat.mp4

Fine-Tuning the Dual-Fisheye Input

If your dual-fisheye video does not cover a full 180 degrees per lens, or if there is overlap/black borders, you can explicitly define the input field of view using ih_fov and iv_fov (usually 180 for standard 360 dual-lens cameras):

ffmpeg -i input_360.mp4 -vf "v360=input=dfisheye:ih_fov=180:iv_fov=180:output=flat:h_fov=100:v_fov=60" output_flat.mp4