-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Camera() has buffering issue #37
Comments
Current use cases of the Camera() are, NOTE: the app is checked if it possibly falls into the buffering problem
|
After reviewing the apps, it seems there are 3 use cases,
With the uses cases in mind, I suggest,
with Camera(device) as cap:
for sample in cap.stream(): # this always gives the latest frame
# do processing
# first record and store frames into a file
with Camera(device) as cap:
file_path, error = cap.record(duration=60)
# then read the record file to process
with Camera(file_path) as file:
# for sample in file.stream(): # this is incorrect use for this proposal :(
frame = file.snapshot()
# do processing |
Camera() utilizes OpenCV's VideoCapture to get stream from camera device. The stream could be either from USB or Network via RTSP protocol. When VideoCapture opens up a stream we need to keep pulling frames from the stream to get the latest frame. If not, it would give a buffered frame with the wrong timestamp to users.
The text was updated successfully, but these errors were encountered: