Compare commits

...
1 Commits
Author SHA1 Message Date
Cedric Verstraeten f1ac4f53b6 add logging + friendly_name might be empty 2023-09-12 15:05:22 +02:00
2 changed files with 123 additions and 25 deletions
+121 -25
View File
@@ -1,20 +1,25 @@
{ {
"type": "", "type": "",
"key": "", "key": "okkey",
"name": "agent", "name": "rtsp2",
"time": "false", "time": "false",
"offline": "false", "offline": "false",
"auto_clean": "true", "auto_clean": "100",
"remove_after_upload": "true", "remove_after_upload": "true",
"max_directory_size": 100, "max_directory_size": 20,
"timezone": "Africa/Ceuta", "timezone": "Europe/Brussels",
"capture": { "capture": {
"name": "", "name": "",
"ipcamera": { "ipcamera": {
"rtsp": "", "width": 640,
"sub_rtsp": "", "height": 480,
"fps": "" "fps": "",
"rtsp": "rtsp://fake.kerberos.io/stream",
"sub_rtsp": "rtsp://kellyvd:cedricve123@192.168.1.68:554/Streaming/Channels/102?transportmode=multicast\u0026profile=Profile_1",
"onvif": "true",
"onvif_xaddr": "192.168.1.68",
"onvif_username": "kellyvd",
"onvif_password": "cedricve123"
}, },
"usbcamera": { "usbcamera": {
"device": "" "device": ""
@@ -22,27 +27,27 @@
"raspicamera": { "raspicamera": {
"device": "" "device": ""
}, },
"continuous": "false",
"recording": "true", "recording": "true",
"snapshots": "true", "snapshots": "true",
"liveview": "true",
"motion": "true", "motion": "true",
"postrecording": 20, "liveview": "true",
"prerecording": 10, "continuous": "false",
"maxlengthrecording": 30, "postrecording": 5,
"prerecording": 5,
"maxlengthrecording": 10,
"transcodingwebrtc": "", "transcodingwebrtc": "",
"transcodingresolution": 0, "transcodingresolution": 0,
"forwardwebrtc": "", "forwardwebrtc": "",
"fragmented": "false", "fragmented": "false",
"fragmentedduration": 8, "fragmentedduration": 10,
"pixelChangeThreshold": 150 "pixelChangeThreshold": 150
}, },
"timetable": [ "timetable": [
{ {
"start1": 0, "start1": 0,
"end1": 43199, "end1": 0,
"start2": 43200, "start2": 0,
"end2": 86400 "end2": 0
}, },
{ {
"start1": 0, "start1": 0,
@@ -89,15 +94,106 @@
"x2": 800, "x2": 800,
"y2": 640 "y2": 640
}, },
"polygon": [] "polygon": [
{
"id": "1694456798869",
"coordinates": [
{
"x": 458.8176559163439,
"y": 420.6597577161105
},
{
"x": 541.8959724597637,
"y": 422.62130444776193
},
{
"x": 540.2578560606811,
"y": 446.03551153214977
},
{
"x": 459.51092569845395,
"y": 445.07041692205803
}
]
},
{
"id": "1694455955284",
"coordinates": [
{
"x": 82.63849814838939,
"y": 122.83665165528404
},
{
"x": 259.18591194149286,
"y": 122.83665165528404
},
{
"x": 259.18591194149286,
"y": 232.42716889666335
},
{
"x": 82.63849814838939,
"y": 232.42716889666335
}
]
},
{
"id": "1694455953115",
"coordinates": [
{
"x": 200.7130606007035,
"y": 171.25495957161723
},
{
"x": 445.73676749725524,
"y": 171.25495957161723
},
{
"x": 445.73676749725524,
"y": 297.5911664681689
},
{
"x": 200.7130606007035,
"y": 297.5911664681689
}
]
},
{
"id": "0",
"coordinates": [
{
"x": 351.8431271737717,
"y": 65.62379883848743
},
{
"x": 609.6534108617149,
"y": 65.62379883848743
},
{
"x": 609.6534108617149,
"y": 246.50145841295546
},
{
"x": 351.8431271737717,
"y": 246.50145841295546
}
]
}
]
}, },
"cloud": "s3", "cloud": "s3",
"s3": { "s3": {
"proxyuri": "http://proxy.kerberos.io", "proxyuri": "http://proxy.kerberos.io",
"bucket": "kerberosaccept", "bucket": "kerberosaccept",
"region": "eu-west-1" "region": "eu-west1",
"username": "cedricve"
},
"kstorage": {
"uri": "https://api.vault.kerberos.io",
"access_key": "pDCQve0XL1DXwy2x",
"secret_access_key": "GTpus90EKrKYuplqL3g!2oiQ@s",
"directory": "cedricve"
}, },
"kstorage": {},
"dropbox": {}, "dropbox": {},
"mqtturi": "tcp://mqtt.kerberos.io:1883", "mqtturi": "tcp://mqtt.kerberos.io:1883",
"mqtt_username": "", "mqtt_username": "",
@@ -107,9 +203,9 @@
"turn_username": "username1", "turn_username": "username1",
"turn_password": "password1", "turn_password": "password1",
"heartbeaturi": "", "heartbeaturi": "",
"hub_uri": "https://api.cloud.kerberos.io", "hub_uri": "http://localhost:8081",
"hub_key": "", "hub_key": "AKIA5V6EGLUWXDU4JBEI",
"hub_private_key": "", "hub_private_key": "DIOXToTpAlYpa4atf7aWtxHd9xEw/Fk4XioL0tek",
"hub_site": "", "hub_site": "",
"condition_uri": "" "condition_uri": ""
} }
+2
View File
@@ -256,6 +256,8 @@ func MQTTListenerHandler(mqttClient mqtt.Client, hubKey string, configDirectory
// Not relevant for this device, so we'll ignore it. // Not relevant for this device, so we'll ignore it.
} else { } else {
// We'll find out which message we received, and act accordingly. // We'll find out which message we received, and act accordingly.
log.Log.Info("MQTTListenerHandler: received message with action: " + payload.Action)
switch payload.Action { switch payload.Action {
case "record": case "record":
HandleRecording(mqttClient, hubKey, payload, configuration, communication) HandleRecording(mqttClient, hubKey, payload, configuration, communication)