Skip to content

feat: add fake ONVIF + RTSP camera for local development#41

Open
lan17 wants to merge 1 commit intomainfrom
feat/fake-camera
Open

feat: add fake ONVIF + RTSP camera for local development#41
lan17 wants to merge 1 commit intomainfrom
feat/fake-camera

Conversation

@lan17
Copy link
Owner

@lan17 lan17 commented Feb 28, 2026

Summary

Adds a mock camera environment for local development and testing.

What's included

  • mock_onvif.py — Lightweight mock ONVIF server (aiohttp, port 8000) responding to GetServices and GetStreamUri SOAP requests, pointing to the local RTSP stream.
  • mediamtx.yml — Config for MediaMTX RTSP server on port 8099.
  • Makefile — New make fake-camera target that starts all three services with one command.

Prerequisites

  • ffmpeg installed
  • mediamtx binary in project root
  • A sample .mp4 file at media/sample.mp4
  • Python 3 with aiohttp

Usage

make fake-camera

Then configure HomeSec with:

  • RTSP URL: rtsp://localhost:8099/live
  • ONVIF URL: http://localhost:8000/onvif/device_service

@lan17 lan17 force-pushed the feat/fake-camera branch 2 times, most recently from be26525 to fda7474 Compare February 28, 2026 22:52
@codecov
Copy link

codecov bot commented Feb 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.73%. Comparing base (2ccca3f) to head (10674a1).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #41      +/-   ##
==========================================
- Coverage   82.76%   82.73%   -0.04%     
==========================================
  Files         107      107              
  Lines        9673     9673              
==========================================
- Hits         8006     8003       -3     
- Misses       1667     1670       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- mock_onvif.py: Mock ONVIF server with WS-Discovery (UDP multicast)
  and full SOAP endpoints (GetDeviceInformation, GetCapabilities,
  GetServices, GetProfiles, GetStreamUri)
- mediamtx.yml: MediaMTX RTSP server config with auth (admin/admin123)
- Makefile: New `make fake-camera` target

Prerequisites: ffmpeg, mediamtx binary, and a sample .mp4 at media/sample.mp4.
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