I was trying to capture images using the Python picamera
module and was always getting Timed out waiting for capture to end
error (See this question).
Since the shell command raspistill
works fine, I'm planning to use it within a Python script. So far, I've been unable to achieve that. My code is
from picamera import PiCamera
import subprocess
camera = PiCamera()
cmd = "raspstill -vf -o home/pi/Pictures/image_shell.jpeg"
subprocess.call(cmd, shell=True)
The LED on the camera turns on for a second or two then turns off - gives me an idea that the image is captured (is it though?). But the captured image is no where to be found.
What am I doing wrong? Any ideas?
camera = PiCamera()
in case that borks something up (i.e. blocking the resource).picamera
import was from previous trials. You were right. Thatcamera
initialization was blocking the resources. Now that its working, It seems a bit slow 6.52 seconds to be exact. Is there any way to speed it up? I need my code to spend as little time as possible in capturing the image.