Making sure the last recorded frame is actually the last one I get in the output
See original GitHub issueI’ve got a time-sensitive mechanism that needs to be sure the last frame it got is actually the last one that got recorded until that moment. I’m using the start_recording
method and I’m passing an output object of a custom class I wrote that has implemented write
and flush
methods.
The write
method resembles this (it’s pseudocode):
def write(self, frame):
metadata = get_state_of_current_frame()
queue.push([metadata, frame])
change_targeted_state_of_next_frame()
Basically, I’m changing the state of what the camera sees (like showing a unicorn instead of a bear in the next frame) for the next frame that it records and sends it as a parameter to the write method. What I need is the assurance that in the next frame I’ll be seeing whatever the change_targeted_state_of_next_frame()
function wants it to see in the next one. Is this possible in this setting?
Hopefully, I’ve been as clear as possible 😃
Thank you!
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Closing for now; do feel free to re-open if you’ve further questions about this!
So right now the resolution I’m using is 480x272 and the exposure time is set to 3ms - the LEDs I’m testing are bright enough to compensate for the lack of exposure - this has the advantage of filtering out nearby lights. So theoretically the latency could be estimated at ~(31 + 3)ms.
For the time being, 6.7 frames/s are enough. As for retrieving the timestamps from the buffers, I’m gonna leave this for later on when getting more out of it is going to be necessary - this is anyway a good idea that’s worth trying out.
Thank you 6by9.