[BACKEND] External phone camera management#4
Conversation
There was a problem hiding this comment.
Bug: Placeholder Script Committed
The file scripts/start_webrtc_backend.py was accidentally committed as an incomplete or placeholder file, containing only a single space character. It should either be removed or properly implemented.
scripts/start_webrtc_backend.py#L1-L1
leLab/scripts/start_webrtc_backend.py
Line 1 in 0ac38c1
Bug: Incorrect Uvicorn Launch for Phone Camera Demo
The scripts/start_phone_camera_demo.py script incorrectly launches uvicorn with app.main:app instead of app.main:main_app. The main_app object (defined in app/main.py) is the FastAPI application wrapped with Socket.IO to provide WebRTC signaling capabilities, which are essential for phone camera support. By using app.main:app, the script starts the plain FastAPI app, which lacks this crucial WebRTC functionality, rendering the phone camera features non-functional.
scripts/start_phone_camera_demo.py#L43-L52
leLab/scripts/start_phone_camera_demo.py
Lines 43 to 52 in 0ac38c1
Bug: WebRTC Cleanup Task Not Triggered
The start_cleanup_task() function is defined but never called, preventing the cleanup of expired WebRTC sessions. This leads to memory leaks as session data accumulates indefinitely in active_sessions, session_clients, active_streams, and stream_buffers.
app/webrtc_signaling.py#L335-L341
Lines 335 to 341 in 0ac38c1
BugBot free trial expires on July 22, 2025
You have used $0.00 of your $50.00 spend limit so far. Manage your spend limit in the Cursor dashboard.
Was this report helpful? Give feedback by reacting with 👍 or 👎
|
@jurmy24 @DavidLMS I worked on implementing this very interesting feature, which was the main focus of our hackathon. |
What is this PR about
In this PR we try to use the web interface to link local network devices cameras to feed the dataset.
How do we plan to do it
In the camera configuration dropdown, add a special camera option called "Phone".
This option must:
When a "Phone" camera is added:
🔍 Determine frontend base address:
localhostor127.0.0.1, detect the machine's local network IP address (e.g.,192.168.x.x).🔐 Enable HTTPS locally (required for camera access on phones):
https://<local_ip>:<port>over Wi-Fi🌐 Setup a WebRTC streaming endpoint on the backend:
📱 Generate a mobile streaming link with QR code:
[https://<local_ip>:<port>]/remote_cam/[webrtc_id]getUserMedia🖥️ Frontend UI behavior:
🔁 Stream routing from phone to frontend:
Implementation constraints:
mkcert,selfsigned,flask-tls)Optional:
Related PRs