Zend certified PHP/Magento developer

How to flatten a VR video to display in normal screen?

I am not sure about the terminology here, but I have a VR-video that is intended to be shown using a headset with separate screens for each eye. It is not 3D in the sense that when you turn your head you will see something different, it is just “2,5D” so you get a sense of depth when looking at it. There are two video channels that are more or less identical, they are just recorded with slightly different angle, similar to how human eyes see the world. I hope this makes it clear what type of video I have, otherwise please ask for clarification in a comment (and if there is a special terminology for this type of video, please let me know).

More details: the original video is 4320×2160, basically 2 square channels at 2160 x 2160.

I want to show this video undistorted on a regular screen.

I have read the following questions here on SO:

  1. https://stackoverflow.com/questions/75165610/how-to-reproject-and-join-these-two-clips-with-ffmpeg

  2. https://stackoverflow.com/questions/61348681/flatten-360-fisheye-video

  3. https://stackoverflow.com/questions/62238714/how-to-de-warp-180-degree-or-360-degree-fisheye-video-with-ffmpeg

  4. https://stackoverflow.com/questions/61348681/flatten-360-fisheye-video

  5. https://stackoverflow.com/questions/66960003/unwarping-180-vr-footage-with-ffmpeg-v360-filter

(and problably a few more).

I think I want to extract the two video channels (note that they are in the same video stream, not like in a movie where you can have several separate audio streams for different languages) into separate files and then “undistort” them.

(3) gave me a command to splitting the video into two files:

ffmpeg -i -myclip.mp4 -filter_complex "[0]crop=iw/2:ih:0:0[left];[0]crop=iw/2:ih:ow:0[right]" -map "[left]" -map 0:a /tmp/left.mp4 -map "[right]" -map 0:a /tmp/right.mp4

That seemed to have worked as expected but then I also need to “undistort” the content because it was filmed with some fisheye lens or something like that (straight lines not in the absolute centre of the image are more or less circular).

(5) suggested this command:

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

but that produced an output that was 4320×2160 (obviously only from one channel, since input was just one channel) but just the centre of the original image, I estimate the content to be the 500×250 px (upscaled to 4320×2160, so very blocky) of the midpoint of the original image.

How can I “undistort” this video so it looks good on a 2D-screen while the size is preserved?