Davidy22 / SkunkBooth

Text based command line webcam photobooth app
https://Davidy22.github.io/SkunkBooth/
Other
50 stars 12 forks source link

feat : threaded camera and renderer #35

Closed garuna-m6 closed 3 years ago

garuna-m6 commented 3 years ago

This is a sample for bifurcating threads for reading and rendering (its behind main so will close this), setting a reference on this (though sometimes the reading of self.frame object is very fast that it is assigned to None ,not handled case in reneder), was able to hit ~200fps fetching from camera (numpy images) in local

Davidy22 commented 3 years ago

I see the following trace on start:

Traceback (most recent call last):
File "main.py", line 48, in <module>

screen.draw_next_frame()
File "/home/davidoso/.local/lib/python3.8/site-packages/asciimatics/screen.py", line 1669, in 
effect.update(self.File "/home/davidoso/.local/lib/python3.8/site-packages/asciimatics/effects.py", line 71, in update
self._update(frame_no)
File "/home/davidoso/.local/lib/python3.8/site-packages/asciimatics/effects.py", line 343, in _updateimage, colours = self._renderer.rendered_text
TypeError: cannot unpack non-iterable NoneType object

Only asciimatics effect in the program is the webcam, so there's a None coming out of the thread at some point

garuna-m6 commented 3 years ago

yeah the last frame is coming out to be None, was trying to debug this but unable to complete yesterday night, don't think will be able to integrate it 😢