This is the repository reference for serving a live H265 RTSP stream from an OAK pipeline. Use it when you need a standard media endpoint that players like VLC or ffplay can consume.
- You need an RTSP endpoint.
- You want H265 transport from a live camera feed.
- You need a standards-based alternative to the custom TCP or MJPEG examples.
- You need browser-native delivery.
- You need replay input or per-frame inference overlays.
- You need a saved file instead of a live stream.
Category:streaming/rtsp-streamingShape:script+standalone-servicePrimary task:expose a live camera feed asrtsp://.../previewEntrypoint:main.pyStandalone path:backend-run.sh and oakapp.tomlFrontend:noneRuns on:RVC2 peripheral, RVC4 peripheral, and RVC4 standalone packagingRequires:GStreamer RTSP server dependencies and liveCAM_AinputInput:live camera onlyOutput:RTSP stream onrtsp://<host-or-device>:8554/previewplusVideopreview topicModels:noneVisualizer / UI:RTSP client such as VLC orffplay, plus DepthAI Visualizer for the preview topic
- README.md
- main.py
- utils/host_stream_output.py
- utils/rtsp_server.py
- utils/arguments.py
- backend-run.sh
- oakapp.toml
- main.py captures
CAM_Aas640x480NV12 and encodes it withdai.node.VideoEncoderusingH265_MAIN. - utils/host_stream_output.py passes encoded packets into the RTSP server implementation.
- utils/rtsp_server.py mounts a shared
/previewstream throughGstRtspServer. - A separate raw
Videopreview is also published throughdai.RemoteConnection.
- The endpoint is fixed to port
8554and path/preview. - There is no replay mode and no model/inference branch.
- The runtime depends on
gi,Gst, andGstRtspServer, so this example is more environment-sensitive than the simpler HTTP or TCP ones. - In standalone mode the RTSP server runs on the device-side app container, so clients must connect to the device IP.
- streaming/mjpeg-streaming: use this when a browser-friendly HTTP stream is enough
- streaming/webrtc-streaming: use this when you need browser delivery and runtime configuration
- streaming/on-device-encoding: use this when you need device-side encoding saved to disk rather than served live
Run:python3 main.pyPreview:ffplay -fflags nobuffer -fflags discardcorrupt -flags low_delay rtsp://localhost:8554/previewSuccess looks like:an RTSP client can open/previewand the Visualizer shows theVideotopicCommon failure meaning:the GStreamer RTSP dependencies are missing, the client is pointed at the wrong host, or the user expects replay/input-selection features this example does not implement