Utilizing an old Android as a security camera and saving footage to HDD

I would like to create a small security camera network utilizing devices I already have, namely Android phones. All phones can have a constant sources of charge, as well as be attached to my wifi network, which has a custom NAS attached. I understand there are already apps that will stream to a Google Drive, however my lack of bandwidth makes this quite unappealing. Are there any apps that will allow me to do this that I haven’t found, or are there any recommendations for creating an application that will allow me to do this.