<p>Rectifying single photo:</p>
<pre><code>ffmpeg -i input.jpg -vf v360=fisheye:e:ih_fov=200:iv_fov=200 -y output.jpg
</code></pre>
<p>Rectifying horizontal double fisheye:</p>
<pre><code>ffmpeg -i input.jpg -i dftest.gif -filter_complex &quot;[1:v]v360=input=dfisheye:output=equirect:ih_fov=200:iv_fov=200[out_v]&quot; -map &quot;[out_v]&quot;  output.jpg
</code></pre>
<p>You have a vertically stacked double fisheye, so you have to convert it in advance:</p>
<ul>
<li>crop the 2 parts (540x540, one at 0,0, the other at 0,540):
<ul>
<li><strong>crop=out_w=540:out_h=540:x=0:y=540</strong></li>
<li><strong>crop=out_w=540:out_h=540:x=0:y=0</strong></li>
</ul>
</li>
<li>stack them horizontally: <strong>hstack</strong></li>
<li>send to v360 filter as above; <strong>v360=input=dfisheye:output=equirect:ih_fov=200:iv_fov=200</strong></li>
</ul>
<p>Final result:</p>
<pre><code>ffmpeg -y -i input.jpg -filter_complex &quot;[0:v]crop=out_w=540:out_h=540:x=0:y=540[3];[0:v]crop=out_w=540:out_h=540:x=0:y=0[1];[1][3]hstack,v360=input=dfisheye:output=equirect:ih_fov=200:iv_fov=200[out_v]&quot; -map &quot;[out_v]&quot; output.jpg
</code></pre>
<p><a href="https://i.sstatic.net/SUvQC.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/SUvQC.png" alt="enter image description here" /></a></p>
<p>I used FOV=200 rather than FOV to remove overlapping.</p>
<p>You can add parameter <strong>yaw</strong> to turn camera around:</p>
<pre><code>ffmpeg -y -i input.jpg -filter_complex &quot;[0:v]crop=out_w=540:out_h=540:x=0:y=540[3];[0:v]crop=out_w=540:out_h=540:x=0:y=0[1];[1][3]hstack,v360=input=dfisheye:output=equirect:ih_fov=200:iv_fov=200:yaw=45[out_v]&quot; -map &quot;[out_v]&quot; output.jpg
</code></pre>
<p>yaw=0:</p>
<p><a href="https://i.sstatic.net/gjqa6.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/gjqa6.png" alt="yaw 0" /></a></p>
<p>yaw=45:</p>
<p><a href="https://i.sstatic.net/GhvgT.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/GhvgT.png" alt="yaw 45" /></a></p>
<p>Test result here: <a href="https://renderstuff.com/tools/360-panorama-web-viewer/" rel="nofollow noreferrer">https://renderstuff.com/tools/360-panorama-web-viewer/</a></p>
<p>Used this amazing tool to experiment: <a href="https://ffmpeg.lav.io/" rel="nofollow noreferrer">https://ffmpeg.lav.io/</a></p>
<p>You can also experiment with windows software I wrote to replace XDV360 software which came with my panocam with single 220° fisheye lens:</p>
<p><a href="https://github.com/jumpjack/fishconLC" rel="nofollow noreferrer">https://github.com/jumpjack/fishconLC</a></p>

