antiboredom / ffmpeg-explorer

Create and render complex ffmpeg filtergraphs in the browser.
https://ffmpeg.lav.io
446 stars 17 forks source link

Command line for rectifying dual fisheye cameras pictures/videos #19

Open jumpjack opened 9 months ago

jumpjack commented 9 months ago

FFMPEG directly supports double fisheye images like this, converting them automatically into equirectangular for spherical/VR viewing:

image

But it does not support vertical stacking;

image

Solution:

ffmpeg -i df.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:yaw=0:ih_fov=200:iv_fov=200[out_v]" -map "[out_v]" out.gif Result:

image

Test here:

https://renderstuff.com/tools/360-panorama-web-viewer/

Attached json:

dfisheye-to-equirect.json

Reference: https://video.stackexchange.com/questions/37100/how-do-i-use-ffmpeg-to-stitch-220-degree-fisheyes-into-a-360-equirectangular-vid/37270#37270