consisten one behind

This commit is contained in:
2026-04-03 11:36:59 -03:00
parent 741bf995a8
commit 101ed10ca1
2 changed files with 5 additions and 12 deletions

View File

@@ -97,13 +97,13 @@ def receive_record_relay_and_detect(stream_url, output_path, relay_url,
)
# Scene detection: CUDA decode (GPU) → select filter (CPU, lightweight)
# → showinfo → MJPEG piped to stdout (avoids image2 muxer one-frame buffer)
# → showinfo → MJPEG piped to stdout
select_expr = f"gt(scene,{scene_threshold})"
scene_stream = stream.filter("select", select_expr).filter("showinfo")
scene_out = ffmpeg.output(
scene_stream, "pipe:1",
f="image2pipe", vcodec="mjpeg",
vsync="vfr", flush_packets=1, **{"q:v": "2"},
flush_packets=1, **{"q:v": "2", "fps_mode": "passthrough"},
)
return ffmpeg.merge_outputs(file_out, relay_out, scene_out).global_args(*GLOBAL_ARGS)