Dear,
For example, this camera can do the job (but is not ONVIF compliant)
https://www.cctvcamerapros.com/IP-camera-SD-card-recording-s/734.htm
But it's not clear about :
There is only 7 sec pre-recording. So, I suppose this is not prerecording on the SDCARD but on a Internal memory (RAM) which is certainly more efficient. In that case, a SDCARD is maybe not necessary. Is the prerecording also triggered by the External Input ? In case of an alarm, I suppose the PreRecording and the Recordingis sent to the NAS or NVR.
BR