Skip to main content

Python library for connecting to m3u8 cameras

Project description

Cam-viewer

Library installation:

pip install cam-viewer

Functions:

To use the functions, import cam-viewer:

import cam_viewer

Camera playback function:

cam_viewer.playback(command, parameters, cams_json, cam_group, cam_id, use_title, fontfile, custom_title)

The output shows this list: [cam_proc, response]:

  1. cam_proc - the subprocess.Popen() class (Popen)
  2. responce - a line with the result of starting camera playback (string)

Input parameters:

  1. command - main FFMPEG command [ffmpeg, ffplay, ffprobe] (string)
  2. parameters - FFMPEG flags (string)
  3. cams_json - json file containing cameras and their settings, example (json data)
  4. cam_group - camera group (string)
  5. cam_id - camera ID (integer)
  6. use_title - show camera group and camera ID in video output (boolean True/False)
  7. font_file - font file path (string)
  8. custom_title - your custom title (string)

Get camera data function:

cam_viewer.cam_data(cams_json, cam_group, cam_id)

The output shows this list: [cam_url, enabled, response]:

  1. cam_url - camera URL (string)
  2. enabled - is the camera enabled (boolean True/False)
  3. responce - a line with the result of getting camera data (string)

Input parameters:

  1. cams_json - json file containing cameras and their settings, example (json data)
  2. cam_group - camera group (string)
  3. cam_id - camera ID (integer)

Checking camera URL for availability:

cam_viewer.url_available(cam_url)

The output shows this:

  1. available - is the camera available (boolean True/False)

Input parameters:

  1. cam_url - camera URL (string)

Get current time:

cam_viewer.current_time()

The output shows this:

  1. time_str - current time in %H:%M:%S format (string)

Examples of using:

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

cam_viewer-0.0.3.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

cam_viewer-0.0.3-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file cam_viewer-0.0.3.tar.gz.

File metadata

  • Download URL: cam_viewer-0.0.3.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.11

File hashes

Hashes for cam_viewer-0.0.3.tar.gz
Algorithm Hash digest
SHA256 742a9fe2acd46709fd29fc85e1c0fa21008079630626dd1bfbae14c945fde93d
MD5 1b0dba8045a5b5d46980ad3042d5ce91
BLAKE2b-256 12d5b3e21d5a13f667387c89efa2604f1ac6af8d232ac34635525239658381c3

See more details on using hashes here.

File details

Details for the file cam_viewer-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: cam_viewer-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.11

File hashes

Hashes for cam_viewer-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6c603a81c7db09fb3e3a8a5fcdc3826a32dd9a8a542c58518d2141b40b4195da
MD5 3252d5bafe1df3e0f1bc5f6654cf0bdb
BLAKE2b-256 e101892e24444eb3c4fba634ce49b52ed394e13f3e62b02a64b5bc5a03e75d17

See more details on using hashes here.

Supported by

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