From fdc3bfb4a4219ad161ceacd059187b3fff4e27f6 Mon Sep 17 00:00:00 2001 From: cedricve Date: Sun, 13 Jul 2025 19:47:07 +0000 Subject: [PATCH] Add live view chunking configuration to capture settings --- machinery/data/config/config.json | 1 + machinery/src/cloud/Cloud.go | 4 ++-- machinery/src/config/main.go | 4 ++-- machinery/src/models/Config.go | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/machinery/data/config/config.json b/machinery/data/config/config.json index 017b074..1cb76f0 100644 --- a/machinery/data/config/config.json +++ b/machinery/data/config/config.json @@ -26,6 +26,7 @@ "recording": "true", "snapshots": "true", "liveview": "true", + "liveview_chunking": "true", "motion": "true", "postrecording": 20, "prerecording": 10, diff --git a/machinery/src/cloud/Cloud.go b/machinery/src/cloud/Cloud.go index 9c74d89..6c9acb2 100644 --- a/machinery/src/cloud/Cloud.go +++ b/machinery/src/cloud/Cloud.go @@ -708,8 +708,8 @@ func HandleLiveStreamSD(livestreamCursor *packets.QueueCursor, configuration *mo if err == nil { bytes, _ := utils.ImageToBytes(&img) - chunking := config.LiveviewChunking - if chunking != "true" { + chunking := config.Capture.LiveviewChunking + if chunking == "false" { encoded := base64.StdEncoding.EncodeToString(bytes) valueMap := make(map[string]interface{}) diff --git a/machinery/src/config/main.go b/machinery/src/config/main.go index 1315237..404d950 100644 --- a/machinery/src/config/main.go +++ b/machinery/src/config/main.go @@ -393,8 +393,8 @@ func OverrideWithEnvironmentVariables(configuration *models.Configuration) { break /* MQTT chunking of low-resolution images into multiple messages */ - case "AGENT_LIVEVIEW_CHUNKING": - configuration.Config.LiveviewChunking = value + case "AGENT_CAPTURE_LIVEVIEW_CHUNKING": + configuration.Config.Capture.LiveviewChunking = value break /* Real-time streaming of keyframes to a MQTT topic */ diff --git a/machinery/src/models/Config.go b/machinery/src/models/Config.go index b966817..97748ed 100644 --- a/machinery/src/models/Config.go +++ b/machinery/src/models/Config.go @@ -47,7 +47,6 @@ type Config struct { ConditionURI string `json:"condition_uri" bson:"condition_uri"` Encryption *Encryption `json:"encryption,omitempty" bson:"encryption,omitempty"` Signing *Signing `json:"signing,omitempty" bson:"signing,omitempty"` - LiveviewChunking string `json:"liveview_chunking,omitempty" bson:"liveview_chunking,omitempty"` RealtimeProcessing string `json:"realtimeprocessing,omitempty" bson:"realtimeprocessing,omitempty"` RealtimeProcessingTopic string `json:"realtimeprocessing_topic" bson:"realtimeprocessing_topic"` } @@ -63,6 +62,7 @@ type Capture struct { Snapshots string `json:"snapshots,omitempty"` Motion string `json:"motion,omitempty"` Liveview string `json:"liveview,omitempty"` + LiveviewChunking string `json:"liveview_chunking,omitempty" bson:"liveview_chunking,omitempty"` Continuous string `json:"continuous,omitempty"` PostRecording int64 `json:"postrecording"` PreRecording int64 `json:"prerecording"`