Skip to main content

RTSP client

Project description

RTSP Package

        /((((((\\\\
=======((((((((((\\\\\
     ((           \\\\\\\
     ( (*    _/      \\\\\\\
       \    /  \      \\\\\\________________
        |  |   |      </    __             ((\\\\
        o_|   /        ____/ / _______       \ \\\\    \\\\\\\
             |  ._    / __/ __(_-</ _ \       \ \\\\\\\\\\\\\\\\
             | /     /_/  \__/___/ .__/       /    \\\\\\\     \\
     .______/\/     /           /_/           /         \\\
    / __.____/    _/         ________(       /\
   / / / ________/`---------'         \     /  \_
  / /  \ \                             \   \ \_  \
 ( <    \ \                             >  /    \ \
  \/      \\_                          / /       > )
           \_|                        / /       / /
                                    _//       _//
                                   /_|       /_|

RTSP Client. Requires OpenCV-Python

Features

  • fetch a single image as Pillow Image

  • open RTSP stream and poll most recent frame as Pillow Image

  • preview stream in OpenCV

  • Robustness

    • configurable number of frames to allow dropped
    • configure time to retry creating a new connection

Client

Client(rtsp_server_uri, drop_frame_limit=15, retry_connection=TRUE, verbose = TRUE)

Examples

One-off Retrieval

import rtsp
client = rtsp.Client(rtsp_server_uri = 'rtsp://...')
client.read().show()
client.close()

Stream Preview

import rtsp
with rtsp.Client('rtsp://...') as client:
    client.preview()

Continuous Retrieval

import rtsp

with rtsp.Client(rtsp_server_uri = 'rtsp://...',drop_frame_limit=10) as client:
    _image = client.read()

    while True:
        process_image(_image)
        _image = client.read()

Verbose mode

In [1]: import rtsp
In [2]: client = rtsp.Client()
Connected to RTSP video source rtsp://192.168.1.3/ufirststream/track1.
In [3]: client.preview()
In [4]: client.close()
Dropped RTSP connection.
Received signal to stop.
In [5]: client.open()
Connected to RTSP video source rtsp://192.168.1.3/ufirststream/track1.
In [6]: client.read().show()
Connected to RTSP video source rtsp://192.168.1.3/ufirststream/track1.
In [7]: client.close()
Dropped RTSP connection.
Received signal to stop.

Roadmap:

  • v1.0.0 - basic function relying on OpenCV or ffmpeg
  • v2.0.0 - lightweight native-Python implementation rtsp client functions
    • live stream reading & buffer
    • on-demand frame retrieval
  • v2.1.0 - native Python rtsp server functions

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rtsp-1.1.2.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rtsp-1.1.2-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file rtsp-1.1.2.tar.gz.

File metadata

  • Download URL: rtsp-1.1.2.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.19.8 CPython/2.7.10

File hashes

Hashes for rtsp-1.1.2.tar.gz
Algorithm Hash digest
SHA256 6dada59bfb5fc4fe1279883b0583f3487d83ba99e4e59a5cfd517dc2e1d0d0d4
MD5 9f58126e09a624eec251306e8c309d08
BLAKE2b-256 17bda042e99f733e94f5250b8f79c33b00be277c4fd482240e3af3b54ab3ef77

See more details on using hashes here.

File details

Details for the file rtsp-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: rtsp-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.19.8 CPython/2.7.10

File hashes

Hashes for rtsp-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 076fd0e9531dc353c6756d9cf22ec32f63acaad0da7fa42afcc6b1ab53588589
MD5 badde7abb0070d5a075f57c29e62a1d6
BLAKE2b-256 4169889140a250654d0b6fb19a2126ccc73c396ba96f5b01791b16d8143e5d4f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page