Python RTSP client built on libcurl (pycurl)
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rtsp_curl_mad-0.9.0.tar.gz.
File metadata
- Download URL: rtsp_curl_mad-0.9.0.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d67804af22a19f326106f2a787d1715ace09d6f4f8633bd7aabb9dd0f8859bc9
|
|
| MD5 |
b4de0dd8410e2efd7661c5fee0d0bb39
|
|
| BLAKE2b-256 |
22996fd2d1a828009f88e6a59b82d87a30dd005b91ad4f72b0af76e49de342ed
|
Provenance
The following attestation bundles were made for rtsp_curl_mad-0.9.0.tar.gz:
Publisher:
publish.yml on madyel/rtsp-curl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rtsp_curl_mad-0.9.0.tar.gz -
Subject digest:
d67804af22a19f326106f2a787d1715ace09d6f4f8633bd7aabb9dd0f8859bc9 - Sigstore transparency entry: 1155072969
- Sigstore integration time:
-
Permalink:
madyel/rtsp-curl@11f96386d1020048fb043b64aacf76801602bb8a -
Branch / Tag:
refs/tags/v0.9.0 - Owner: https://github.com/madyel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@11f96386d1020048fb043b64aacf76801602bb8a -
Trigger Event:
push
-
Statement type:
File details
Details for the file rtsp_curl_mad-0.9.0-py3-none-any.whl.
File metadata
- Download URL: rtsp_curl_mad-0.9.0-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
572dcea278ea14d9a6737dc4f6c84b13d95246aca6cf66b4b127f9f8f8f171f4
|
|
| MD5 |
fcf49cf2993aa55d0aab641502002d7e
|
|
| BLAKE2b-256 |
f753b1a6bb82c34b3e8d79954b179b7bd6434aefe134d42476deed885f96e8db
|
Provenance
The following attestation bundles were made for rtsp_curl_mad-0.9.0-py3-none-any.whl:
Publisher:
publish.yml on madyel/rtsp-curl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rtsp_curl_mad-0.9.0-py3-none-any.whl -
Subject digest:
572dcea278ea14d9a6737dc4f6c84b13d95246aca6cf66b4b127f9f8f8f171f4 - Sigstore transparency entry: 1155072972
- Sigstore integration time:
-
Permalink:
madyel/rtsp-curl@11f96386d1020048fb043b64aacf76801602bb8a -
Branch / Tag:
refs/tags/v0.9.0 - Owner: https://github.com/madyel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@11f96386d1020048fb043b64aacf76801602bb8a -
Trigger Event:
push
-
Statement type: