# saifmukhtar/openavx architecture

> Architecture diagram of the GitHub repository saifmukhtar/openavx, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/saifmukhtar/openavx
- Repository: https://github.com/saifmukhtar/openavx

## Overview

OpenAVX is an IP audio/video transport library with CLI tools for live production workflows. The principal path is generating or supplying media, transmitting it over TCP/RUDP, receiving it, then previewing, routing, or adapting it to browser and virtual-camera outputs. Separate branches provide discovery, gateway protocols, tally, and camera control. The excerpts show the public pipeline API and routing’s receive-to-send behavior; several other subsystems are represented from README capabilities because their implementation excerpts were not provided.

Main entry points: [`src/avx_recv.c`](https://github.com/saifmukhtar/openavx/blob/main/src/avx_recv.c) (Stream Receiver), [`tools/openavx_virtcam.c`](https://github.com/saifmukhtar/openavx/blob/main/tools/openavx_virtcam.c) (Virtual Camera CLI), [`tools/openavx_main.c`](https://github.com/saifmukhtar/openavx/blob/main/tools/openavx_main.c) (CLI Dispatcher), [`src/oavx_pipeline.c`](https://github.com/saifmukhtar/openavx/blob/main/src/oavx_pipeline.c) (Public Stream API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_media["Media Pipeline"]
  node_api["Public Stream API<br/>[oavx_pipeline.c]"]
  node_sender["Stream Sender<br/>[avx_send.c]"]
  node_receiver["Stream Receiver<br/>[avx_recv.c]"]
  node_audio["Audio Engine<br/>[avx_audio.c]"]
  node_audio_codec["Audio Codec<br/>[avx_audio_codec.c]"]
  node_video_codec["Video Codec<br/>[avx_video_codec.c]"]
  node_speedhq["SpeedHQ Codec<br/>[avx_speedhq.c]"]
  node_sync_rate["Sync and Rate Control<br/>[avx_framesync.c]"]
end

subgraph group_transport["Transport and Discovery"]
  node_wire["Wire Framing<br/>[avx_wire.c]"]
  node_udp["UDP and RUDP<br/>[avx_udp.c]"]
  node_fec["FEC Protection<br/>[avx_fec.c]"]
  node_crypto["Encryption<br/>[avx_crypto.c]"]
  node_discovery["Stream Discovery<br/>[avx_find.c]"]
  node_directory["Directory Server"]
end

subgraph group_production["Production Tools"]
  node_cli["CLI Dispatcher<br/>[openavx_main.c]"]
  node_pattern["Pattern Generator"]
  node_router_cli["Router CLI<br/>[openavx_router.c]"]
  node_routing["Matrix Router<br/>[avx_routing.c]"]
  node_tally["Tally Control<br/>[openavx_tally.c]"]
  node_onvif["ONVIF and PTZ<br/>[openavx_onvif.c]"]
end

subgraph group_outputs["Playback and Outputs"]
  node_monitor["Terminal Monitor<br/>[openavx_monitor.c]"]
  node_virtcam["Virtual Camera CLI<br/>[openavx_virtcam.c]"]
  node_gateway["HTTP and RTSP Gateway<br/>[openavx_gateway.c]"]
  node_web["Web and fMP4 Server<br/>[avx_web.c]"]
  node_rtsp["RTSP Server<br/>[avx_rtsp.c]"]
end

subgraph group_platform["Platform Media"]
  node_v4l2["V4L2 Sink<br/>[avx_v4l2_sink.c]"]
  node_pipewire["PipeWire Sink"]
  node_dshow["DirectShow Sink<br/>[avx_dshow_sink.c]"]
  node_dal["CoreMediaIO DAL Sink<br/>[avx_dal_sink.c]"]
end

node_operator(("Operator or SDK"))
node_lan(("LAN Streams"))
node_browser(("Browser or Player"))
node_camera_app(("Camera Applications"))

node_operator -->|"runs commands"| node_cli
node_operator -->|"supplies media"| node_api
node_cli -->|"selects pattern"| node_pattern
node_pattern -.->|"sends frames"| node_api
node_api -->|"dispatches transmit"| node_sender
node_api -->|"polls receive"| node_receiver
node_sender -.->|"frames packets"| node_wire
node_sender -.->|"sends RUDP"| node_udp
node_udp -.->|"protects packets"| node_fec
node_udp -.->|"encrypts traffic"| node_crypto
node_receiver -.->|"parses packets"| node_wire
node_receiver -.->|"synchronizes frames"| node_sync_rate
node_audio -.->|"converts audio"| node_audio_codec
node_video_codec -.->|"supports compression"| node_speedhq
node_receiver -->|"provides frames"| node_monitor
node_receiver -->|"provides stream"| node_virtcam
node_virtcam -.->|"writes video"| node_v4l2
node_virtcam -.->|"writes video"| node_pipewire
node_virtcam -.->|"feeds driver"| node_dshow
node_virtcam -.->|"feeds driver"| node_dal
node_camera_app -->|"consumes camera"| node_virtcam
node_receiver -->|"provides stream"| node_gateway
node_gateway -.->|"serves fMP4"| node_web
node_gateway -.->|"serves RTSP"| node_rtsp
node_browser -->|"plays stream"| node_web
node_browser -->|"requests stream"| node_rtsp
node_cli -->|"selects route"| node_router_cli
node_router_cli -->|"resolves sources"| node_discovery
node_router_cli -->|"sets route"| node_routing
node_routing -->|"receives upstream"| node_receiver
node_routing -->|"forwards frames"| node_sender
node_cli -->|"sets tally"| node_tally
node_cli -->|"controls cameras"| node_onvif
node_discovery -->|"discovers transmitters"| node_lan
node_directory -->|"lists streams"| node_lan

click node_cli "https://github.com/saifmukhtar/openavx/blob/main/tools/openavx_main.c"
click node_pattern "https://github.com/saifmukhtar/openavx/blob/main/tools/openavx_test_pattern.c"
click node_api "https://github.com/saifmukhtar/openavx/blob/main/src/oavx_pipeline.c"
click node_sender "https://github.com/saifmukhtar/openavx/blob/main/src/avx_send.c"
click node_receiver "https://github.com/saifmukhtar/openavx/blob/main/src/avx_recv.c"
click node_audio "https://github.com/saifmukhtar/openavx/blob/main/src/avx_audio.c"
click node_audio_codec "https://github.com/saifmukhtar/openavx/blob/main/src/avx_audio_codec.c"
click node_video_codec "https://github.com/saifmukhtar/openavx/blob/main/src/avx_video_codec.c"
click node_speedhq "https://github.com/saifmukhtar/openavx/blob/main/src/avx_speedhq.c"
click node_sync_rate "https://github.com/saifmukhtar/openavx/blob/main/src/avx_framesync.c"
click node_wire "https://github.com/saifmukhtar/openavx/blob/main/src/avx_wire.c"
click node_udp "https://github.com/saifmukhtar/openavx/blob/main/src/avx_udp.c"
click node_fec "https://github.com/saifmukhtar/openavx/blob/main/src/avx_fec.c"
click node_crypto "https://github.com/saifmukhtar/openavx/blob/main/src/avx_crypto.c"
click node_discovery "https://github.com/saifmukhtar/openavx/blob/main/src/avx_find.c"
click node_directory "https://github.com/saifmukhtar/openavx/blob/main/src/avx_discovery_server.c"
click node_monitor "https://github.com/saifmukhtar/openavx/blob/main/tools/openavx_monitor.c"
click node_virtcam "https://github.com/saifmukhtar/openavx/blob/main/tools/openavx_virtcam.c"
click node_v4l2 "https://github.com/saifmukhtar/openavx/blob/main/src/avx_v4l2_sink.c"
click node_pipewire "https://github.com/saifmukhtar/openavx/blob/main/src/avx_pipewire_sink.c"
click node_dshow "https://github.com/saifmukhtar/openavx/blob/main/src/avx_dshow_sink.c"
click node_dal "https://github.com/saifmukhtar/openavx/blob/main/src/avx_dal_sink.c"
click node_gateway "https://github.com/saifmukhtar/openavx/blob/main/tools/openavx_gateway.c"
click node_web "https://github.com/saifmukhtar/openavx/blob/main/src/avx_web.c"
click node_rtsp "https://github.com/saifmukhtar/openavx/blob/main/src/avx_rtsp.c"
click node_router_cli "https://github.com/saifmukhtar/openavx/blob/main/tools/openavx_router.c"
click node_routing "https://github.com/saifmukhtar/openavx/blob/main/src/avx_routing.c"
click node_tally "https://github.com/saifmukhtar/openavx/blob/main/tools/openavx_tally.c"
click node_onvif "https://github.com/saifmukhtar/openavx/blob/main/tools/openavx_onvif.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_api,node_sender,node_receiver,node_audio,node_audio_codec,node_video_codec,node_speedhq,node_sync_rate,node_browser toneBlue
class node_wire,node_udp,node_fec,node_crypto,node_discovery,node_directory toneAmber
class node_cli,node_pattern,node_router_cli,node_routing,node_tally,node_onvif toneMint
class node_monitor,node_virtcam,node_gateway,node_web,node_rtsp toneRose
class node_v4l2,node_pipewire,node_dshow,node_dal,node_operator,node_lan,node_camera_app toneIndigo
```

## Components

### Media Pipeline

- [Public Stream API](https://github.com/saifmukhtar/openavx/blob/main/src/oavx_pipeline.c): `src/oavx_pipeline.c`
- [Stream Sender](https://github.com/saifmukhtar/openavx/blob/main/src/avx_send.c): `src/avx_send.c`
- [Stream Receiver](https://github.com/saifmukhtar/openavx/blob/main/src/avx_recv.c): `src/avx_recv.c`
- [Audio Engine](https://github.com/saifmukhtar/openavx/blob/main/src/avx_audio.c): `src/avx_audio.c`
- [Audio Codec](https://github.com/saifmukhtar/openavx/blob/main/src/avx_audio_codec.c): `src/avx_audio_codec.c`
- [Video Codec](https://github.com/saifmukhtar/openavx/blob/main/src/avx_video_codec.c): `src/avx_video_codec.c`
- [SpeedHQ Codec](https://github.com/saifmukhtar/openavx/blob/main/src/avx_speedhq.c): `src/avx_speedhq.c`
- [Sync and Rate Control](https://github.com/saifmukhtar/openavx/blob/main/src/avx_framesync.c): `src/avx_framesync.c`

### Transport and Discovery

- [Wire Framing](https://github.com/saifmukhtar/openavx/blob/main/src/avx_wire.c): `src/avx_wire.c`
- [UDP and RUDP](https://github.com/saifmukhtar/openavx/blob/main/src/avx_udp.c): `src/avx_udp.c`
- [FEC Protection](https://github.com/saifmukhtar/openavx/blob/main/src/avx_fec.c): `src/avx_fec.c`
- [Encryption](https://github.com/saifmukhtar/openavx/blob/main/src/avx_crypto.c): `src/avx_crypto.c`
- [Stream Discovery](https://github.com/saifmukhtar/openavx/blob/main/src/avx_find.c): `src/avx_find.c`
- [Directory Server](https://github.com/saifmukhtar/openavx/blob/main/src/avx_discovery_server.c): `src/avx_discovery_server.c`

### Production Tools

- [CLI Dispatcher](https://github.com/saifmukhtar/openavx/blob/main/tools/openavx_main.c): `tools/openavx_main.c`
- [Pattern Generator](https://github.com/saifmukhtar/openavx/blob/main/tools/openavx_test_pattern.c): `tools/openavx_test_pattern.c`
- [Router CLI](https://github.com/saifmukhtar/openavx/blob/main/tools/openavx_router.c): `tools/openavx_router.c`
- [Matrix Router](https://github.com/saifmukhtar/openavx/blob/main/src/avx_routing.c): `src/avx_routing.c`
- [Tally Control](https://github.com/saifmukhtar/openavx/blob/main/tools/openavx_tally.c): `tools/openavx_tally.c`
- [ONVIF and PTZ](https://github.com/saifmukhtar/openavx/blob/main/tools/openavx_onvif.c): `tools/openavx_onvif.c`

### Playback and Outputs

- [Terminal Monitor](https://github.com/saifmukhtar/openavx/blob/main/tools/openavx_monitor.c): `tools/openavx_monitor.c`
- [Virtual Camera CLI](https://github.com/saifmukhtar/openavx/blob/main/tools/openavx_virtcam.c): `tools/openavx_virtcam.c`
- [HTTP and RTSP Gateway](https://github.com/saifmukhtar/openavx/blob/main/tools/openavx_gateway.c): `tools/openavx_gateway.c`
- [Web and fMP4 Server](https://github.com/saifmukhtar/openavx/blob/main/src/avx_web.c): `src/avx_web.c`
- [RTSP Server](https://github.com/saifmukhtar/openavx/blob/main/src/avx_rtsp.c): `src/avx_rtsp.c`

### Platform Media

- [V4L2 Sink](https://github.com/saifmukhtar/openavx/blob/main/src/avx_v4l2_sink.c): `src/avx_v4l2_sink.c`
- [PipeWire Sink](https://github.com/saifmukhtar/openavx/blob/main/src/avx_pipewire_sink.c): `src/avx_pipewire_sink.c`
- [DirectShow Sink](https://github.com/saifmukhtar/openavx/blob/main/src/avx_dshow_sink.c): `src/avx_dshow_sink.c`
- [CoreMediaIO DAL Sink](https://github.com/saifmukhtar/openavx/blob/main/src/avx_dal_sink.c): `src/avx_dal_sink.c`

### Other components

- **Operator or SDK**
- **LAN Streams**
- **Browser or Player**
- **Camera Applications**

## Connections

- Operator or SDK → CLI Dispatcher: runs commands (evidence: `README.md`)
- Operator or SDK → Public Stream API: supplies media (evidence: `README.md`)
- CLI Dispatcher → Pattern Generator: selects pattern (evidence: `README.md`)
- Pattern Generator → Public Stream API: sends frames
- Public Stream API → Stream Sender: dispatches transmit (evidence: `src/oavx_pipeline.c`)
- Public Stream API → Stream Receiver: polls receive (evidence: `src/oavx_pipeline.c`)
- Stream Sender → Wire Framing: frames packets
- Stream Sender → UDP and RUDP: sends RUDP
- UDP and RUDP → FEC Protection: protects packets
- UDP and RUDP → Encryption: encrypts traffic
- Stream Receiver → Wire Framing: parses packets
- Stream Receiver → Sync and Rate Control: synchronizes frames
- Audio Engine → Audio Codec: converts audio
- Video Codec → SpeedHQ Codec: supports compression
- Stream Receiver → Terminal Monitor: provides frames (evidence: `README.md`)
- Stream Receiver → Virtual Camera CLI: provides stream (evidence: `README.md`)
- Virtual Camera CLI → V4L2 Sink: writes video
- Virtual Camera CLI → PipeWire Sink: writes video
- Virtual Camera CLI → DirectShow Sink: feeds driver
- Virtual Camera CLI → CoreMediaIO DAL Sink: feeds driver
- Camera Applications → Virtual Camera CLI: consumes camera (evidence: `README.md`)
- Stream Receiver → HTTP and RTSP Gateway: provides stream (evidence: `README.md`)
- HTTP and RTSP Gateway → Web and fMP4 Server: serves fMP4
- HTTP and RTSP Gateway → RTSP Server: serves RTSP
- Browser or Player → Web and fMP4 Server: plays stream (evidence: `README.md`)
- Browser or Player → RTSP Server: requests stream (evidence: `README.md`)
- CLI Dispatcher → Router CLI: selects route (evidence: `README.md`)
- Router CLI → Stream Discovery: resolves sources (evidence: `tools/openavx_router.c`)
- Router CLI → Matrix Router: sets route (evidence: `tools/openavx_router.c`)
- Matrix Router → Stream Receiver: receives upstream (evidence: `src/avx_routing.c`)
- Matrix Router → Stream Sender: forwards frames (evidence: `src/avx_routing.c`)
- CLI Dispatcher → Tally Control: sets tally (evidence: `README.md`)
- CLI Dispatcher → ONVIF and PTZ: controls cameras (evidence: `README.md`)
- Stream Discovery → LAN Streams: discovers transmitters (evidence: `README.md`)
- Directory Server → LAN Streams: lists streams (evidence: `README.md`)
