Skip to main content

rtsp-rs

Lint Test Release

A Rust library for publishing live encoded video over RTSP. Push frames and play the stream with any standard client (VLC, ffplay, GStreamer).

Usable from Rust, Python, or GStreamer.


⚠️ Please read before using

This is a personal, hobby project I built to learn about RTP, RTSP, and streaming. I’m actively evolving it and use it only for my own projects. I have no plans to use or support it in production right now, though I might rely on it there someday if the need arises — so treat it as use at your own risk.

Some of the tests, examples, and documentation in this repo were generated or assisted by AI tools. Treat them as reference material rather than guarantees of correctness.


Status: Pre-release (v0.x). API may change between versions.

Project structure

crates/
├── core/        # rtsp-rs (crates.io) — core library, use rtsp:: in Rust
├── python/      # rtsp-python  — PyO3 bindings → PyPI package rtsp-rs
└── gst/         # gst-rtsp-sink — GStreamer sink plugin

examples/
└── python/      # Python demo (numpy + PyAV)

Quick start

Rust

Add to Cargo.toml: rtsp = { package = "rtsp-rs", version = "0.1" } (the crate is published as rtsp-rs on crates.io; the library is still rtsp in code).

use rtsp::Server;

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

// Push H.264 Annex B frames — packetization and delivery are handled internally.
// Timestamp increment = 90000 / fps (e.g. 3000 for 30 fps).
// server.send_frame(&h264_data, 3000).unwrap();

Python

pip install maturin
maturin develop -m crates/python/Cargo.toml
import rtsp

server = rtsp.Server("0.0.0.0:8554")
server.start()

# Push encoded H.264 frames directly — no manual packetization needed.
server.send_frame(h264_bytes, 3000)

See examples/python/test.py for a full demo that encodes a test pattern with PyAV.

GStreamer

Build and install the plugin:

cargo build -p gst-rtsp-sink --release

# Point GStreamer at the built library
export GST_PLUGIN_PATH=$PWD/target/release

Stream a test pattern:

gst-launch-1.0 videotestsrc \
  ! video/x-raw,width=640,height=480,framerate=30/1 \
  ! x264enc tune=zerolatency bitrate=2000 key-int-max=30 \
  ! video/x-h264,stream-format=byte-stream \
  ! rtspserversink port=8554

Stream from a webcam (macOS):

gst-launch-1.0 avfvideosrc \
  ! videoconvert \
  ! x264enc tune=zerolatency bitrate=2000 \
  ! video/x-h264,stream-format=byte-stream \
  ! rtspserversink port=8554

Stream from a webcam (Linux):

gst-launch-1.0 v4l2src device=/dev/video0 \
  ! videoconvert \
  ! x264enc tune=zerolatency bitrate=2000 \
  ! video/x-h264,stream-format=byte-stream \
  ! rtspserversink port=8554

Stream from a file:

gst-launch-1.0 filesrc location=video.mp4 \
  ! qtdemux ! h264parse \
  ! video/x-h264,stream-format=byte-stream \
  ! rtspserversink port=8554

Then connect with any RTSP client:

ffplay rtsp://localhost:8554/stream
vlc rtsp://localhost:8554/stream

Building

Requires Rust 1.92+ (latest stable). The GStreamer plugin requires libunwind-dev and libgstreamer1.0-dev (Ubuntu/Debian: sudo apt install libunwind-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev).

cargo build -p rtsp-rs             # Core library
cargo build -p gst-rtsp-sink       # GStreamer plugin
cargo build -p rtsp-python         # Python bindings (needs maturin)
cargo test  --workspace            # All tests
cargo clippy --workspace           # Lint

Metadata

