Utilizing an old Android as a security camera and saving footage to HDD
You could try using IP Webcam, installing the computer driver on a computer on a LAN, and then using PC webcam software that points at your NAS.  Not sure on how to write directly though.  If your NAS allows you to host an FTP server from it, however, you could write directly.
On the topic of FTP, you could use Filezilla Server on a Windows computer, and point it at your NAS, if you didn't want as much overhead, although if you are usiing the lite version you will get a watermark in this mode.