skillfed

rtp

A library for decoding/encoding rtp packets

rtp v0.0.4 360.3K downloads/30d#7,245 on PyPI17
Permissive license apache-2.0 DORMANT released

What it is and what it does

rtp is a Python library for working with RTP packet structures—the standard protocol for real-time media transport. It lets you construct RTP packets from scratch, parse incoming packet bytes, and manipulate fields like sequence numbers, timestamps, and payload type markers. The library handles the packet format itself (headers, extensions, CSRC lists) but deliberately does not provide socket I/O or network transmission; you integrate it with your own networking layer or use it alongside other libraries that handle the media payload decoding.

The package is maintained by BBC R&D and is used in scenarios where you need to build or inspect RTP streams programmatically—for instance, in media server implementations, protocol analysis tools, or custom streaming applications. It has no external runtime dependencies, making it lightweight to add to a project.

Use it for:

  • Build custom RTP packet streams for audio or video transmission in media server applications
  • Parse and inspect RTP packet headers from captured network traffic or test data
  • Implement protocol-level RTP handling in a streaming application that manages its own network I/O
  • Test RTP-based media pipelines by constructing synthetic packets with controlled sequence numbers and timestamps
  • Decode RTP packet structures in network analysis or debugging tools

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Decodes, encodes, and manipulates RTP (Real-time Transport Protocol) packets, without providing network transport itself.

Yes, if you need to work with RTP packet structures in Python and can tolerate dormant maintenance. The library is lightweight, has no dependencies, and the RTP protocol itself is stable. However, no active development has occurred since 2023-12-05, so you should not expect bug fixes or updates. Suitable for stable, self-contained use cases; risky if you need ongoing support.

Install

rtp on PyPI

pip

pip install rtp

uv

uv add rtp

poetry

poetry add rtp

Installing rtp

Before you install

Low friction installation with no runtime dependencies. Maintenance is dormant—last release was 2023-12-05, so expect no active bug fixes or feature updates.

License in practice

Apache 2.0 permissive license allows commercial and private use with minimal restrictions, though contributors must sign a CLA before pull requests are accepted.

Quickstart

from rtp import RTP, Extension, PayloadType

# Decode an RTP packet from bytes
packet_bytes = getNextPacket()  # your source
rtp_obj = RTP().fromBytearray(packet_bytes)
print(rtp_obj.sequenceNumber, rtp_obj.timestamp)

# Encode an RTP packet to bytes
rtp_obj.payload = b'your_media_data'
output_bytes = rtp_obj.toBytearray()

Python version compatibility is unspecified; verify your Python version works with this package before relying on it in production.

Verify before relying

  • Whether the package handles all RTP extensions and payload types defined in relevant RFCs
  • Python version compatibility (requires_python is unspecified in the fact sheet)
  • Whether CSRC list and extension header handling cover real-world streaming scenarios
  • Performance characteristics and suitability for high-throughput packet processing

Package facts

License apache-2.0 (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance dormant — 983 days since the last release
Last repo commit
First released
Downloads 360,272/month — #7,245 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: rtp-0.0.4-py3-none-any.whl

Tags

rtp packet encoding decodingreal-time transport protocol libraryrtp packet manipulationrtp header parsingaudio video streaming packetsrtp payload handling
rtp-protocolmedia-streamingpacket-handling

More Internet packages