3

I would like for my project to have one camera (PiCamera) Streaming video. And another USB Camera (PS3 Camera) taking pictures when I execute this function:

def grabPicture(self):
      grab_cam = subprocess.Popen("sudo fswebcam --timestamp '%d-%m-%Y %H:%M:%S (%Z)' -r 640x480 -d /dev/video0 -q /home/pi/pictures/%m-%d-%y-%H%M.jpg", shell=True)
      grab_cam.wait()
      todays_date = datetime.datetime.today()
      image_name = todays_date.strftime('%m-%d-%y-%H%M') + '.jpg'
      return image_name

The function above was working before I merge this guys code with mine.

Now the above functions does not seems to respond. If I run the command:

sudo fswebcam --timestamp '%d-%m-%Y %H:%M:%S (%Z)' -r 640x480 -d /dev/video0 -q /home/pi/pictures/%m-%d-%y-%H%M.jpg

is working fine. I think somehow the functions send the command to the PiCamera while PiCamera is busy with streaming. But Im not sure. Any ideas?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.