Closed scraton closed 2 years ago
Awesome! Glad you find it useful to merge. I've resolved the formatting issues and add a line to .editorconfig
to hopefully prevent that sort of issue in the future. Thanks for the diligence in maintaining code formatting!
As a note to myself (and I welcome an additional commit to be appended here); snapshot feature has room to make it even better: it can serve the last received frame instead of the next incoming frame. It allows the users fetch the last frame even the camera stopped working.
I had considered doing it this way, but didn't want to add in the extra memory requirements that'd entail. But if you're open to it, I think it'd be a great addition. I'll open a separate PR for it if I can find some time to add that this weekend.
Okay, I understood the thoughts behind the implementation. I'm going to merge this now since the addition does what you want! Because frames received from DSLRs are so small, I can accept the increment of the memory consumption IMO. Thank you again for your contribution, and I'd like to ask you to implement this if you have time.
Love the work you've done here! I wanted to use my Nikon camera along with OctoPrint for some sweet timelapse videos of 3D prints. But their software expects an MJPEG stream and a way to capture JPEG snapshots. So I added endpoints for both of these:
/mjpeg
- Provides an MJPEG stream straight from the camera, same as what the websocket endpoint sends/snapshot
- Provides the latest JPEG image taken from the sensor after the request is madeNot sure if this would fit into your main project scope, but wanted to provide it back in case others find it useful. :)