Expand description
Professional video-over-IP protocol for OxiMedia.
This crate provides a patent-free alternative to NDI (Network Device Interface) for professional video streaming over IP networks. It implements:
- Low-latency video/audio transport over UDP with FEC (Forward Error Correction)
- mDNS/DNS-SD service discovery for automatic source detection
- Multiple video codecs: VP9, AV1 (compressed), v210, UYVY (uncompressed)
- Multiple audio formats: Opus (compressed), PCM (uncompressed)
- Professional features: Tally lights, PTZ control, timecode, metadata
- Network resilience: FEC, jitter buffering, packet loss recovery
- Multi-stream support: Program, preview, alpha channels
§Protocol Design
The protocol is designed for professional broadcast environments with:
- Target latency < 16ms at 60fps (less than 1 frame)
- Support for SD, HD, and UHD resolutions
- Frame rates: 23.976, 24, 25, 29.97, 30, 50, 59.94, 60 fps
- Up to 16 audio channels at 48kHz or 96kHz
§Architecture
┌─────────────┐ ┌─────────────┐
│ VideoIP │ ─── UDP + FEC ────> │ VideoIP │
│ Source │ <── Control Msgs ── │ Receiver │
└─────────────┘ └─────────────┘
│ │
└──── mDNS Announcement │
│
mDNS Discovery ─┘§Example
§Broadcasting a Video Stream
ⓘ
use oximedia_videoip::{VideoIpSource, VideoConfig, AudioConfig};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let video_config = VideoConfig::new(1920, 1080, 60.0)?;
let audio_config = AudioConfig::new(48000, 2)?;
let mut source = VideoIpSource::new("Camera 1", video_config, audio_config)?;
source.start_broadcasting().await?;
// Send frames...
let video_frame = get_video_frame();
let audio_samples = get_audio_samples();
source.send_frame(video_frame, audio_samples).await?;
Ok(())
}§Receiving a Video Stream
ⓘ
use oximedia_videoip::VideoIpReceiver;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut receiver = VideoIpReceiver::discover("Camera 1").await?;
receiver.start_receiving().await?;
loop {
let (video_frame, audio_samples) = receiver.receive_frame().await?;
// Process frame...
}
}Re-exports§
pub use error::VideoIpError;pub use error::VideoIpResult;pub use receiver::VideoIpReceiver;pub use source::VideoIpSource;pub use types::AudioConfig;pub use types::AudioFormat;pub use types::VideoConfig;pub use types::VideoFormat;
Modules§
- adaptive_
jitter_ buffer - Adaptive jitter buffer for RTP media streams.
- bandwidth_
est - Bandwidth estimation for video-over-IP streams.
- bandwidth_
shaping - Traffic shaping and QoS prioritisation per stream.
- bbr
- BBR (Bottleneck Bandwidth and Round-trip propagation time) congestion control.
- bbr_
congestion - BBR Congestion Control — Pacing Gain Cycles and Bandwidth Probing.
- bonding
- Network interface bonding and aggregation for video-over-IP streams.
- codec
- Video and audio codec wrapper for encoding/decoding.
- color_
space_ conv - Network-oriented color space conversion for video transport.
- color_
space_ simd - SIMD-accelerated color space conversions for video transport hot paths.
- congestion
- Network congestion control for video-over-IP streams.
- diagnostic_
overlay - Diagnostic overlay: burns network statistics onto video frames.
- discovery
- mDNS-based service discovery for video sources.
- dtls_
srtp - DTLS-SRTP key extraction and RTP packet protection.
- encryption
- Video-over-IP encryption support.
- error
- Error types for video-over-IP protocol.
- fec
- Forward Error Correction (FEC) using Reed-Solomon codes.
- flow_
monitor - IP video flow monitoring (SMPTE ST 2110).
- flow_
stats - Flow statistics tracking for
VideoIPstreams. - frame_
pacing - Frame pacing and timing control for video-over-IP streams.
- gf_simd
- SIMD-accelerated Galois Field GF(2^8) arithmetic.
- jitter
- Jitter buffer for packet reordering and delay compensation.
- metadata
- Metadata support (timecode, ancillary data, closed captions).
- multicast
- IP multicast management for professional video transport.
- multicast_
group - Multicast group management for
VideoIPstreams. - multiview
- Multi-view compositor: combines multiple receiver streams into a mosaic.
- ndi_
bridge - NDI to ST 2110 bridging.
- network_
sim - Network simulation for testing congestion control, FEC recovery, and jitter buffer behaviour under realistic network conditions.
- nmos
- NMOS IS-04 / IS-05 concepts for node registry, device model, and connection management.
- packet
- Packet format and serialization for video-over-IP protocol.
- packet_
loss - Packet loss detection, tracking, and recovery metrics.
- precise_
timer - Precise timer for frame pacing and media clock scheduling.
- ptp
- Full PTP (IEEE 1588-2019) clock synchronization.
- ptp_
boundary - PTP (IEEE 1588) boundary clock implementation.
- ptp_
clock - IEEE 1588 PTP Clock Model — Announce, Sync, and Follow-Up Messages.
- ptz
- PTZ (Pan-Tilt-Zoom) control protocol for camera control.
- quic_
transport - QUIC-based media transport layer.
- receiver
- Video-over-IP receiver for receiving video/audio streams.
- redundancy
- IP video redundancy management (SMPTE 2022-7 / ST 2022-7).
- rist
- RIST (Reliable Internet Stream Transport) protocol support.
- rtcp_
sender_ report - RTCP Sender Report and Receiver Report packet parsing and building.
- rtp_
2110 - SMPTE ST 2110-20 RTP packetizer.
- rtp_
jitter_ buffer - RTP jitter buffer with packet reordering, configurable depth, late-packet handling, and playout-timestamp tracking.
- rtsp_
server - RTSP/RTP source serving for compatibility with standard media players.
- scatter_
gather_ io - Scatter/gather I/O for high-throughput UDP media transport.
- sdp
- SDP (Session Description Protocol) generation for video-over-IP streams.
- sdp_gen
- ST 2110-compatible SDP (Session Description Protocol) builder.
- sdp_
negotiation - SDP (Session Description Protocol) offer/answer negotiation for ST 2110 streams.
- sfp_
monitor - SFP+ transceiver monitoring for broadcast video-over-IP infrastructure.
- smpte2110
- SMPTE ST 2110 media-over-IP support.
- source
- Video-over-IP source for broadcasting video/audio streams.
- spsc_
ring - Lock-free single-producer single-consumer (SPSC) ring buffer.
- srt_
config - SRT (Secure Reliable Transport) configuration for video-over-IP.
- srt_
handshake - SRT (Secure Reliable Transport) handshake protocol implementation.
- srt_
transport - SRT (Secure Reliable Transport) transport module.
- st2110_
20 - SMPTE ST 2110-20 uncompressed video transport over RTP/UDP.
- st2110_
metadata - SMPTE ST 2110 stream metadata — parameter sets for ST 2110-20 (video), ST 2110-30 (audio) and ST 2110-40 (ancillary data) streams.
- stats
- Network statistics and monitoring.
- stream_
descriptor - Stream descriptor types for
VideoIP. - stream_
health - Stream health monitoring for video-over-IP connections.
- stream_
recorder - Stream recording and playback for diagnostics.
- stream_
recording_ mux - Stream recording multiplexer: records incoming VideoIP streams to containers.
- stream_
relay - Stream relay: re-broadcasts received streams to multiple downstream receivers.
- stream_
sync - Stream synchronization utilities for multi-essence ST 2110 streams.
- tally
- Tally light protocol for camera status indication.
- transport
- UDP transport layer with socket tuning for low latency.
- types
- Core types for video-over-IP protocol.
- udp_
scatter_ gather - Scatter/gather UDP I/O using
sendmmsg/recvmmsgon Linux. - utils
- Utility modules for video-over-IP protocol.
- videoip_
ext - VideoIP protocol extensions: RIST transport primitives, simple congestion controller, frame pacer, NDI bridge passthrough, SDP generator, SMPTE 2110 timing validator, simplified stream health monitor, stream bonding, color-space conversion (UYVY→RGBA), and AES-CTR encryption stub.
- whip_
whep - WHIP/WHEP protocol support for WebRTC-based media ingest and egress.
- zero_
copy_ packet - Zero-copy packet path using
bytes::Bytes.