Camera Import API¶
A POST request is used to import the cameras to the following URL: http(s)://YOUR_WATCHER_URL/watcher/client-api/v3/streams/import
Console:
curl 'http://localhost/watcher/client-api/v3/streams/import' \
-X POST \
--data-binary @mydata.csv \
-H 'Content-Type: text/csv' \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1'
mydata.csv example:
name,title,comment,static,disabled,inputs_0_url,inputs_1_url,dvr_expiration,dvr_episodes_expiration,dvr_storage_limit,dvr_redundancy_factor,vision_alg,vision_areas,organization_id,coordinates_latitude,coordinates_longitude,is_test,onvif_ptz
cam-e7fee73458,Primary camera title,,true,false,rtsp://127.0.0.1/stream/main,rtsp://127.0.0.1/stream/sub,86400,259200,32212254720,3,faces,x1 y1,1,55.71182944518981,37.7775426954031,false,false
,Secondary camera title,Camera comment,true,false,rtsp://127.0.0.1/stream2/main,rtsp://127.0.0.1/stream2/sub,172800,432000,,0,plates,x2 y2,1,51.711667039488155,35.77733281254769,true,true
Response:
{"created":2,"updated":0}
One string example:
echo -e "name,title,comment,static,disabled,inputs_0_url,inputs_1_url,dvr_expiration,dvr_episodes_expiration,dvr_storage_limit,dvr_redundancy_factor,vision_alg,vision_areas,organization_id,coordinates_latitude,coordinates_longitude,is_test,onvif_ptz\ncam-e7fee73458,Primary camera title,,true,false,rtsp://127.0.0.1/stream/main,rtsp://127.0.0.1/stream/sub,86400,259200,32212254720,3,faces,x1 y1,1,55.71182944518981,37.7775426954031,false,false\n,Secondary camera title,Camera comment,true,false,rtsp://127.0.0.1/stream2/main,rtsp://127.0.0.1/stream2/sub,172800,432000,,0,plates,x2 y2,1,51.711667039488155,35.77733281254769,true,true" | curl 'http://localhost/watcher/client-api/v3/streams/import' -X POST --data-binary @- -H 'Content-Type: text/csv' -H 'Authorization: Bearer eyJ0eXAiOiJKV1'
Response:
{"created":2,"updated":0}
CSV or list of JSON objects with the following fields:
- title: camera name.
- name: stream name. Default is ‘title’ with a random suffix.
- comment: comment.
- static:
true— persistent stream,false— stream on demand. - disabled:
true— camera is disabled. - inputs_0_url: main stream RTSP URL.
- inputs_1_url: sub-stream RTSP URL (for multi-bitrate). Default is none.
- dvr_expiration: archive depth in seconds. Default is none.
- dvr_episodes_expiration: episode retention depth in seconds. Default is none.
- dvr_storage_limit: storage limit in bytes. Default is none.
- dvr_redundancy_factor: archive redundancy factor.
- vision_alg: analytics algorithm:
faces,plates. - vision_areas: analytics zone as space-separated normalized polygon coordinates:
x1 y1 x2 y2 ...(values 0.0–1.0). - organization_id: organization ID.
- coordinates_latitude: latitude.
- coordinates_longitude: longitude.
- is_test:
true— camera is provisioned on test streamers only. - onvif_ptz:
true/false— enable PTZ control via ONVIF.