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

API for stream output #283

Open
adamkglaser opened this issue Apr 11, 2024 · 0 comments
Open

API for stream output #283

adamkglaser opened this issue Apr 11, 2024 · 0 comments

Comments

@adamkglaser
Copy link

adamkglaser commented Apr 11, 2024

@aliddell @nclack It would be useful to be able to track dropped frames via the eGrabber SDK, and perhaps more generally the entire video stream. Other camera SDKs may not offer functions for this, but with eGrabber /GenICam it is relatively straightforward. A code snippet in Python for how we are doing this now below, would be nice if we could do the same in ACQUIRE?

def signal_acquisition_state(self):
"""return a dict with the state of the acquisition buffers"""
# Detailed description of constants here:
# https://documentation.euresys.com/Products/Coaxlink/Coaxlink/en-us/Content/IOdoc/egrabber-reference/
# namespace_gen_t_l.html#a6b498d9a4c08dea2c44566722699706e
state = {}
state['Frame Index'] = self.grabber.stream.get_info(STREAM_INFO_NUM_DELIVERED, INFO_DATATYPE_SIZET)
state['Input Buffer Size'] = self.grabber.stream.get_info(STREAM_INFO_NUM_QUEUED,
                                                     INFO_DATATYPE_SIZET)
state['Output Buffer Size'] = self.grabber.stream.get_info(STREAM_INFO_NUM_AWAIT_DELIVERY,
                                                        INFO_DATATYPE_SIZET)
# number of underrun, i.e. dropped frames
state['Dropped Frames'] = self.grabber.stream.get_info(STREAM_INFO_NUM_UNDERRUN,
                                                     INFO_DATATYPE_SIZET)
state['Data Rate [MB/s]'] = self.grabber.stream.get('StatisticsDataRate')
state['Frame Rate [fps]'] = self.grabber.stream.get('StatisticsFrameRate')
self.log.info(f"id: {self.id}, "
             f"frame: {state['Frame Index']}, "
             f"input: {state['Input Buffer Size']}, "
             f"output: {state['Output Buffer Size']}, "
             f"dropped: {state['Dropped Frames']}, "
             f"data rate: {state['Data Rate [MB/s]']:.2f} [MB/s], "
             f"frame rate: {state['Frame Rate [fps]']:.2f} [fps].")
return state
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Priority Backlog
Development

No branches or pull requests

1 participant