This release allows you to manage Camera in your own context . You can now safely do:
with Camera(device) as camera:
frame1 = camera.snapshot()
frame2 = camera.snapshot()
... do something cool with frames ...
This change also fixes the behavior of snapshot returning the same frame when passing Camera a video file.
To maintain resource safety by default, we still support:
camera = Camera(device)
will safely open / close camera
frame1 = camera.snapshot()
will safely open / close camera
frame2 = camera.snapshot()
... do something cool with frames ...
Breaking change: We have dropped the dropframes flag to snapshot. We recommend using the new context approach and manually taking a few snapshots, if needed.