feat: consumption log top1 + elapsed since recording; RTSP play once
- Add top1_name/top1_conf to TSV and show top1–3 in pending markdown - Add 相对开录 column and pass since_recording_start from surgery start - Track surgery_started_wall and format_elapsed_mmss_since in session registry - Remove ffmpeg stream_loop from synthetic/demo fake RTSP (play once) - Fix fake_rtsp_from_file poll loop indentation; update README - Extend consumption TSV tests; add face test PNGs under tests/faces Made-with: Cursor
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Publish local video file(s) as looping RTSP stream(s) (fake camera) for local dev.
|
||||
"""Publish local video file(s) to RTSP once per file (fake camera) for local dev.
|
||||
|
||||
The Operation Room server only opens RTSP URLs (OpenCV); there is no video-upload API.
|
||||
This script does NOT change the application backend: it runs ffmpeg + a small
|
||||
@@ -103,7 +103,7 @@ def _parse_stream_arg(spec: str) -> tuple[str, Path, str]:
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Loop video file(s) to RTSP URL(s) (dev fake camera; no backend code change).",
|
||||
description="Play each video file once to an RTSP URL (dev fake camera; no backend code change).",
|
||||
)
|
||||
parser.add_argument(
|
||||
"video",
|
||||
@@ -198,7 +198,6 @@ def main() -> int:
|
||||
"ffmpeg",
|
||||
"-hide_banner", "-loglevel", "info",
|
||||
"-re",
|
||||
"-stream_loop", "-1",
|
||||
"-i", str(fp),
|
||||
"-c", "copy",
|
||||
"-f", "rtsp",
|
||||
@@ -225,7 +224,11 @@ def main() -> int:
|
||||
h = u.replace("127.0.0.1", "host.docker.internal", 1)
|
||||
print(f" {cam}: {h}", file=sys.stderr)
|
||||
print("---", file=sys.stderr)
|
||||
print("Fake RTSP running (Ctrl+C to stop; MediaMTX container removed on exit).", file=sys.stderr)
|
||||
print(
|
||||
"Fake RTSP running: each file plays once; script exits when ffmpeg ends "
|
||||
"(Ctrl+C to stop early; MediaMTX container removed on exit).",
|
||||
file=sys.stderr,
|
||||
)
|
||||
|
||||
def on_sigint(_sig: int, _frame) -> None:
|
||||
for p in procs:
|
||||
@@ -240,8 +243,8 @@ def main() -> int:
|
||||
try:
|
||||
while True:
|
||||
time.sleep(0.5)
|
||||
for p in procs:
|
||||
if p.poll() is not None:
|
||||
for p in procs:
|
||||
if p.poll() is not None:
|
||||
print(
|
||||
f"[fake-rtsp] ffmpeg ended (code {p.returncode}), stopping all.",
|
||||
file=sys.stderr,
|
||||
|
||||
Reference in New Issue
Block a user