rtsp-curl
Python RTSP client built on libcurl via pycurl. Supports OPTIONS / DESCRIBE / SETUP / PLAY / TEARDOWN over UDP (default) or TCP.
Requirements
- Python 3.9+
- libcurl with RTSP support (
curl --version | grep rtsp) pycurl >= 7.45.0
Installation
pip install rtsp-curl-mad
macOS (custom OpenSSL required by pycurl):
PYCURL_SSL_LIBRARY=openssl \
LDFLAGS="-L/usr/local/opt/openssl/lib" \
CPPFLAGS="-I/usr/local/opt/openssl/include" \
pip install --no-cache-dir pycurl
pip install rtsp-curl-mad
Quick start
import time
from madyel import RtspCurl
URL = "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov"
client = RtspCurl()
client.init(URL, "user:password")
client.rtsp_options()
client.auth()
client.rtsp_describe()
control = client.get_media_control_attribute()
client.rtsp_setup(control)
client.rtsp_play(URL)
time.sleep(10) # stream for 10 seconds
client.rtsp_teardown()
client.rtsp_curl_close()
API reference
RtspCurl(*, debug=False, tcp=False)
| Parameter | Type | Default | Description |
|---|---|---|---|
debug |
bool | False |
Enable verbose curl logging |
tcp |
bool | False |
Use TCP transport instead of UDP |
Methods
| Method | Description |
|---|---|
init(url, user_pwd) |
Initialise the curl handle. Must be called first. user_pwd format: "user:password" |
rtsp_options() |
Send RTSP OPTIONS |
auth() |
Perform DIGEST authentication |
rtsp_describe() |
Send RTSP DESCRIBE and save the SDP response to disk |
get_media_control_attribute() |
Parse the SDP and return the first media-level a=control value |
rtsp_setup(control) |
Send RTSP SETUP for the given track control URI |
rtsp_play(url) |
Send RTSP PLAY |
rtsp_teardown() |
Send RTSP TEARDOWN |
rtsp_curl_close() |
Close the underlying curl handle |
Storage
Helper that accumulates pycurl callback data line by line.
from madyel import Storage
buf = Storage()
# pass buf.store as pycurl WRITEFUNCTION / HEADERFUNCTION
print(buf) # all accumulated lines
Options
Debug mode — enables pycurl.VERBOSE (full headers and timing on stderr):
client = RtspCurl(debug=True)
TCP transport — by default the client negotiates RTP over UDP:
client = RtspCurl(tcp=True)
Publishing a new release
Tag the commit — GitHub Actions builds and uploads to PyPI automatically:
git tag v0.9.1
git push origin v0.9.1
One-time setup: configure the PyPI Trusted Publisher at https://pypi.org/manage/project/rtsp-curl-mad/settings/publishing/
License
Metadata
Release files for rtsp-curl-mad 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rtsp_curl_mad-0.9.0.tar.gz | 7.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rtsp_curl_mad-0.9.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.0 kB
Release files / rtsp_curl_mad-0.9.0.tar.gz
| Download URL | rtsp_curl_mad-0.9.0.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d67804af22a19f326106f2a787d1715ace09d6f4f8633bd7aabb9dd0f8859bc9
|
|
BLAKE2b-256 checksum How to use checksums |
22996fd2d1a828009f88e6a59b82d87a30dd005b91ad4f72b0af76e49de342ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 22, 2026.
Transparency logRelease files / rtsp_curl_mad-0.9.0-py3-none-any.whl
| Download URL | rtsp_curl_mad-0.9.0-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
572dcea278ea14d9a6737dc4f6c84b13d95246aca6cf66b4b127f9f8f8f171f4
|
|
BLAKE2b-256 checksum How to use checksums |
f753b1a6bb82c34b3e8d79954b179b7bd6434aefe134d42476deed885f96e8db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 22, 2026.
Transparency log