stetsmando / pi-camera

A Node.js wrapper for the native Raspberry Pi camera utilities
MIT License
74 stars 17 forks source link

Not an issue, just a question #9

Closed YorkAARGH closed 6 years ago

YorkAARGH commented 6 years ago

Is there a way this could return a buffer / bufferArray as well as saving to file?

stetsmando commented 6 years ago

Hey @YorkAARGH I'm sure it's possible. Basically what the lib does is execute bash commands on the pi. It uses Node's child process to run those commands and just returns what the output would be to the console if you ran them manually. You can read more about it here. Also this is where that happens in the code. So what could be possible is to initiate the capture of video or an image and then read that from disk as a stream and return the stream. I think having the entire image or video as a buffer could quickly take up too much memory. It's possible, but I don't have any plans on doing that at the moment. I am however, happy to accept pull requests 😀