If you are using a cheap camera, sports camera or CCTV with wide FOV, you will likely see a distortion on the sides of the image. Advanced driver software may correct this however you may just end up like me and see, the manufacturer’s attempt to fix the issue backfires ending up in asymmetrical correction stronger on one axis than the other.
OBS Shaderfilter comes with an excellent and simple fisheye shader, however it does not take the asymmetric axes in account. Thus, I present the hacked version of this filter, which can correct the oval fisheye distortions.
- Install the latest version of OBS ShaderFilter from GitHub
- Download the attached txt file to the folder of your choice.
- I like to save it directly next to the other shader examples, which in Windows is at C:\Program Files\obs-studio\data\obs-plugins\obs-shaderfilter\examples. Also, I remove the .txt extension, to conform to the naming, but none of it is really needed
Once you have installed these, make sure to restart OBS, so the shader filter is loaded.
- Create your video source, for which you want to apply the fisheye correction, and add a new effect filter.
- Select User-defined shader as the shader type
- Within the filter properties select Load shader text from file and select the downloaded shader
- Set up the correction parameters, that suit your camera lens best
- center x/y percent should be used if the correction is to be off-center
- power defines the strength of the correction, negative values should correct, positive ones create fisheye effect.
- The value to be used depends on the lens you are using. My CCTV 2.8-12mm 1:1.4 lens works with -0.08, but my 4mm lens requires a value around -0.12
- oval defines the ovality of the image correction in my case 1.25 is the level of asymmetricity of the fisheye effect