I got the problem fixed!
I had tried disabling webcast and disabling recording and it didn't make any difference. What helped was setting the camera make from Generic/ONVIF to Amcrest, leaving all the other settings like ports and stream profiles exactly the same; and the freezes are gone. The...