feat(video): 可配置 RTSP 打开超时并提高默认时长
- Settings 增加 video_open_timeout_sec(VIDEO_OPEN_TIMEOUT_SEC),默认 45s - SessionManager 全部就绪等待为该值 + 5s;StreamWorker 传入单路超时 - baked pipeline 回退默认值与配置对齐;.env.example 补充说明 - or_site_config.sample.json 扩展穿透摄像头与术间绑定示例 - 同步 uv.lock
This commit is contained in:
@@ -41,10 +41,14 @@ class CameraStreamWorker:
|
||||
surgery_id: str,
|
||||
camera_id: str,
|
||||
url: str,
|
||||
open_timeout_sec: float | None = None,
|
||||
) -> None:
|
||||
self._surgery_id = surgery_id
|
||||
self._camera_id = camera_id
|
||||
self._url = url
|
||||
self._open_timeout_sec = (
|
||||
float(open_timeout_sec) if open_timeout_sec is not None else bp.VIDEO_OPEN_TIMEOUT_SEC
|
||||
)
|
||||
|
||||
async def run(
|
||||
self,
|
||||
@@ -63,7 +67,7 @@ class CameraStreamWorker:
|
||||
if cap is None:
|
||||
try:
|
||||
cap = RtspCapture(
|
||||
self._url, open_timeout_sec=bp.VIDEO_OPEN_TIMEOUT_SEC
|
||||
self._url, open_timeout_sec=self._open_timeout_sec
|
||||
)
|
||||
await asyncio.to_thread(cap.open)
|
||||
consecutive_failures = 0
|
||||
|
||||
Reference in New Issue
Block a user