Skip to content

feat: add RTSP/IP camera support via --camera URL - #27

Merged
johnoct merged 2 commits into
mainfrom
feat/rtsp-camera
Feb 7, 2026
Merged

feat: add RTSP/IP camera support via --camera URL#27
johnoct merged 2 commits into
mainfrom
feat/rtsp-camera

Conversation

@johnoct

@johnoct johnoct commented Feb 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add ThreadedVideoCapture class that reads frames in a background thread (latest-frame pattern, prevents RTSP lag)
  • Add open_camera_source() factory function that picks local VideoCapture or ThreadedVideoCapture based on source string
  • Change --camera from int-only to accept RTSP/HTTP URLs: --camera rtsp://user:pass@192.168.1.100:554/stream1
  • Add --rtsp-transport tcp|udp flag (default: tcp)
  • Mask credentials in all log output via mask_credentials()
  • Update reconnect_camera() to handle both local and network sources

Backward compatible: --camera 0 still works exactly as before.

Test plan

  • All 290 tests pass (31 new)
  • ThreadedVideoCapture: init, read, copy semantics, release, is_healthy, timeout, RTSP env var
  • open_camera_source: local index, RTSP URL, HTTP URL, invalid source, not-found exits
  • mask_credentials: with/without credentials, HTTP, local index
  • _is_network_source: RTSP, HTTP, HTTPS, local index, integer
  • parse_args: camera accepts URL, rtsp_transport choices, defaults
  • reconnect_camera: local and RTSP reconnection, failure returns None
  • Integration tests updated for new function names

- Add ThreadedVideoCapture class for network streams (latest-frame pattern)
- Add open_camera_source() factory: local index or RTSP/HTTP URL
- Change --camera from int to str (backward compatible: "0" still works)
- Add --rtsp-transport tcp|udp flag (default: tcp)
- Add mask_credentials() to hide passwords in log output
- Update reconnect_camera() to handle both local and network sources
@johnoct
johnoct merged commit 80eed3f into main Feb 7, 2026
1 check passed
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.

1 participant