I'm working on a project that requires me to have a viewfinder (barcode scanner).
I'm doing this with the Raspberry Pi Camera Module by the picamera
python module, and I've got the whole detection and whatnot programmed.
Now I need to figure out how to display the preview from the Pi's Camera Module in a PyGame movie module. (If there's a better way to display video from an IO Stream in PyGame, please let me know.)
The reason I need to display it in PyGame is because I'll need to overlay controls on top of the video and be able to get input from a touchscreen I'm going to use as the viewfinder/screen for the Pi/project.
As far as I can see from the pygame.movie documentation, pygame.movie
only loads from a file. Is there a way that I could convert the stream into a file-like object and have PyGame play from that?
Basically put, I need a way to take the io.BytesIO stream created in this example code, and display it in PyGame.