Add live view chunking configuration to capture settings

This commit is contained in:
cedricve
2025-07-13 19:47:07 +00:00
parent c17d6b7117
commit fdc3bfb4a4
4 changed files with 6 additions and 5 deletions

View File

@@ -26,6 +26,7 @@
"recording": "true",
"snapshots": "true",
"liveview": "true",
"liveview_chunking": "true",
"motion": "true",
"postrecording": 20,
"prerecording": 10,

View File

@@ -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{})

View File

@@ -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 */

View File

@@ -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"`