Unwarping 180 VR Footage with FFmpeg v360 Filter

6.2k Views Asked by At

I am struggling at present. I have searched high and low for days and can't find a command that achieves what we want to do.

We have stereoscopic 180 degrees VR footage in a side-by-side equirectangular format that we want to convert to flat so we can process using further AI software.

We have already split the file in half across the width using FFmpeg so we have a "right" eye and a "left" eye video file.

For each video file, we need to convert the 180-degree equirectangular footage to a flat, unwarped video file using FFmpeg (and the v360 filter).

We've tried the following for example:

ffmpeg -i 2LEFT.mp4 -vf "v360=input=equirect:ih_fov=180:iv_fov=180:output=flat" 2LEFTTEST.mp4

However, this results in a very warped/misaligned video.

Some command examples, tips, suggestions as to convert the now monoscopic 180-degree equirectangular footage to a flat video file will be greatly appreciated.

Thank you for your help in advance.

1

There are 1 best solutions below

3
Egor On

I recently ran into a similar problem. Here is the solution: If your video is already split into left and right views just use:

ffmpeg -i 2LEFT.mp4 -vf "v360=input=hequirect:output=flat" 2LEFTTEST.mp4

That differs from command you tried to use in a type of projection. Usually VR180 utilizes half-equirect projection for each eye.

Personally, I recommend for YouTube videos setting the output field of view and resolution:

ffmpeg -i 2LEFT.mp4 -vf "v360=input=hequirect:output=flat:h_fov=100:v_fov=67.5:w=1280:h=720" 2LEFTTEST.mp4

Finally, using filter_complex, you can immediately cut the video into left and right views in one command if you want to:

ffmpeg -i 2.mp4 -filter_complex "[0:v]v360=input=hequirect:output=flat:h_fov=100:v_fov=67.5:in_stereo=sbs:out_stereo=sbs:w=1280:h=720[flat];[flat]split[left][right];[left]stereo3d=sbsl:ml[left_mono];[right]stereo3d=sbsl:mr[right_mono]" -map [left_mono] 2LEFTTEST.mp4 -map [right_mono] 2RIGHTTEST.mp4