The raspistill -o image.jpg
command successfully captures images. But when I try capturing from a really simple Python script, I get an error. The script is
from picamera import PiCamera
cam = PiCamera()
cam.capture('image.jpg')
cam.close()
The error is
Traceback (most recent call last):
File "/home/pi/Documents/CamTest.py", line 6, in <module>
camera.capture('image.jpg')
File "/usr/lib/python3/dist-packages/picamera/camera.py", line 1423, in capture
'Timed out waiting for capture to end')
picamera.exc.PiCameraRuntimeError: Timed out waiting for capture to end
What am I missing here? Need help.
[OS: Linux raspberrypi 4.9.59-v7+ | picamera v1.13 | Raspberry Pi Camera Rev 2.1]
NameError
given you're initializingcam
but trying to execute a method oncamera
– Dave Jones Nov 13 '17 at 12:47cam.('image.jpg', use_video_port=True)
I'm able to acquire somewhat "grainy" looking image. This is because images taken via still port byraspistill
undergoes a strong noise reduction algorithm i.e. appear as higher quality compared to the video port Refer to picamera.readthedocs.io/en/latest/fov.html#the-still-port. I think the error is related to Encoding as indicated bypycamera/camera.py line 1423
@DaveJones – MAAI Nov 15 '17 at 0:56Desktop
not theLite
one(?). @Craig – MAAI Nov 15 '17 at 14:08