Skip to content

Fix SS 5.5 camera Width/Height when video-format is set - #91

Merged
davidnewhall merged 3 commits into
mainfrom
dn2_ss5_dimensions
Jul 25, 2026
Merged

Fix SS 5.5 camera Width/Height when video-format is set#91
davidnewhall merged 3 commits into
mainfrom
dn2_ss5_dimensions

Conversation

@davidnewhall

Copy link
Copy Markdown
Collaborator

Summary

  • Stop treating video-format alone as a v6 camera schema signal (SS 5.5 keeps width/height v5 tags but also emits video-format).
  • Fall back to the other schema's dimensions when the chosen branch leaves Width/Height unset.
  • Add a regression test for an SS 5.5-style camera with video-format + v5 geometry tags.

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 ./...
  • Live SS 5.5.11 Refresh: Mailbox parses as 3072x1728 (was 0x0)
  • Live half-scale Mailbox clip returns ~1532x862 instead of a sub-second full-res file

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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-format alone 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 thread cameras_types.go Outdated
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()
davidnewhall and others added 2 commits July 25, 2026 13:43
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@davidnewhall
davidnewhall merged commit 93b4797 into main Jul 25, 2026
9 checks passed
@davidnewhall
davidnewhall deleted the dn2_ss5_dimensions branch July 25, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants