Skip to main content

Crate rtsp

Crate rtsp 

Source
Expand description

§rtsp — RTSP server library for live media streaming

A Rust library for publishing live media streams (H.264, with H.265 and MJPEG planned) over the Real-Time Streaming Protocol (RTSP).

§Protocol references

RFCTopicHow this crate uses it
RFC 2326RTSP 1.0Request/response parsing, session lifecycle, transport negotiation
RFC 3550RTPPacket header format, SSRC generation, sequence/timestamp semantics
RFC 4566SDPSession description generation for DESCRIBE responses
RFC 6184H.264 RTP payloadNAL unit packetization, FU-A fragmentation, SDP fmtp attributes

§Architecture

┌──────────────────────────────────────────┐
│  Adapters (Python / GStreamer / CLI)      │
├──────────────────────────────────────────┤
│  Server        — public API, orchestrator│
│  MountRegistry — named stream endpoints  │
├──────────────────────────────────────────┤
│  Protocol      — RTSP parsing, SDP, etc. │
│  Session       — state machine, transport│
├──────────────────────────────────────────┤
│  Transport     — TCP signaling, UDP data │
│  Media         — RTP header, packetizers │
└──────────────────────────────────────────┘

§Quick start

use rtsp::Server;

let mut server = Server::new("0.0.0.0:8554");
server.start().unwrap();

// Push H.264 Annex B frames — the server packetizes and delivers via RTP.
// server.send_frame(&h264_data, 3000).unwrap();

§Crate layout

Re-exports§

pub use error::Result;
pub use error::RtspError;
pub use media::Packetizer;
pub use mount::DEFAULT_MOUNT_PATH;
pub use mount::Mount;
pub use mount::MountRegistry;
pub use server::Server;
pub use server::ServerConfig;
pub use server::Viewer;

Modules§

error
Error types for the RTSP server library.
media
Media codecs and RTP packetization.
mount
protocol
RTSP protocol implementation (RFC 2326).
server
session
RTSP session management (RFC 2326 §3, §12.37).
transport
Network transport layer for RTSP signaling and RTP media delivery.