运行2天后覆盆子凸轮停止工作

2024-04-25 11:48:35 发布

您现在位置:Python中文网/ 问答频道 /正文

我编写了一个程序,用RPi Cam来捕捉和保存图像
系统运行良好,但突然出现以下错误:

mmal: mmal_vc_port_enable: failed to enable port 
vc.ril.image_encode:out:0(JPEG): ENOMEM
mmal: mmal_port_enable: failed to enable port 
vc.ril.image_encode:out:0(JPEG)
(0xc8a100) (ENOMEM)
Traceback (most recent call last):
  File "./Test_cam.py", line 300, in <module>
    putfunc()
  File "./Test_cam.py", line 169, in putfunc
    oneshot(_client_id)
  File "./Test_cam.py", line 137, in oneshot
    _cam.capture(ifn, use_video_port=True,resize=(1920,1080),splitter_port=0)
  File "/usr/lib/python2.7/dist-packages/picamera/camera.py", line 1418, in capture
    encoder.start(output)
  File "/usr/lib/python2.7/dist-packages/picamera/encoders.py", line 1126, in start
    super(PiCookedOneImageEncoder, self).start(output)
  File "/usr/lib/python2.7/dist-packages/picamera/encoders.py", line 377, in start
    self.output_port.enable(self._callback)
  File "/usr/lib/python2.7/dist-packages/picamera/mmalobj.py", line 1249, in enable
    prefix="Unable to enable port %s" % self.name)
  File "/usr/lib/python2.7/dist-packages/picamera/exc.py", line 184, in mmal_check
    **raise PiCameraMMALError(status, prefix)**
**picamera.exc.PiCameraMMALError: Unable to enable port vc.ril.image_encode:out:0: Out of memory**

有人能帮我吗?在


Tags: toinpyportenablelibpackagesusr
2条回答

Related:
Error Message "_mmal: mmal_vc_port_enable: failed to enable port_" is from libmmal.so.

Found the following in API - mmalobj
Warning
This part of the API is still experimental and subject to change in future versions.

验证您使用的是最新的picamera module和{}。由于picamera使用libmmal.so,所以您也可以使用兼容的版本。在

更多信息站点:
raspberrypi.org: Pure Python camera interfacepicamera
SO Answer: HowTo update libmmal.so


Comment: I dont know what does "memory" mean in "out of memory" term

可能是后续错误。在

Error Message:
mmal: mmal_vc_port_enable: failed to enable port
vc.ril.image_encode:out:0(JPEG): ENOMEM

端口肯定有问题
长时间运行也可能导致缓冲区溢出。在


要验证您的相机没有损坏,请尝试以下脚本:

from time import sleep
from picamera import PiCamera

camera = PiCamera()
camera.resolution = (1024, 768)
camera.start_preview()
# Camera warm-up time
sleep(2)
camera.capture('foo.jpg', resize=(320, 240))
while (time.time() - start) < vterm:
    _cam.annotate_text = id + "\n" + time.strftime('%Y-%m-%d %H:%M:%S')
    nt = time.time()
    if (nt - pt) > iterm:
        ifn = tmpfname('jpg') 
        _cam.capture(ifn, use_video_port=True,resize=(1920,1080),splitter_port=0)
        tmp2nofile(nt, _path['live'], ifn, 'jpg')
        pt = nt
        if _debug:
            print 'image',ifn
    time.sleep(0.1)
_cam.stop_recording(splitter_port=1)
tmp2nofile(start, _path['live'], vfn, 'h264')
_cam.stop_preview()
_cam.close()

相关问题 更多 >