Repository navigation
fix(camera_video): handle single-frame cameras without crashing - #774
Adityakk9031 wants to merge 2 commits into
Conversation
camera_video called episode.video() and estimate_fps_from_log_times for every camera with messages, but both require at least two timestamps to infer a frame rate. A camera with exactly one message crashed the enrichment with ValueError, while zero-message cameras were handled gracefully. Handle single-frame cameras by recording video_frame_count=1 without fps (no inter-frame interval to estimate) and without an MP4 artifact, while still recording video_start_s when time bounds are available. Add regression test in test_camera_video.py covering single-frame cameras.
[Low impact] The PR appears safe to merge.
|
|
@kstonekuan have a look |
kstonekuan
left a comment
There was a problem hiding this comment.
Could you bump CAMERA_VIDEO_VERSION? Single-frame episodes now produce measurements where this enrichment previously failed, so cached results need a new version.
|
ok |
Single-frame episodes now produce measurements where camera_video previously failed, so bump CAMERA_VIDEO_VERSION from 2 to 3 to invalidate cached results.
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
|
Bumped |
|
@kstonekuan have a look |
kstonekuan
left a comment
There was a problem hiding this comment.
docs/how-to/publish-camera-video.md covers the zero-message case but not the single-frame one. Could you add it?
Also, why did the camera-less test's unpack change? (video_run,) = report.enrichments still passes there.
camera_video called episode.video() and estimate_fps_from_log_times for every camera with messages, but both require at least two timestamps to infer a frame rate. A camera with exactly one message crashed the enrichment with ValueError, while zero-message cameras were handled gracefully.
Handle single-frame cameras by recording video_frame_count=1 without fps (no inter-frame interval to estimate) and without an MP4 artifact, while still recording video_start_s when time bounds are available.
Add regression test in test_camera_video.py covering single-frame camera.
Validation: uv run pytest tests/test_camera_video.py, uv run ruff check, uv run ruff format --check, uv run ty check
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.