fix: clamp server fps calculations
Browse filesCo-Authored-By: Claude Fable 5 <noreply@anthropic.com>
xvideo/serving/serve_joyomni_streaming.py
CHANGED
|
@@ -878,7 +878,7 @@ def create_app(args: argparse.Namespace) -> FastAPI:
|
|
| 878 |
_wire_chunk = h264_stream is not None or (
|
| 879 |
encoded_frames and isinstance(encoded_frames[0], (bytes, bytearray))
|
| 880 |
)
|
| 881 |
-
_fps = float(args.fps)
|
| 882 |
_outstanding = None
|
| 883 |
if _wire_chunk and flow["recv"] is not None and (time.time() - flow["at"]) < 5.0:
|
| 884 |
_outstanding = max(0, (frames_out - int(flow.get("base") or 0)) - int(flow["recv"]))
|
|
@@ -1409,7 +1409,7 @@ def create_app(args: argparse.Namespace) -> FastAPI:
|
|
| 1409 |
fg_stable = max(1, int(payload.get("fg_stable_frames", args.face_gate_stable_frames)))
|
| 1410 |
fg_absent = max(1, int(args.presence_absent_frames))
|
| 1411 |
fg_return = max(1, int(args.presence_return_frames))
|
| 1412 |
-
_gate_fps = float(payload.get("fps") or args.fps or 24.0)
|
| 1413 |
_fscale = _gate_fps / 24.0
|
| 1414 |
fg_stable = max(1, int(round(fg_stable * _fscale)))
|
| 1415 |
fg_absent = max(1, int(round(fg_absent * _fscale)))
|
|
|
|
| 878 |
_wire_chunk = h264_stream is not None or (
|
| 879 |
encoded_frames and isinstance(encoded_frames[0], (bytes, bytearray))
|
| 880 |
)
|
| 881 |
+
_fps = max(1.0, float(args.fps))
|
| 882 |
_outstanding = None
|
| 883 |
if _wire_chunk and flow["recv"] is not None and (time.time() - flow["at"]) < 5.0:
|
| 884 |
_outstanding = max(0, (frames_out - int(flow.get("base") or 0)) - int(flow["recv"]))
|
|
|
|
| 1409 |
fg_stable = max(1, int(payload.get("fg_stable_frames", args.face_gate_stable_frames)))
|
| 1410 |
fg_absent = max(1, int(args.presence_absent_frames))
|
| 1411 |
fg_return = max(1, int(args.presence_return_frames))
|
| 1412 |
+
_gate_fps = max(1.0, float(payload.get("fps") or args.fps or 24.0))
|
| 1413 |
_fscale = _gate_fps / 24.0
|
| 1414 |
fg_stable = max(1, int(round(fg_stable * _fscale)))
|
| 1415 |
fg_absent = max(1, int(round(fg_absent * _fscale)))
|