Implement RTSP streaming functionality for cameras

- Added endpoints to start and stop RTSP streaming for cameras in the API.
- Enhanced CameraManager and CameraStreamer classes to manage RTSP streaming state and processes.
- Updated API documentation to include new RTSP streaming commands.
- Modified Docker configurations to include FFmpeg for RTSP streaming support.
- Adjusted MediaMTX settings for improved stream handling and timeout configurations.
This commit is contained in:
salirezav
2025-11-01 12:35:25 -04:00
parent 70f614e9ff
commit b7adc3788a
10 changed files with 628 additions and 2 deletions

View File

@@ -37,6 +37,15 @@ POST {{API}}/cameras/camera1/stop-stream
### View live MJPEG stream in browser (open URL)
# {{API}}/cameras/camera1/stream
### Start RTSP streaming for camera1 (publishes to MediaMTX)
POST {{API}}/cameras/camera1/start-rtsp
### Stop RTSP streaming for camera1
POST {{API}}/cameras/camera1/stop-rtsp
### RTSP stream URL (use with VLC/ffplay):
# rtsp://{{host}}:{{rtsp_port}}/camera1
### getting a list of all videos
GET {{MEDIA}}/videos/?page=10&limit=1
@@ -78,6 +87,20 @@ Range: bytes=0-1048575
# ffplay -rtsp_transport tcp rtsp://{{host}}:{{rtsp_port}}/vod
# vlc rtsp://{{host}}:{{rtsp_port}}/vod
# MediaMTX HTTP API (for checking streams)
@MEDIAMTX_API = http://{{host}}:8889
### Check MediaMTX version/info
GET {{MEDIAMTX_API}}/v2/config/get
### List all available RTSP paths/streams
GET {{MEDIAMTX_API}}/v2/paths/list
### Get info about a specific path (e.g., camera1)
GET {{MEDIAMTX_API}}/v2/paths/get/camera1
# MediaMTX Web Interface (open in browser)
# http://{{host}}:8889/static/
# If you enable WebRTC in MediaMTX, you can open its embedded player page (for testing):
# See MediaMTX docs; by default we exposed RTSP and WebRTC ports in compose.