You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@xialuoke4062 as it says in the error the queue is full. You can probably increase the queue size. You can find the following piece of code in freenect2/__init__.py in line 93.
@paul-shuvo Thank you so much for the advice! Changing the maxsize definitely helps a bit. However, my program is indeed slow and I want to do some real-time analysis on the live stream (increasing maxsize isn't sufficient enough). When you said
For my case, I just saved the last 6/12/18 frames
how did you manage to achieve that inside the live-stream for loop for type_, frame in device:
Thank you for your help in advance!
From what I remember, I did something of the following:
classQueueFrameListener(object):
def__init__(self, maxsize=16):
self.queue=Queue(maxsize=maxsize)
def__call__(self, frame_type, frame):
# you can also check is the queue is full using .full methodifself.queue.qsize() >=12: # change the number of frames you want to use # basically remove an item to accomodate the newer frames_=self.get() # or, self.queue.get(True, timeout)self.queue.put_nowait((frame_type, frame))
defget(self, timeout=False):
returnself.queue.get(True, timeout)
Activity
xialuoke4062 commentedon Jun 15, 2021
Hi, I have encountered the same problem and have not been able to single out the cause. Any advice will be greatly appreciated!
macOS Big Sur Version 11.4
python 3.7
paul-shuvo commentedon Jun 16, 2021
@xialuoke4062 as it says in the error the queue is full. You can probably increase the queue size. You can find the following piece of code in
freenect2/__init__.pyin line93.Change the
maxsize. For my case, I just saved the last 6/12/18 frames, so that if my program is slow, it doesn't crash.xialuoke4062 commentedon Jun 16, 2021
@paul-shuvo Thank you so much for the advice! Changing the
maxsizedefinitely helps a bit. However, my program is indeed slow and I want to do some real-time analysis on the live stream (increasingmaxsizeisn't sufficient enough). When you saidhow did you manage to achieve that inside the live-stream for loop
for type_, frame in device:Thank you for your help in advance!
paul-shuvo commentedon Jun 16, 2021
From what I remember, I did something of the following:
Let me know if it solves your problem.
xialuoke4062 commentedon Jun 16, 2021
Works like a charm and that makes perfect sense! Can't say thank you enough - I really appreciate your help!
add the 2 open PRs, also add queue size management from rjw57#5