Adjust buffer size
- Increase acquisition buffer count using "Frames per Stream
- Accumulate frames into a single buffer using "Segments Per Buffer
Increase acquisition buffer count using "Frames per Stream"
The number of buffers to be allocated for acquisition, can be configured by setting the 'FramesPerStream' Frame Grabber parameter:
Frame Grabber properties -> Extended Stream Features -> Camera Selector - > Image Format Control -> Frames Per Stream
The maximum supported number of frames is 65535. Changing 'FramesPerStream' parameter will also define number of buffers to be recorded if you are using "Save a video" feature in Vision Point legacy.
Accumulate frames into a single buffer using "Segments Per Buffer"
The stream callback is triggered each time a frame buffer is completely filled and the execution of the previous callback has already finished. However, the stream callback cannot reliably handle update rates exceeding 10,000 times per second, depending on CPU and software capabilities.
To resolve this limitation, you can accumulate multiple frames/lines into a single buffer using the 'SegmentsPerBuffer' parameter on the grabber. This approach reduces the callback frequency, as the stream callback will be invoked only when the buffer containing the specified number of frames/lines is completely filled.
Vision Point legacy API
To configure the 'SegmentsPerBuffer' parameter via Vision Point API:
KYFG_SetGrabberValueInt(handle, "SegmentsPerBuffer", 1); // Set Segments Per Buffer value
Vision Point legacy GUI
To configure the 'SegmentsPerBuffer' parameter in Vision Point GUI:
- Go to Frame Grabber → Extended Stream Features
- Navigate to: Camera Selector → Image Format Control → Segments Per Buffer
Segments Per Buffer parameter must be set only after a camera has been connected and opened (camera detection process).
- The default value of 'SegmentsPerBuffer' is `1`, meaning the stream callback will occur for every single frame/line captured.
- 'SegmentsPerBuffer' is a grabber-level setting applied per camera. For details on configuring grabber parameters per camera, refer to the "CameraSelector" section in the *KAYA Frame Grabber Feature Guide* document.
- Memory Consideration:
- Increasing the 'SegmentsPerBuffer' value requires adjusting the size of the acquisition buffers accordingly.
- In this case, the required memory, reported by the function `KYFG_StreamGetInfo()` with the `KY_STREAM_INFO_PAYLOAD_SIZE` info command, will increase proportionally.
- For example, if a camera has a frame size of 640x480 and 'SegmentsPerBuffer' is set to `10`, the buffer size will increase to accommodate `10` frames.