-
Notifications
You must be signed in to change notification settings - Fork 95
Web services description
There are web services useful for many functions. The default format is JSON (or JPG for images).
- Snapshot
- Motion events management
- Configuration
- Camera settings
- Maintenance
- Service start and stop
- PTZ
http://IP:8080/cgi-bin/snapshot.sh?res=RESOLUTION&watermark=WATERMARK&file=FILE
RES: high or low (default high)
WATERMARK: yes or no (default no)
FILE: name of the file you want to save in /tmp/sd/record/
http://IP:8080/cgi-bin/eventsdir.sh
List of directories containing registered mp4 files.
http://IP:8080/cgi-bin/eventsfile.sh?dirname=2020Y01M01D01H
List of mp4 files contained in a specific directory.
http://IP:8080/cgi-bin/eventsdirdel.sh?dir=all
Remove all directories (containing registered mp4 files).
http://IP:8080/cgi-bin/eventsdirdel.sh?dir=2020Y01M01D01H
Remove directory /tmp/sd/record/2020Y01M01D01H (directory containing registered mp4 files).
http://IP:8080/cgi-bin/eventsfiledel.sh?file=2020Y01M01D01H/00M00S60.mp4
Remove file /tmp/sd/record/2020Y01M01D01H/00M00S60.mp4
http://IP:8080/cgi-bin/getlastrecordedvideo.sh
Use. Available variables:
"oldness" variable. Defines which video to retrieve..
-
"0" (default) or "1" means latest already available.
-
greater than "0" specifies the oldness, so "3" means the third oldest video. Only looks into the current hour folder. So if value is greater than the videos in the latest hour folder, the last one will be sent.
-
negative value (e.g. "-1") means to wait for the next available video. Only works if a video is already being recorded, max. time to wait 80 seconds.
"type" variable. Defines what to retrieve.
-
"1" (default). Gets relative name in the format of DIR/VIDEO.mp4
-
"2". Gets full URL video.
-
"3". Gets the video itself as video/mp4 inline.
-
"4". Gets the video itself as video/mp4 attachment.
Examples of use:
http://IP:PORT/cgi-bin/getlastrecordedvideo.sh?oldness=-1&type=4 -- Wait for a new video and sends it as an attachment.
http://IP:PORT/cgi-bin/getlastrecordedvideo.sh?oldness=-1&type=3 -- Wait for a new video and shows it inline in the browser.
http://IP:PORT/cgi-bin/getlastrecordedvideo.sh?type=1 -- Send the relative route of the last available video.
http://IP:PORT/cgi-bin/getlastrecordedvideo.sh?oldness=2&type=2 -- Send the URL of the second to last available video.
http://IP:8080/cgi-bin/get_configs.sh?conf=CONF
CONF | action |
---|---|
system | Get system configuration |
mqtt | Get mqtt configuration |
camera | Get camera settings |
http://IP:8080/cgi-bin/set_configs.sh?conf=CONF
CONF | action |
---|---|
system | Update system configuration |
mqtt | Update mqtt configuration |
camera | Update camera settings |
Need POST mehod with a json file.
http://IP:8080/cgi-bin/status.json
http://IP:8080/cgi-bin/hostname.js
http://IP:8080/cgi-bin/camera_settings.sh?conf=value
conf | value | action |
---|---|---|
switch_on | yes/no | Switch on/off the video on the camera |
save_video_on_motion | yes/no | If enabled, video will be saved only when a motion is detected. If disabled, video will be always saved. (It takes effect only if recording is enabled) |
sensitivity | low/medium/high | Detection sensitivity (low, medium or high) |
led | yes/no | Set status led on or off |
ir | yes/no | Enable IR led for night vision |
rotate | yes/no | Enable image rotation for ceiling mount |
Save settings on camera.conf and send IPC commands to the cam (no reboot is needed).
http://IP:8080/cgi-bin/load.sh
Load configuration file (it requires post methid).
http://IP:8080/cgi-bin/save.sh
Save configuration to a file.
http://IP:8080/cgi-bin/fw_upgrade.sh?get=info
Get upgrade info.
http://IP:8080/cgi-bin/fw_upgrade.sh?get=upgrade
Start upgrade procedure.
http://IP:8080/cgi-bin/reboot.sh
http://IP:8080/cgi-bin/service.sh?name=NAME&action=ACTION¶m1=PARAM1¶m2=PARAM2
name | action | param1 | param2 | description |
---|---|---|---|---|
rtsp | start/stop/status | low/high/both | N/A | rtsp: use param1 to set resolution |
onvif | start/stop/status | low/high/both | yes/no | onvif: use param1 to set resolution and param2 to set snapshot watermark (param2 is available only if action = start |
ftpd | start/stop/status | busybox/pure-ftpd | N/A | ftpd: use param1 to set which daemon use |
mqtt | start/stop/status | N/A | N/A | mqtt to send motion events to a broker |
mp4record | start/stop/status | N/A | N/A | mp4record (yi program that saves mp4 videos) |
http://IP:8080/cgi-bin/ptz.sh?dir=DIRECTION&time=TIME
DIRECTION=left, right, up or down (required option).
TIME=period of movement (default 0.3 s).
http://IP:8080/cgi-bin/preset.sh?num=NUMBER
NUMBER=preset number (required option).