# stream_send_cli Captures MJPEG from a V4L2 device and streams it to a receiver over TCP as `VIDEO_FRAME` protocol messages. Prints per-stream throughput statistics. Pair with [`stream_recv_cli`](stream_recv_cli.md) to test an end-to-end stream without running a full node. --- ## Build From the repository root: ```sh make cli ``` The binary is placed in `build/cli/`. --- ## Usage ```sh ./stream_send_cli [--device PATH] [--host HOST] [--port PORT] [--stream-id N] ``` | Option | Default | Description | |---|---|---| | `--device PATH` | `/dev/video0` | V4L2 capture device | | `--host HOST` | `127.0.0.1` | Receiver hostname or IP | | `--port PORT` | `7700` | Receiver TCP port | | `--stream-id N` | `1` | Stream ID embedded in each `VIDEO_FRAME` message | ### Example ```sh # Terminal 1 — start a receiver ./stream_recv_cli --port 7700 # Terminal 2 — start the sender ./stream_send_cli --device /dev/video0 --host 127.0.0.1 --port 7700 --stream-id 1 ``` ### Statistics output Printed to stderr every 0.5 seconds: ``` stream 1: 30.2 fps 18.4 Mbps ``` --- ## Notes - The tool opens the device and selects the highest-FPS MJPEG mode automatically. - Frames are sent as-is (raw MJPEG from the kernel) wrapped in `VIDEO_FRAME` messages — no re-encoding. - The connection is outbound: `stream_send_cli` connects to the receiver, not the other way around. This mirrors the node's START_INGEST behaviour. --- ## Relationship to the Video Routing System `stream_send_cli` tests the source end of the ingest pipeline: V4L2 capture → transport send → `VIDEO_FRAME` messages. The node's ingest module performs the same operation, but driven by `START_INGEST` commands over the control channel. See also: [`stream_recv_cli.md`](stream_recv_cli.md) for the receive side; [`v4l2_view_cli.md`](v4l2_view_cli.md) for local-only viewing.