Sorry guys, I was partly wrong in the above script.
Recently I was editing a full clip from old GoPro videos and I realize a fatal error:
While the above ffmpeg script works for single eye picture/video, it doesn't work well with stereo ones. The center part is OK, but the left/right edges are difficult to look.
At first I thought it was due to the "iv_fov=108" parameter causing a vertical mis-alignment, then after measuring output files, there was no mis-alignment. The objects near edges were exact where they were supposed to be.
Now I think it's due to our own eyes and the way VR player handle objects near left/right edges. Simply put, when converting GoPro videos to VR180, we just cannot make them too close to the left/right edges. It will make your eyes difficult to handle.
So the solution is changing to "iv_fov=100" and "ih_fov=113", basically shrink down the video, make it further away from the edges. You will get smaller images, but in exchange you will get much more comfortable 3D videos to watch.
I saw some videos from DeoVR having the same kind of problem, and they were also GoPro clips originally. I guess they probably using the same technique here to convert the video to 3D VR180. For the horrible problem that my script had caused. I have to apologize to you!
The number iv_fov=100 and ih_fov=113 are just my best result so far. There might be better numbers around that will yield better result. It's up to you to experiment.
If you find better numbers, please post here and let me know. Thank you!
PS1:
this method also applies to single GoPro photos. If you have those 8:7, 5568x4872 photos, you can convert them to VR180 format with this command:
ffmpeg -i %1 -filter_complex "v360=input=sg:ih_fov=113:iv_fov=100:output=e:h_fov=180:v_fov=180:w=11520:h=11520:alpha_mask=1[out];color=c=black:s=11520x11520[bg];[bg][out]overlay" -f image2 -frames:v 1 -qmin 1 -q:v 1 -pix_fmt yuvj422p "%~dpn1-out.jpg"
Here it will convert a 5568x4872 GoPro photo to 11520x11520 VR photo. The VR player can handle this kind of extra large photos, but when you combine 2 together to form a 3D photo, It's better to shrink them down to 5760x5760 then combine them into a 11520x5760 photo so the VR players can handle it.
PS2:
If you need to use your favorite video editor to edit the video, HEVC/x265 is a terrible choice. So it will be much better to convert your clips to the lightest Apple ProRes and increase the output size to 7860x7860 in one process:
ffmpeg -i input.mp4 -r 59.94 -filter_complex "v360=input=sg:ih_fov=113:iv_fov=100:output=e:h_fov=180:v_fov=180:w=7860:h=7860:alpha_mask=1[out];color=c=black:s=7860x7860[bg];[bg][out]overlay=repeatlast=0:shortest=1" -c:v prores -profile:v 0 -pix_fmt yuv422p10le output.mov
( I know it's not recommended to use "-profile:v 0", but it will only increase the size 8x, profile 1 will increase the size to 16x, and I honestly don't see the difference. Of course you can specify the profile you want, the best one is 3. )
With ProRes files it will be much easier and faster to edit.