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:
@@ -520,6 +520,32 @@ class CameraManager:
|
||||
|
||||
return streamer.is_streaming()
|
||||
|
||||
def start_camera_rtsp_streaming(self, camera_name: str) -> bool:
|
||||
"""Start RTSP streaming for a specific camera"""
|
||||
streamer = self.camera_streamers.get(camera_name)
|
||||
if not streamer:
|
||||
self.logger.error(f"Camera streamer not found: {camera_name}")
|
||||
return False
|
||||
|
||||
return streamer.start_rtsp_streaming()
|
||||
|
||||
def stop_camera_rtsp_streaming(self, camera_name: str) -> bool:
|
||||
"""Stop RTSP streaming for a specific camera"""
|
||||
streamer = self.camera_streamers.get(camera_name)
|
||||
if not streamer:
|
||||
self.logger.error(f"Camera streamer not found: {camera_name}")
|
||||
return False
|
||||
|
||||
return streamer.stop_rtsp_streaming()
|
||||
|
||||
def is_camera_rtsp_streaming(self, camera_name: str) -> bool:
|
||||
"""Check if a camera is currently RTSP streaming"""
|
||||
streamer = self.camera_streamers.get(camera_name)
|
||||
if not streamer:
|
||||
return False
|
||||
|
||||
return streamer.is_rtsp_streaming()
|
||||
|
||||
def get_camera_config(self, camera_name: str) -> Optional[CameraConfig]:
|
||||
"""Get camera configuration"""
|
||||
return self.config.get_camera_by_name(camera_name)
|
||||
|
||||
Reference in New Issue
Block a user