Is it possible to get two camera instances running at the same time - one is for capturing live feed to stream across network, the other one records video when motion is detected (PRI sensor is used)? I am using Picamera library and it is capable of recording multiple streams using splitter_port. I've tried using multiprocessing (this is a very basic example) :
from multiprocessing import Process import time import picamera cam = picamera.PiCamera() def loop_a(): while 1: try: cam.start_recording('/home/pi/bin' + 'video1.h264') time.sleep(20) cam.stop_recording() except KeyboardInterrupt: cam.close() def loop_b(): while 1: try: cam.start_recording('/home/pi/bin' + 'video2.h264', splitter_port=2) time.sleep(20) cam.stop_recording(splitter_port=2) except KeyboardInterrupt: cam.close() if __name__ == '__main__': Process(target=loop_a).start() Process(target=loop_b).start()
but it doesn't work as I get the following error:
Camera component couldn't be enabled: Out of resources (other than memory)
Any help would be much appreciated, thanks.