Can I record with the REC trigger?

Hi all.
Right now I am working on a patch for video recording and playback.
So my question is, I want my patch to record automatically with REC triggers emitted from the camera, but I don’t know how to do it. can I use NDI or something like that?

If anyone knows how to do this, I would greatly appreciate it!
Here is my machine environment.
MacBookPro2021
Blackmagic miniRecorder