Skip to content

Reverse-engineer any video, shot by shot: filmed, AI-generated or coded, and how to remake it. Breakdowns in the open VIDEO.md format. 逆向一切视频,逐个镜头看是拍的、AI 生成的还是代码做的,再告诉你怎么复刻;拆解结果按 VIDEO.md 格式输出。

fmt_time: carry rounded-up seconds into the minutes

Nurlan Mammadli8fae330148b6
diff --git a/rea_video/util.py b/rea_video/util.py
index 7820969..f384ad8 100644
--- a/rea_video/util.py
+++ b/rea_video/util.py
@@ -159,9 +159,10 @@ def load_env_files(paths: Iterable[str | Path]) -> list[str]:
def fmt_time(seconds: float) -> str:
- seconds = max(0.0, float(seconds))
- m, s = divmod(seconds, 60)
- return f"{int(m):02d}:{s:06.3f}"
+ """MM:SS.mmm. Rounds to milliseconds before splitting off the minutes, so 59.9996 is 01:00.000, not 00:60.000."""
+ ms = round(max(0.0, float(seconds)) * 1000)
+ m, ms = divmod(ms, 60_000)
+ return f"{m:02d}:{ms / 1000:06.3f}"
def clamp(x: float, lo: float, hi: float) -> float: