Skip to main content

oximedia_videoip/
lib.rs

1//! Professional video-over-IP protocol for `OxiMedia`.
2//!
3//! This crate provides a patent-free alternative to NDI (Network Device Interface)
4//! for professional video streaming over IP networks. It implements:
5//!
6//! - **Low-latency video/audio transport** over UDP with FEC (Forward Error Correction)
7//! - **mDNS/DNS-SD service discovery** for automatic source detection
8//! - **Multiple video codecs**: VP9, AV1 (compressed), v210, UYVY (uncompressed)
9//! - **Multiple audio formats**: Opus (compressed), PCM (uncompressed)
10//! - **Professional features**: Tally lights, PTZ control, timecode, metadata
11//! - **Network resilience**: FEC, jitter buffering, packet loss recovery
12//! - **Multi-stream support**: Program, preview, alpha channels
13//!
14//! # Protocol Design
15//!
16//! The protocol is designed for professional broadcast environments with:
17//! - Target latency < 16ms at 60fps (less than 1 frame)
18//! - Support for SD, HD, and UHD resolutions
19//! - Frame rates: 23.976, 24, 25, 29.97, 30, 50, 59.94, 60 fps
20//! - Up to 16 audio channels at 48kHz or 96kHz
21//!
22//! # Architecture
23//!
24//! ```text
25//! ┌─────────────┐                           ┌─────────────┐
26//! │  VideoIP    │  ─── UDP + FEC ────>      │  VideoIP    │
27//! │  Source     │  <── Control Msgs ──      │  Receiver   │
28//! └─────────────┘                           └─────────────┘
29//!       │                                          │
30//!       └──── mDNS Announcement                   │
31//!                                                  │
32//!                                  mDNS Discovery ─┘
33//! ```
34//!
35//! # Example
36//!
37//! ## Broadcasting a Video Stream
38//!
39//! ```ignore
40//! use oximedia_videoip::{VideoIpSource, VideoConfig, AudioConfig};
41//!
42//! #[tokio::main]
43//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
44//!     let video_config = VideoConfig::new(1920, 1080, 60.0)?;
45//!     let audio_config = AudioConfig::new(48000, 2)?;
46//!
47//!     let mut source = VideoIpSource::new("Camera 1", video_config, audio_config)?;
48//!     source.start_broadcasting().await?;
49//!
50//!     // Send frames...
51//!     let video_frame = get_video_frame();
52//!     let audio_samples = get_audio_samples();
53//!     source.send_frame(video_frame, audio_samples).await?;
54//!
55//!     Ok(())
56//! }
57//! ```
58//!
59//! ## Receiving a Video Stream
60//!
61//! ```ignore
62//! use oximedia_videoip::VideoIpReceiver;
63//!
64//! #[tokio::main]
65//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
66//!     let mut receiver = VideoIpReceiver::discover("Camera 1").await?;
67//!     receiver.start_receiving().await?;
68//!
69//!     loop {
70//!         let (video_frame, audio_samples) = receiver.receive_frame().await?;
71//!         // Process frame...
72//!     }
73//! }
74//! ```
75
76#![warn(missing_docs)]
77#![allow(clippy::module_name_repetitions)]
78#![allow(clippy::too_many_arguments)]
79
80pub mod adaptive_jitter_buffer;
81pub mod bandwidth_est;
82pub mod bandwidth_shaping;
83pub mod bbr;
84pub mod bbr_congestion;
85pub mod bonding;
86pub mod codec;
87pub mod color_space_conv;
88pub mod color_space_simd;
89pub mod congestion;
90pub mod diagnostic_overlay;
91pub mod discovery;
92pub mod dtls_srtp;
93pub mod encryption;
94pub mod error;
95pub mod fec;
96pub mod flow_monitor;
97pub mod flow_stats;
98pub mod frame_pacing;
99pub mod gf_simd;
100pub mod jitter;
101pub mod metadata;
102pub mod multicast;
103pub mod multicast_group;
104pub mod multiview;
105pub mod ndi_bridge;
106pub mod network_sim;
107pub mod nmos;
108pub mod packet;
109pub mod packet_loss;
110pub mod precise_timer;
111pub mod ptp;
112pub mod ptp_boundary;
113pub mod ptp_clock;
114pub mod ptz;
115pub mod quic_transport;
116/// Real QUIC transport backed by `quinn` (enabled by the `quic-quinn` feature).
117#[cfg(feature = "quic-quinn")]
118pub mod quic_transport_quinn;
119pub mod receiver;
120pub mod redundancy;
121pub mod rist;
122pub mod rtcp_sender_report;
123pub mod rtp_2110;
124pub mod rtp_jitter_buffer;
125pub mod rtsp_server;
126pub mod scatter_gather_io;
127pub mod sdp;
128pub mod sdp_gen;
129pub mod sdp_negotiation;
130pub mod sfp_monitor;
131pub mod smpte2110;
132pub mod source;
133pub mod spsc_ring;
134pub mod srt_config;
135pub mod srt_handshake;
136pub mod srt_transport;
137pub mod st2110_20;
138pub mod st2110_metadata;
139pub mod stats;
140pub mod stream_descriptor;
141pub mod stream_health;
142pub mod stream_recorder;
143pub mod stream_recording_mux;
144pub mod stream_relay;
145pub mod stream_sync;
146pub mod tally;
147pub mod transport;
148pub mod types;
149pub mod udp_scatter_gather;
150pub mod utils;
151pub mod videoip_ext;
152pub mod whip_whep;
153pub mod zero_copy_packet;
154
155// Re-export main types
156pub use error::{VideoIpError, VideoIpResult};
157pub use receiver::VideoIpReceiver;
158pub use source::VideoIpSource;
159pub use types::{AudioConfig, AudioFormat, VideoConfig, VideoFormat};