Open robmarkcole opened 4 years ago
Should just be a case of swapping WebcamVideoStream (which uses openCV for accessing USB webcams) for https://github.com/jrosebr1/imutils/blob/master/imutils/video/videostream.py and passing usePiCamera=True
.
Proposed update config and docs
camera:
video_source: 0 # an int for built in or USB source (320, 240), or PiCamera (1280, 720) or PiCameraHQ
Note the default resolution=(320, 240)
will need to be overwritten
Created branch https://github.com/robmarkcole/mqtt-camera-streamer/tree/support-rpi but getting issue https://github.com/robmarkcole/mqtt-camera-streamer/issues/20
Might be simpler to have a seperate camera script for the picamera and not import cv2 at all
Note that alternatively the rpi camera can be setup as an mjpeg stream -> https://github.com/waveform80/picamera/blob/master/docs/examples/web_streaming.py
Added picamera-publish.py
script, hangs after first frame published with error picameraruntimeerror: timed out waiting for capture to end
. Also tried numpy capture, same issue, presumably https://github.com/waveform80/picamera/issues/242
Reference simple script in https://github.com/chardorn/cambia/blob/master/critter_cam/loop_pub.py
Picamera example capturing to PIL
If using picamera we can also drop opencv requirement