Rockchip · AI & Linux Hub

Cameras & video

Sizing camera buffers for two video streams on Rockchip RK3576

Each of the two cameras outputs a 1080p image, which does not mean that only two images are needed in memory.

Driver acquisition, preprocessing, display, and encoding may each have their own buffer queues. When selecting memory for the Sige5 edge vision device, first list the actual number of frames held by each stage.

First calculate a checkable lower limit

Without alignment, a 1920×1080 8-bit NV12 frame occupies 3,110,400 bytes. If the two acquisition channels each retain four frames, this link alone occupies approximately 23.7 MiB. Model weights, runtime workspaces, desktops, and kernels are not yet accounted for.

Reprocess alignment and duplicate copies

Get the actual number of bytes per row, effective height and size of each plane from the driver or framework. If pre-processed to convert to RGB888, then calculate a set of three bytes per pixel buffer. When multiple modules share the same DMA buffer, it is counted as allocated once, while keeping a record of who holds it.

Use long run correction

Observe the memory peak value when two channels are started at the same time, disconnected and reconnected, and resolution switched. If the memory increases stepwise with the number of reconnections, priority is given to checking old queues and buffer release. Simply expanding the memory will prolong the time to failure.

1080p buffer budget without alignment

object Calculate Occupy
Single sheet NV12 1920 × 1080 × 1.5 About 2.97 MiB
Four NV12s in each of the two lanes 8 × 2.97 MiB About 23.7 MiB
One additional RGB888 1920 × 1080 × 3 About 5.93 MiB

Board documentation and references

ArmSoM Sige5

Products and development resources

Check the hardware revision, carrier, image and interfaces in the product documentation. An article association is not evidence that a configuration has been tested.

Explore this topic → · Learning paths →