Adjust buffer size

Last modified by Lev Andronov on 2025/05/20 10:04

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

pic1.png

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, "CameraSelector", 0); // Select camera index
KYFG_SetGrabberValueInt(handle, "SegmentsPerBuffer", 1); // Set Segments Per Buffer value

Vision Point legacy GUI

To configure the 'SegmentsPerBuffer' parameter in Vision Point GUI:

  1. Go to Frame Grabber → Extended Stream Features
  2. 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.
KAYA Instruments © 2024. All Rights Reserved.