pip install cam-viewer
To use the functions, import cam-viewer:
import cam_viewer
cam_viewer.playback(command, parameters, cams_json, cam_group, cam_id, use_title, fontfile, custom_title)
The output shows this list: [cam_proc, response]:
cam_proc
- the subprocess.Popen() class (Popen)responce
- a line with the result of starting camera playback (string)
Input parameters:
command
- main FFMPEG command [ffmpeg
,ffplay
,ffprobe
] (string)parameters
- FFMPEG flags (string)cams_json
- json file containing cameras and their settings, example (json data)cam_group
- camera group (string)cam_id
- camera ID (integer)use_title
- show camera group and camera ID in video output (boolean True/False)font_file
- font file path (string)custom_title
- your custom title (string)
cam_viewer.cam_data(cams_json, cam_group, cam_id)
The output shows this list: [cam_url, enabled, response]:
cam_url
- camera URL (string)enabled
- is the camera enabled (boolean True/False)responce
- a line with the result of getting camera data (string)
Input parameters:
cams_json
- json file containing cameras and their settings, example (json data)cam_group
- camera group (string)cam_id
- camera ID (integer)
cam_viewer.url_available(cam_url)
The output shows this:
available
- is the camera available (boolean True/False)
Input parameters:
cam_url
- camera URL (string)
cam_viewer.current_time()
The output shows this:
time_str
- current time in%H:%M:%S
format (string)
- streetcat-console (simple usage)
- streetcat-youtube