0

I'm trying to write image frames from Raspberry Pi camera 1.3v. I'm using PiCamera library. When I run simple code to preview the camera, it shows frames almost real time.

import time
import picamera
with picamera.PiCamera() as camera:
    camera.start_preview()
    time.sleep(10)
    camera.stop_preview()

But following code doesn't write frames at real time. There is about 1 second delay between frames. When using USB webcam with openCV imwrite(), it writes much more than that rate.

import time
import picamera
with picamera.PiCamera() as camera:
    camera.start_preview()
    try:
        for i, filename in enumerate(camera.capture_continuous('image{counter:02d}.jpg')):
            print(filename)
            if i == 59:
                break
    finally:
        camera.stop_preview()
1

Use os.system(raspistill), I'm using it a lot in python To get it use import os and to use put os.system("put bash command here") try not to use sudo in your commands though

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.