This is the smallest C++ example in the repository. It is the best reference when you need the minimal depthai::Pipeline plus dai::RemoteConnection shape in C++, without any extra nodes, models, or frontend complexity.
- You need a C++ starting point for streaming camera frames to the Visualizer.
- You want the simplest example of creating a
dai::node::Camerain C++. - You need a baseline for building or packaging a C++ OAK app with CMake.
- You want a host/peripheral example that also has an RVC4 standalone packaging path.
- You need encoded video output, detections, or depth.
- You need a standalone-only device-mode app with no Visualizer.
- You need ROS, a custom frontend, or a multi-node pipeline.
- You need a richer C++ example with hardware-specific runtime behavior.
Category:cpp/camera_streamShape:cppPrimary task:minimal C++ camera streaming to DepthAI VisualizerEntrypoint:src/main.cppStandalone path:oakapp.tomlFrontend:noneRuns on:RVC2 peripheral, RVC4 peripheral, and RVC4 standalone packagingRequires:depthai-coreinstalled for host builds; a Luxonis device with a color camera onCAM_AInput:one RGB camera streamOutput:one Visualizer topic namedstreamModels:noneVisualizer / UI:DepthAI Visualizer viadai::RemoteConnection
- src/main.cpp: entire runtime pipeline
- CMakeLists.txt: host build shape and
depthai::corelinkage - oakapp.toml: standalone build steps and
cppbase image - backend-run.sh: packaged app startup command
- README.md: host and standalone run instructions
- The app creates a
dai::RemoteConnection. - It creates one
dai::Pipeline. - A
dai::node::Camerais bound toCAM_A. - The app requests a
1280x800NV12output from the camera. - That output is registered as one Visualizer topic.
- The process stays alive until
qis received through the RemoteConnection.
CAM_A -> requestOutput(1280x800, NV12) -> RemoteConnection topic "stream"
Safe to change:topic name, output size, camera socket, key handling, CMake target nameRequires care:camera socket assumptions, RemoteConnection lifecycle, host build environment fordepthai-coreLikely to break if changed blindly:switching to nodes that need extra libraries or assuming the standalone path behaves like a browser frontend app
To add another topic:request another output and register it in src/main.cppTo change resolution or frame type:edit therequestOutput(...)call in src/main.cppTo use this as a packaged C++ baseline:keep CMakeLists.txt, oakapp.toml, and backend-run.sh, then expand only src/main.cppTo move toward device-only USB streaming:compare against cpp/uvc
- The example assumes the color camera is on
CAM_A. - The host build depends on a discoverable
depthai-coreinstallation. - The packaged standalone path still uses
RemoteConnection; it is not a headless device-mode app. - Only one topic is published, so this is intentionally not a reusable multi-stream scaffold.
- oakapp.toml compiles the app inside the container during
build_steps, not ahead of time. assign_frontend_port = trueis present even though this is still a Visualizer topic flow, not a custom frontend.- The README says to look for an
imagesstream tile, but the actual topic name in code isstream.
- cpp/uvc: use this when you need standalone USB camera behavior instead of Visualizer streaming
- tutorials/camera-demo: use this when a Python baseline is fine
- apps/default-app: use this when you want a richer packaged app with detections and depth
Host run:cmake -S . -B build && cmake --build build && ./build/mainStandalone run:oakctl app run .Success looks like:the Visualizer shows a live topic namedstream, and pressingqexits the app cleanlyCommon failure meaning:depthai-coreis not discoverable by CMake, the device lacks the expected camera, or the Visualizer topic name is being looked up incorrectly