first commit

This commit is contained in:
2026-04-26 21:27:00 +07:00
commit 3ce6f0510b
48 changed files with 9700 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
# IPCam Orange Pi Dashboard — Architecture
## Thành phần
- IP Cameras (RTSP, H264)
- MediaMTX (proxy WebRTC + recorder + Control API)
- Backend FastAPI
- MediaMTX API wrapper
- Scheduler ghi hình theo lịch
- Recording index API + serve file video
- Lưu cấu hình (camera list + schedule)
- Frontend React
- Live grid (WebRTC)
- Playback (file list + HTML5 video)
- Settings (camera + schedule)
## Luồng dữ liệu
- Live: Camera → MediaMTX → WebRTC → Browser
- Playback: Camera → MediaMTX → fMP4 trên đĩa → Backend serve → Browser
## API hợp đồng (mức tối thiểu)
- `GET /api/health`
- `GET /api/paths` (trạng thái stream từ MediaMTX)
- `GET /api/config` (camera + schedule)
- `POST /api/recording` (bật/tắt ghi hình ngay)
- `POST /api/scheduler/enabled` (bật/tắt scheduler)
- `POST /api/scheduler/schedule` (cập nhật lịch)
- `GET /api/recordings?camera=cam1&date=YYYY-MM-DD`
- `GET /videos/<camera>/<file>.fmp4`
+41
View File
@@ -0,0 +1,41 @@
# IPCam Orange Pi Dashboard — Requirements
## Mục tiêu
Xây dựng dashboard giám sát camera IP gọn nhẹ chạy tốt trên Orange Pi, dựa trên MediaMTX để:
- Xem live WebRTC độ trễ thấp
- Phát lại file ghi (fMP4) theo camera + ngày
- Quản lý camera và lịch ghi hình
- Backend điều khiển ghi hình bằng MediaMTX Control API (không chạy AI)
## Tính năng
### Live View
- Hiển thị dạng lưới (mặc định 2x2; có thể mở rộng)
- Lazy-load stream
- Auto reconnect
- Trạng thái online/offline
- Nút fullscreen + reload
### Playback
- Chọn camera + chọn ngày
- Danh sách file theo thời gian (mới nhất trước)
- Phát file bằng HTML5 video
- Tải file (download)
### Settings
- Camera management: thêm/xóa camera (từ dashboard), đồng bộ cấu hình paths lên MediaMTX
- Recording schedule:
- Weekdays: 18:00 → 08:00
- Weekend: 24h
- Backend chạy scheduler mỗi 60 giây
## Ràng buộc
- Camera nên dùng H264 (trình duyệt không hỗ trợ H265 phổ biến)
- MediaMTX cần mở cổng: 8554 (RTSP), 8889 (WebRTC HTTP), 9997 (Control API), 8189/UDP (ICE)