The stream command lets you view a live video feed from an ESP RainMaker camera device using WebRTC. Signaling is handled through AWS Kinesis Video Streams (KVS), the same mechanism used by the ESP RainMaker phone app.
The CLI acts as a WebRTC viewer — it connects to the KVS signaling channel advertised by the device, negotiates a peer connection, and renders the incoming video track.
Install the optional video streaming dependencies:
pip install aiortc opencv-python numpyaiortc— WebRTC peer connection and media handlingopencv-python— Video display window (optional if using--stats-only)numpy— Required by opencv
The base dependencies boto3 and websockets are installed automatically with the CLI.
esp-rainmaker-cli stream <nodeid> [options]<nodeid>— Node ID of the camera device.
| Flag | Description |
|---|---|
--output, -o <path> |
Save video to an MP4 file |
--region <region> |
Override the AWS region for KVS |
--duration <seconds> |
Stop the stream after N seconds |
--stats-only |
Print RTP statistics (FPS, bitrate, packet loss) without opening a video window |
--profile <name> |
Use a specific CLI profile |
esp-rainmaker-cli stream ABC123nodeOpens a video window showing the live feed. Press q or Esc to close.
esp-rainmaker-cli stream ABC123node --output recording.mp4esp-rainmaker-cli stream ABC123node --stats-onlyPrints periodic stats (FPS, bitrate, resolution, packet loss) to the terminal. Useful for headless environments or bandwidth testing.
esp-rainmaker-cli stream ABC123node --output clip.mp4 --duration 30Records 30 seconds of video and exits automatically.
esp-rainmaker-cli stream ABC123node --profile staging- The CLI fetches the device's node parameters to find the KVS channel name.
- Temporary AWS credentials are obtained via the RainMaker
assume_roleAPI. - A SigV4-signed WebSocket connection is opened to the KVS signaling channel.
- The CLI creates a WebRTC offer, sends it through the signaling channel, and receives the device's answer.
- ICE candidates are exchanged (trickle ICE) to establish a direct media path.
- The incoming video track is rendered via OpenCV and/or saved to file.
The device does not advertise a KVS channel in its parameters. Ensure the firmware has video streaming enabled and the device is online.
- Verify
opencv-pythonis installed:python -c "import cv2; print(cv2.__version__)" - On headless systems, use
--stats-onlyor--outputinstead.
- Ensure the device is online and streaming.
- Check that your network allows outbound UDP traffic (STUN/TURN ports).
- Try
--regionif the default region does not match the device's KVS channel region.
Use the --debug flag for detailed connection logs:
esp-rainmaker-cli stream ABC123node --debug