Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vasysik/cam-viewer
Python library for connecting to m3u8 cameras
https://github.com/vasysik/cam-viewer
Last synced: 11 days ago
JSON representation
Python library for connecting to m3u8 cameras
- Host: GitHub
- URL: https://github.com/vasysik/cam-viewer
- Owner: Vasysik
- License: mit
- Created: 2024-02-12T16:32:41.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-03-02T19:15:46.000Z (11 months ago)
- Last Synced: 2024-12-17T22:41:11.530Z (about 1 month ago)
- Language: Python
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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()](https://docs.python.org/3/library/subprocess.html#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](https://github.com/Vasysik/streetcat-viewer/blob/main/cams.json) (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](https://github.com/Vasysik/streetcat-viewer/blob/main/cams.json) (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:
- [streetcat-console](https://github.com/Vasysik/streetcat-console) (simple usage)
- [streetcat-youtube](https://github.com/Vasysik/streetcat-youtube)