Skip to main content

Crate oximedia_videoip

Crate oximedia_videoip 

Source
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 VideoIP streams.
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 VideoIP streams.
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/recvmmsg on 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.