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:

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):

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