Skip to content

ValueError: -4 is not a valid FrameStatus #47

@DFMoller

Description

@DFMoller

After upgrading from vmbpy 1.0.4 to 1.0.5, I started getting these exceptions in my frame handler when calling frame.get_status().

Exception ignored on calling ctypes callback function: <bound method Stream.__frame_cb_wrapper of <vmbpy.stream.Stream object at 0x7fad88150cd0>>
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/vmbpy/stream.py", line 554, in __frame_cb_wrapper
    raise e
  File "/usr/local/lib/python3.11/site-packages/vmbpy/stream.py", line 546, in __frame_cb_wrapper
    context.frames_handler(self._parent_cam, self, frame)
  File "/opt/app/vimba_grabber/vimba_grabber_module.py", line 95, in __call__
    if frame.get_status() == FrameStatus.Complete:
       ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/vmbpy/frame.py", line 284, in get_status
    return FrameStatus(self._frame.receiveStatus)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/enum.py", line 714, in __call__
    return cls.__new__(cls, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/enum.py", line 1137, in __new__
    raise ve_exc
ValueError: -4 is not a valid FrameStatus

Somehow, the frame has a status with an enum value that does not exist (it has value -4). This is from the vmbpy 1.0.5 source:

class VmbFrameStatus(Int32Enum):
    """Frame transfer status."""
    Complete = 0     #: Frame has been completed without errors
    Incomplete = -1  #: Frame could not be filled to the end
    TooSmall = -2    #: Frame buffer was too small
    Invalid = -3     #: Frame buffer was invalid

    def __str__(self):
        return self._name_

Environment:

  • vmbpy 1.0.5
  • python 3.11
  • camera: Mako G-040C

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions