RSDK-13042 — video-store using GetImages continues even if input is invalid repeatedly#87
RSDK-13042 — video-store using GetImages continues even if input is invalid repeatedly#87hexbabe wants to merge 2 commits intoviam-modules:mainfrom
Conversation
seanavery
left a comment
There was a problem hiding this comment.
Manual tests looking good, but wondering about the case in which the camera GetImages endpoint recovers back to color within a segment boundary. Does the encoder and resulting video file recover?
| } | ||
| } | ||
| }) | ||
|
|
There was a problem hiding this comment.
Should we add a test case here for valid jpeg mime_type but invalid image bytes? to make sure we clear in that case
There was a problem hiding this comment.
looked into it: there's no explicit path in our code that checks and propagates a sentinel error we own on bad bytes. Want me to add that? Or would you rather assert on err string from underlying lib?
videostore/videostore.go
Outdated
| // clearLatestFrame sets the latest frame atomic to a nil byte slice. | ||
| // Useful to remove stale frames when underlying cam is unhealthy. | ||
| func (vs *videostore) clearLatestFrame() { | ||
| vs.latestFrame.Store([]byte(nil)) |
There was a problem hiding this comment.
[nit] We may get a small time win here if we only store a nil byte if its content is not nil already (avoiding the atomic operations). But totally fine the way this is.
yes I actually tested this but forgot to include in the writeup. Thanks for asking! edit: Description updated. |
RSDK-13042
Bug Summary
Steps to reproduce :
Use depth camera e.g. Realsense and hook it up as the underlying camera to a video-store.
Configure the camera to return only a color image at first and store some video, then change it to return only a depth map in its GetImages response e.g. RealSense.
Expected behavior :
Returns depth mime type invalid error, and stops storing video.
Actual behavior :
Returns depth mime type invalid error, but continues storing stale color frame as video.
Manual Tests
Config:
Verified video saves well. Change sensors from
["color"]to["depth]. Observed:3/12/2026, 1:45:28 PM warn local-vs.rdk:component:camera/vs videostore/videostore.go:583 expected image mime type image/jpeg got image/vnd.viam.dep: log_ts 2026-03-12T17:45:28.138Zand no more video saved.
After changing back to
["color"]there is one corrupted video, but the video resource recovers and keeps writing segments.PR
2 reviewers
This was not vibe coded sorry for the slop earlier
TODO: make an RC, bump viamrtsp, and consume this change there