Fix SS 5.5 camera Width/Height when video-format is set - #91
Merged
Conversation
SecuritySpy 5.5 emits video-format on the v5 schema; treating that as v6 left Width/Height at 0 and broke scaled RTSP clips. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts Camera XML unmarshalling to correctly interpret SecuritySpy 5.5 camera payloads that include video-format/audio-format while still using v5 geometry tags, preventing Width/Height from incorrectly remaining 0x0 and causing downstream stream sizing issues.
Changes:
- Refines v5 vs v6 camera-schema detection to avoid treating
video-format/audio-formatalone as a v6 signal. - Adds a Width/Height fallback so dimensions are populated from the other schema when the chosen branch leaves them unset.
- Adds a regression test covering an SS 5.5-style camera payload (v5 width/height +
video-format/audio-format).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| cameras_types.go | Updates schema detection and adds dimension fallback + helper to avoid Width/Height staying unset for SS 5.5 inputs. |
| cameras_test.go | Adds a regression test for SS 5.5 camera XML that includes video-format while using v5 geometry tags. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+349
to
+351
| isV6 := raw.WidthV6 != 0 || raw.HeightV6 != 0 || raw.CapturePathV6 != "" || | ||
| raw.DeviceNameV6 != "" || raw.ModeCV6.Txt != "" || raw.HasAudioV6.Txt != "" || | ||
| raw.PTZV6 != nil || raw.VideoFormat != "" || raw.StoragePathSet() | ||
| raw.PTZV6 != nil || raw.StoragePathSet() |
Drop the redundant StoragePathSet helper (same as CapturePathV6) and keep isV6 focused on v6-exclusive tags so shared fields like video-format stay safe. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
video-formatalone as a v6 camera schema signal (SS 5.5 keeps width/height v5 tags but also emits video-format).Without this, clients that scale clips from camera height (e.g. Motifini half/quarter) request no size and get oversized native streams that hit size limits almost immediately.
Test plan
go test ./...