How to calibrate a generic 360 camera for FFMpeg? remapping

I have a generic 360 Camera, and when I convert its fisheye 235° output into equirectangular using FFMpeg, I don’t get good results, the image appears squeezed at the bottom.

How could I determine the exact transformation needed to properly convert my images into equirectangular? FFMpeg has a “remap” filter, which uses 2 .pgm files for remapping… but how do I crate such files for my camera?