Release files for rtsp-rs 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rtsp-rs 0.1.8
File Size Uploaded Provenance Actions
rtsp_rs-0.1.8.tar.gz 39.4 kB Without provenance Details for rtsp_rs-0.1.8.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for rtsp-rs 0.1.8
File Actions
rtsp_rs-0.1.8-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for rtsp_rs-0.1.8-cp314-cp314-win_amd64.whl
rtsp_rs-0.1.8-cp314-cp314-manylinux_2_34_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.34+ x86-64 Details for rtsp_rs-0.1.8-cp314-cp314-manylinux_2_34_x86_64.whl
rtsp_rs-0.1.8-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details for rtsp_rs-0.1.8-cp314-cp314-macosx_11_0_arm64.whl
rtsp_rs-0.1.8-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for rtsp_rs-0.1.8-cp313-cp313-win_amd64.whl
rtsp_rs-0.1.8-cp313-cp313-manylinux_2_34_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.34+ x86-64 Details for rtsp_rs-0.1.8-cp313-cp313-manylinux_2_34_x86_64.whl
rtsp_rs-0.1.8-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for rtsp_rs-0.1.8-cp313-cp313-macosx_11_0_arm64.whl
rtsp_rs-0.1.8-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for rtsp_rs-0.1.8-cp312-cp312-win_amd64.whl
rtsp_rs-0.1.8-cp312-cp312-manylinux_2_34_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.34+ x86-64 Details for rtsp_rs-0.1.8-cp312-cp312-manylinux_2_34_x86_64.whl
rtsp_rs-0.1.8-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for rtsp_rs-0.1.8-cp312-cp312-macosx_11_0_arm64.whl
rtsp_rs-0.1.8-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for rtsp_rs-0.1.8-cp311-cp311-win_amd64.whl
rtsp_rs-0.1.8-cp311-cp311-manylinux_2_34_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.34+ x86-64 Details for rtsp_rs-0.1.8-cp311-cp311-manylinux_2_34_x86_64.whl
rtsp_rs-0.1.8-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for rtsp_rs-0.1.8-cp311-cp311-macosx_11_0_arm64.whl
rtsp_rs-0.1.8-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for rtsp_rs-0.1.8-cp310-cp310-win_amd64.whl
rtsp_rs-0.1.8-cp310-cp310-manylinux_2_34_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.34+ x86-64 Details for rtsp_rs-0.1.8-cp310-cp310-manylinux_2_34_x86_64.whl
rtsp_rs-0.1.8-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details for rtsp_rs-0.1.8-cp310-cp310-macosx_11_0_arm64.whl

Total release size: 5.0 MB

Release files / rtsp_rs-0.1.8.tar.gz

Download URL rtsp_rs-0.1.8.tar.gz
Size 39.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b4d8d21f7c01827fbf8209130713b41d027bdbc7ba96edb4bc597df2b41c920d
BLAKE2b-256 checksum
How to use checksums
44cf77ba46c59897c8f46e1bf877c0e4b857ec1a4f4bb86f198f2bb297f72a66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / rtsp_rs-0.1.8-cp314-cp314-win_amd64.whl

Download URL rtsp_rs-0.1.8-cp314-cp314-win_amd64.whl
Size 230.5 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
530ed64043951a23f74610d892a0ddd49482fc41d823b4f911eceee285825e63
BLAKE2b-256 checksum
How to use checksums
a135fa4de52703940e60d1abcba4ebafd9c424a3c9ceb8bc47aded2c6ed6c78f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / rtsp_rs-0.1.8-cp314-cp314-manylinux_2_34_x86_64.whl

Download URL rtsp_rs-0.1.8-cp314-cp314-manylinux_2_34_x86_64.whl
Size 402.4 kB
Tags CPython 3.14 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
a99ed46a57ef6aa21669063f06a986cfdf966079f832867d3e04f658f4a3e793
BLAKE2b-256 checksum
How to use checksums
35d8146299a970976abde7271c864171beaef9cac9e523589e709450cd8d540f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / rtsp_rs-0.1.8-cp314-cp314-macosx_11_0_arm64.whl

Download URL rtsp_rs-0.1.8-cp314-cp314-macosx_11_0_arm64.whl
Size 352.7 kB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3e097144e374b6833a47a404aa58c63ab910a9c5d98fd01692f368a585560342
BLAKE2b-256 checksum
How to use checksums
fb557cda03b9df388d65c3721aa4ac8b37b09e9e80a7cd1c667dbfdc4cd6d588
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / rtsp_rs-0.1.8-cp313-cp313-win_amd64.whl

Download URL rtsp_rs-0.1.8-cp313-cp313-win_amd64.whl
Size 230.9 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
b46205ec7699b666d3a351e9f262832fa3069c3386b5dcc009792a3bf0409f42
BLAKE2b-256 checksum
How to use checksums
de9fd0e218f3ce22aeb26374aa5a5ce79a1c2b574eb139259f6f172bb8c108d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / rtsp_rs-0.1.8-cp313-cp313-manylinux_2_34_x86_64.whl

Download URL rtsp_rs-0.1.8-cp313-cp313-manylinux_2_34_x86_64.whl
Size 403.0 kB
Tags CPython 3.13 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
7b0e7784097a35737020c81ac191735a49cebf4f7f4aae1377a7df674b56a529
BLAKE2b-256 checksum
How to use checksums
db997b2c8384c8f2806cbc191515bcc3221ea5bee7b56ba87dcafed566c9e3c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / rtsp_rs-0.1.8-cp313-cp313-macosx_11_0_arm64.whl

