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

ValueError: -4 is not a valid FrameStatus #47

Open
DFMoller opened this issue Feb 27, 2025 · 1 comment
Open

ValueError: -4 is not a valid FrameStatus #47

DFMoller opened this issue Feb 27, 2025 · 1 comment

Comments

@DFMoller
Copy link

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
@arunprakash-avt
Copy link

Thank you for reporting the issue. Can you please write an email to [email protected]?

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

2 participants