CC BY-SA 4.0
2024-07-31T22:41:23.087Z
Any idea what I would need to do if I have four to six partially overlapping <180 deg fisheyes? I have been struggling for days to find some explanation to that. Not clear to me how to map all fisheye frames into a single equirectangular.
Valeria
CC BY-SA 4.0
2024-08-03T14:49:45.107Z
this is nt a comment, it's a question with a very complex answer
jumpjack
CC BY-SA 4.0
2024-03-01T13:50:05.660Z
2024-03-01T13:50:05.660Z
jumpjack
<p>Quite a while back, I used a now-discontinued 360-degree camera called the YI 360 camera to record some videos.</p>
<p>The software that came with the camera is no longer available, and to my knowledge, it didn't work very well anyway.</p>
<p>I need to find a way, using FFmpeg's v360 filter, to convert this footage into an equirectangular format.</p>
<p>Since I am not very well versed in FFmpeg's filter usage, there are a couple of challenges.</p>
<p>Firstly, the video is split into two 220-degree (not 180, at least according to the camera's website) fisheye views that overlap slightly.</p>
<p>Secondly, the camera itself is visible within the overlapping region, which must be removed.</p>
<p>How can I use FFmpeg to accomplish the equirectangular projection I want?</p>
<p><a href="https://i.sstatic.net/O3JR0.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/O3JR0.jpg" alt="220 degree fisheye vr video recorded with yi 360 camera" /></a></p>

<ffmpeg><360video>
how do i use ffmpeg to stitch 220-degree fisheyes into a 360 equirectangular video?
FenFox
# how do i use ffmpeg to stitch 220-degree fisheyes into a 360 equirectangular video?

(Asked by: username_0 on 2023-12-28)

Quite a while back, I used a now-discontinued 360-degree camera called the YI 360 camera to record some videos.

The software that came with the camera is no longer available, and to my knowledge, it didn't work very well anyway.

I need to find a way, using FFmpeg's v360 filter, to convert this footage into an equirectangular format.

Since I am not very well versed in FFmpeg's filter usage, there are a couple of challenges.

Firstly, the video is split into two 220-degree (not 180, at least according to the camera's website) fisheye views that overlap slightly.

Secondly, the camera itself is visible within the overlapping region, which must be removed.

How can I use FFmpeg to accomplish the equirectangular projection I want?

[![220 degree fisheye vr video recorded with yi 360 camera](https://i.sstatic.net/O3JR0.jpg)](https://i.sstatic.net/O3JR0.jpg)

**Tags:** ffmpeg, 360video


---

## 1 answers

### Answer by username_1 on 2024-03-01. Score: 1 | Accepted answer

Rectifying single photo:
ffmpeg -i input.jpg -vf v360=fisheye:e:ih_fov=200:iv_fov=200 -y output.jpg

Rectifying horizontal double fisheye:
ffmpeg -i input.jpg -i dftest.gif -filter_complex "[1:v]v360=input=dfisheye:output=equirect:ih_fov=200:iv_fov=200[out_v]" -map "[out_v]"  output.jpg

You have a vertically stacked double fisheye, so you have to convert it in advance:

crop the 2 parts (540x540, one at 0,0, the other at 0,540):

crop=out_w=540:out_h=540:x=0:y=540
crop=out_w=540:out_h=540:x=0:y=0


stack them horizontally: hstack
send to v360 filter as above; v360=input=dfisheye:output=equirect:ih_fov=200:iv_fov=200

Final result:
ffmpeg -y -i input.jpg -filter_complex "[0:v]crop=out_w=540:out_h=540:x=0:y=540[3];[0:v]crop=out_w=540:out_h=540:x=0:y=0[1];[1][3]hstack,v360=input=dfisheye:output=equirect:ih_fov=200:iv_fov=200[out_v]" -map "[out_v]" output.jpg


I used FOV=200 rather than FOV to remove overlapping.
You can add parameter yaw to turn camera around:
ffmpeg -y -i input.jpg -filter_complex "[0:v]crop=out_w=540:out_h=540:x=0:y=540[3];[0:v]crop=out_w=540:out_h=540:x=0:y=0[1];[1][3]hstack,v360=input=dfisheye:output=equirect:ih_fov=200:iv_fov=200:yaw=45[out_v]" -map "[out_v]" output.jpg

yaw=0:

yaw=45:

Test result here: https://renderstuff.com/tools/360-panorama-web-viewer/
Used this amazing tool to experiment: https://ffmpeg.lav.io/
You can also experiment with windows software I wrote to replace XDV360 software which came with my panocam with single 220° fisheye lens:
https://github.com/username_1/fishconLC

> **Comments:**
> **username_2**: Any idea what I would need to do if I have four to six partially overlapping <180 deg fisheyes? I have been struggling for days to find some explanation to that. Not clear to me how to map all fisheye frames into a single equirectangular.  
> **username_1**: this is nt a comment, it's a question with a very complex answer  

---

