Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
picamera overlay bug (mmal) #174
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)