Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using framerate_delta freezes camera module until reboot #624

Open
mikhailkin opened this issue May 17, 2020 · 0 comments
Open

Using framerate_delta freezes camera module until reboot #624

mikhailkin opened this issue May 17, 2020 · 0 comments

Comments

@mikhailkin
Copy link

I want to change framerate on the fly. From time to time Raspberry 3B with camera V2.1 I get module freeze. Nothing helps, but reboot. Code to reproduce:

import picamera
import time

print('Initializing camera')
camera = picamera.PiCamera()
time.sleep(0.5)
camera.resolution = (640, 480)
camera.framerate = 10
camera.annotate_frame_num = True
print('Ok')

n_cycles = 10

camera.start_recording('test.h264')
for i in range(n_cycles):
    if i > 2 and i % 2 == 0:
        camera.framerate_delta = -9.5
    else:
        camera.framerate_delta = 0.
    msg = f"{i}: {camera.frame.index:4d} F{float(camera.framerate_delta):2.1f}"
    print(msg)
    camera.annotate_text = msg
    camera.wait_recording(1.)

camera.stop_recording()

Output:

Initializing camera
Ok
0:    0 F0.0
1:    4 F0.0
2:   14 F0.0
3:   24 F0.0
4:   34 F-9.5
5:   36 F0.0
6:   36 F-9.5
Traceback (most recent call last):
  File "framerate_delta_issue.py", line 21, in <module>
    camera.framerate_delta = 0.
  File "/usr/lib/python3/dist-packages/picamera/camera.py", line 2417, in _set_framerate_delta
    self._check_camera_open()
  File "/usr/lib/python3/dist-packages/picamera/camera.py", line 538, in _check_camera_open
    raise exc
  File "/usr/lib/python3/dist-packages/picamera/camera.py", line 1995, in _control_callback
    "No data recevied from sensor. Check all connections, "
picamera.exc.PiCameraRuntimeError: No data recevied from sensor. Check all connections, including the SUNNY chip on the camera board

I was not able to reproduce issue on Pi Zero with different camera module. But I've seen same issue a couple of times.
If someone knows safer method to change framerate, please, share it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant