mqtt-camera-streamer icon indicating copy to clipboard operation
mqtt-camera-streamer copied to clipboard

Add picamera support

Open robmarkcole opened this issue 4 years ago • 7 comments

Picamera example capturing to PIL

If using picamera we can also drop opencv requirement

robmarkcole avatar Jun 29 '20 07:06 robmarkcole

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

robmarkcole avatar Jul 05 '20 05:07 robmarkcole

Created branch https://github.com/robmarkcole/mqtt-camera-streamer/tree/support-rpi but getting issue https://github.com/robmarkcole/mqtt-camera-streamer/issues/20

robmarkcole avatar Jul 07 '20 07:07 robmarkcole

Might be simpler to have a seperate camera script for the picamera and not import cv2 at all

robmarkcole avatar Jul 07 '20 08:07 robmarkcole

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

image

robmarkcole avatar Jul 19 '20 05:07 robmarkcole

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

robmarkcole avatar Jul 19 '20 05:07 robmarkcole

Example: https://github.com/google-coral/examples-camera/blob/master/raspicam/classify_capture.py

robmarkcole avatar Jul 30 '20 11:07 robmarkcole

Reference simple script in https://github.com/chardorn/cambia/blob/master/critter_cam/loop_pub.py

robmarkcole avatar Mar 08 '21 11:03 robmarkcole