• DepthAI-v2
  • Measure bandwidth usage for streaming PoE cameras

Hi all, I have an OAK PoE camera and I want to measure how much network bandwidth it uses with different settings (e.g. resolution, fps etc).

I have been using the rgb_preview.py script from the depthai python repo, with the only addition of one line to change the frame rate and changing the preview size

camRgb.setPreviewSize(1920, 1080)
camRgb.setFps(30)

To measure the bandwidth I used this simple script that uses psutil and measures the difference in bytes received to calculate the download speed.

My question is, with the above code and a frame rate of 30fps the download speed is about 50Mb/s. If I decrease the frame rate the download speed also decreases, but if I increase the 60fps the speed stays at 50Mb/s. I would expect the usage to increase since the frame rate doubles but this is not what is measured.

Is this the correct way to measure bandwidth usage for a PoE camera?

  • Hi @Letty
    Best to use some integrated network analysis software. Should be pretty easy to tell the bandwidth used by the script.

    Alternatively you can use Wireshark, where you select the network interface and filter for the device IP:

    During streaming, I got about 266mbit/s when streaming video at 10FPS. This loosely confirms the calculations:
    1920*1080[W, H]*1.5[bytes per pixel for NV12-video output]*10[FPS]*8[B to bit] == 248832000[bits/s]. There is some additional overhead, possible FPS error.

    Thanks,
    Jaka

Hi @Letty
Best to use some integrated network analysis software. Should be pretty easy to tell the bandwidth used by the script.

Alternatively you can use Wireshark, where you select the network interface and filter for the device IP:

During streaming, I got about 266mbit/s when streaming video at 10FPS. This loosely confirms the calculations:
1920*1080[W, H]*1.5[bytes per pixel for NV12-video output]*10[FPS]*8[B to bit] == 248832000[bits/s]. There is some additional overhead, possible FPS error.

Thanks,
Jaka

    jakaskerl Thanks a lot! Is there any tool for Ubuntu that you can recommend? I could find only command line tools but I would prefer to have a GUI if possible. I will try out Wireshark anyway!

    Hi @Letty
    I'm mostly working on MacOS so I don't have direct experience, but I hear ifstat is great for these kinds of tasks.

    Thanks,
    Jaka