Видеонаблюдение под Linux

avregd HTTP CGI API

Версия 5.5.

http://avreg_server_ip_or_hostame:{http-port}

где {http-port} - единый для всех камер порт, определённый в «/etc/avreg/avreg.conf» или дополнительных конфигурационных файлах - профилях,
по умолчанию: 874.

JPEG

Получить одиночный кадр JPEG (image/jpeg) с камеры:

/jpg/{CAMERA}/image.jpg
или
/avreg-cgi/jpg/image.cgi?camera={num}[&ab=base64_encode("login:password")]

Motion JPEG

Получить поток MJPEG (multipart/x-mixed-replace):

/mjpg/{CAMERA}/video.mjpg
или
/avreg-cgi/mjpg/video.cgi?camera={num}[[&fps={num}][&ab=base64_encode("login:password")]]

Запись на диск

Состояние/включить/остановить:

/avreg-cgi/operator/save.cgi?camera={num}&do={status/start/stop} 

Пример запроса c помощью утилиты GET (libwww-perl):

$ GET -sSe -C 'operator:' 'http://localhost:874/avreg-cgi/operator/rec.cgi?camera=6&do=status'
GET http://localhost:874/avreg-cgi/operator/rec.cgi?camera=6&do=status --> 401 Authorization Required
GET http://localhost:874/avreg-cgi/operator/rec.cgi?camera=6&do=status --> 200 OK
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection: close
Date: Thu, 10 Mar 2011 18:34:45 GMT
Pragma: no-cache
Server: avregd/5.5p7
Content-Length: 297
Content-Type: application/json; charset=UTF-8
Expires: Thu, 01 Dec 1994 16:00:00 GMT
Last-Modified: Thu, 10 Mar 2011 18:34:45 GMT
Client-Date: Thu, 10 Mar 2011 15:34:45 GMT
Client-Peer: 127.0.0.1:874
Client-Response-Num: 1

{"array":[
  {
    "cam": 6,
    "have_rec_now": true,
    "when": "Thu, 10 Mar 2011 15:34:43 GMT",
    "who": [ 2, "motion detector" ],
    "rec_id": 3,
    "video_file": "2011-03/10/06-Axis_M1031/next0004/18_34_42.avi",
    "audio_file": "2011-03/10/06-Axis_M1031/next0004/18_34_43.mp4"
  }
]}
manual/applications/avregd-cgi-api.txt · Последние изменения: 2011-11-14