Skip to main content

RTSP client

Project description

RTSP Package

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

Convenience-wrapper around OpenCV-Python rtsp functions.

Features

  • fetch a single image as Pillow Image
  • open RTSP stream and poll most recent frame as Pillow Image
  • preview stream in OpenCV
  • uniform interface for local web-cameras for rapid prototyping
    • integers will load a local USB or webcam starting with interface 0 via OpenCV e.g. rtsp.Client(0)
    • 'picam' uses a Raspberry Pi camera as source e.g. rtsp.Client('picam')

Examples

Use RTSP accesss credentials in your connection string e.g. RTSP_URL = f"rtsp://{USERNAME}:{PASSWORD}@192.168.1.221:554/11"

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://...',buffer_length=15) as client:
    _image = client.read()

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

Roadmap:

I don't plan to develop this module any further, as more complex applications are better suited to use OpenCV, Gstreamer, or ffmpeg directly.

To do:

  • figure out how to get cv2.VideoCapture.set(cv2.CAP_PROP_BUFFERSIZE,1) to work
  • add better parsing for the RTSP resource URIs.

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.7.tar.gz (4.1 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.7-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rtsp-1.1.7.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.4.2 requests/2.21.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.5

File hashes

Hashes for rtsp-1.1.7.tar.gz
Algorithm Hash digest
SHA256 2f1d3388eb90013cd3148ff2a998cf53d34e99f1d70f3a155215334801d2959c
MD5 07d26a08ad9842be49f6b2974953f5ee
BLAKE2b-256 ab48f1fdcfa64e9053d50cce68f88d3ad90831dfe0f875896bc9d57c582be1eb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rtsp-1.1.7-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.4.2 requests/2.21.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.5

File hashes

Hashes for rtsp-1.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 bfc7835a5fe37783958041106b9144087af2cee36e2f09318fd046845f72bde6
MD5 477aa78223298a69b5b08364adbdab67
BLAKE2b-256 688537b80a71d5b97e8c4d2667a3e63f054e406f22773b548c218ab3e93014b3

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