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

picamera overlay bug (mmal) #174

Closed
spinomaly opened this issue Oct 19, 2014 · 1 comment
Closed

picamera overlay bug (mmal) #174

spinomaly opened this issue Oct 19, 2014 · 1 comment
Assignees
Labels
Milestone

Comments

@spinomaly
Copy link

I have a B+ with the latest Noobs Raspian off the website (release date 2014-09-09). I am having troubles adding and removing overlays. After a sequence of approximately 60 add/remove overlays an out of memory error occurs. Code below as well as error. I watched the system memory during the add and remove overlay and the memory decreases at a specific rate that appears to be related to either the preview or bumpy buffer size. However, If I specify a smaller preview size than below the memory error still occurs with remaining system memory (but that still was decreasing).

import time
import picamera
import numpy as np

a = np.zeros((720, 1280, 3), dtype=np.uint8)
a[360, :, :] = 0xff
a[:, 640, :] = 0xff

i = 0

with picamera.PiCamera() as camera:
    camera.resolution = (1280, 720)
    camera.framerate = 24
    camera.start_preview()

    while True:

        i += 1
        print(i)
        o = camera.add_overlay(np.getbuffer(a), layer=3, alpha=64)
        time.sleep(.1)
        camera.remove_overlay(o)
mmal: mmal_vc_component_create: failed to create component 'vc.ril.video_render' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.video_render' (1)
Traceback (most recent call last):
File "overlay_bug.py", line 26, in <module>
o = camera.add_overlay(np.getbuffer(a), layer=3, alpha=64)
File "/usr/lib/python2.7/dist-packages/picamera/camera.py", line 953, in add_overlay
renderer = PiOverlayRenderer(self, source, size, **options)
File "/usr/lib/python2.7/dist-packages/picamera/renderers.py", line 474, in __init__
rotation, vflip, hflip)
File "/usr/lib/python2.7/dist-packages/picamera/renderers.py", line 89, in __init__
prefix="Failed to create renderer component")
File "/usr/lib/python2.7/dist-packages/picamera/exc.py", line 133, in mmal_check
raise PiCameraMMALError(status, prefix)
picamera.exc.PiCameraMMALError: Failed to create renderer component: Out of memory
@waveform80
Copy link
Owner

Excellent - thanks for the bug report - I'll mark this for 1.9

@waveform80 waveform80 added the bug label Oct 19, 2014
@waveform80 waveform80 added this to the 1.9 milestone Oct 19, 2014
@waveform80 waveform80 self-assigned this Oct 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants