rtp
A library for decoding/encoding rtp packets
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 rtpuv
uv add rtppoetry
poetry add rtpInstalling 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
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
pylibsrtppylibsrtp encrypts and decrypts Secure…
permissive · top 5,000 on PyPI
aiortspProvides asyncio-based RTSP client…
copyleft · top 15,000 on PyPI
scapyScapy is a Python library for forging,…
copyleft · top 5,000 on PyPI
rf-protocolsDecodes and encodes radio frequency signals for…
permissive · top 15,000 on PyPI
dpktdpkt parses and creates TCP/IP protocol packets…
permissive · top 5,000 on PyPI
pyradpyrad implements RADIUS client and server…
permissive · top 15,000 on PyPI
icmplibicmplib provides a pure Python implementation…
copyleft · top 5,000 on PyPI
rlpEncodes and decodes data using Recursive Length…
permissive · top 5,000 on PyPI
spacepacketsImplements CCSDS and ECSS packet standards for…
permissive · top 15,000 on PyPI
pydivertPyDivert is a Python binding for the WinDivert…
copyleft · top 15,000 on PyPI