Download URL rtsp_rs-0.1.8-cp313-cp313-macosx_11_0_arm64.whl
Size 352.5 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
8e0ad8de8a742c961aebd32547c3cf9e4383af281d7276234e7fb4a8b40c4045
BLAKE2b-256 checksum
How to use checksums
000b6b5bdab5733e488639fdfe0521762591a8d5fd85304de1012719bd7113e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / rtsp_rs-0.1.8-cp312-cp312-win_amd64.whl

Download URL rtsp_rs-0.1.8-cp312-cp312-win_amd64.whl
Size 230.8 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
6ee8a4d550bb5ed816ef4a281c5b0036687efe5abe67baf49506f60766364001
BLAKE2b-256 checksum
How to use checksums
6761359a72d5531bd2144983535242e9e3f2727fa674952e611b5c5c7d8e9fd9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / rtsp_rs-0.1.8-cp312-cp312-manylinux_2_34_x86_64.whl

Download URL rtsp_rs-0.1.8-cp312-cp312-manylinux_2_34_x86_64.whl
Size 402.2 kB
Tags CPython 3.12 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
18f2b2fcd7758530568c9650b20640c07fd89fbf4fce457d9b5a142168749144
BLAKE2b-256 checksum
How to use checksums
ad1d988764c7bba3158b86a0a5d46f8c173d4a7b3c95c92fc5f3d3ebbc1f316d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / rtsp_rs-0.1.8-cp312-cp312-macosx_11_0_arm64.whl

Download URL rtsp_rs-0.1.8-cp312-cp312-macosx_11_0_arm64.whl
Size 352.4 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
bfecfd7e38fe48bd3b0c2cd6da01531efe2de8d45f050ac5de7433f7e9cfaf8b
BLAKE2b-256 checksum
How to use checksums
f50e0a1171deecea3adceaf84a1f312bc16cbd2d8eadc4a2c450e7d8640c0a7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / rtsp_rs-0.1.8-cp311-cp311-win_amd64.whl

Download URL rtsp_rs-0.1.8-cp311-cp311-win_amd64.whl
Size 232.8 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
b5eee27da8f3806d57deab84e28ed79f23bb23bb2e46f280ebc942d76a5abb91
BLAKE2b-256 checksum
How to use checksums
5948e1acf18998abfdaed020742c7dc5f78bd9b4bbc31d52ca5663d4dd971d97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / rtsp_rs-0.1.8-cp311-cp311-manylinux_2_34_x86_64.whl

Download URL rtsp_rs-0.1.8-cp311-cp311-manylinux_2_34_x86_64.whl
Size 406.2 kB
Tags CPython 3.11 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
5c95ca59ba50b91d1b0906d8eac12776bf091391cb79603f0eb7b4d29697d9c6
BLAKE2b-256 checksum
How to use checksums
54a8aa12ff757676c457d063141dc3851f0a75c928675ec951a4ebb1175aa513
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / rtsp_rs-0.1.8-cp311-cp311-macosx_11_0_arm64.whl

Download URL rtsp_rs-0.1.8-cp311-cp311-macosx_11_0_arm64.whl
Size 354.5 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2a0234a1d87bbbde623237092f4cc2234c7fcb78ceb9254d0f53fae051c21580
BLAKE2b-256 checksum
How to use checksums
7b15157549963cf749a294aec84c0add9c242e5fbdc8f8b31f77d7e4dab70dc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / rtsp_rs-0.1.8-cp310-cp310-win_amd64.whl

Download URL rtsp_rs-0.1.8-cp310-cp310-win_amd64.whl
Size 232.9 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
95bacd4366fefbab22e0eeb80a1a35a6dba044de4be31a3c39d506e01397c796
BLAKE2b-256 checksum
How to use checksums
242935c3538c25ea901f3e50fc861a7d71202aae11f20e7c1320b1cb310cf83f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / rtsp_rs-0.1.8-cp310-cp310-manylinux_2_34_x86_64.whl

Download URL rtsp_rs-0.1.8-cp310-cp310-manylinux_2_34_x86_64.whl
Size 406.4 kB
Tags CPython 3.10 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
f6b6fa4237ba27cbf5958d63d7a2de77d50995390c5eaeb30cfe055a810cb75e
BLAKE2b-256 checksum
How to use checksums
c58a2db52f5bdf7e09ae094a1e85ad64679a443e8cb700f904eaf8c3e38d2904
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / rtsp_rs-0.1.8-cp310-cp310-macosx_11_0_arm64.whl

Download URL rtsp_rs-0.1.8-cp310-cp310-macosx_11_0_arm64.whl
Size 354.9 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
937d34740ae2ef40f8d47c8ce277a016d5bd02687876eecbced01b4650c2f0be
BLAKE2b-256 checksum
How to use checksums
82ad266287430ea5960b8cef411f7c89e5c288a4ebd16fba3382feef45bae8fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Security for rtsp-rs 0.1.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page