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 格式输出。

Tighten how survey cuts join a measured transition

june763673b5e531
diff --git a/rea_video/survey.py b/rea_video/survey.py
index 3c698d8..a161c05 100644
--- a/rea_video/survey.py
+++ b/rea_video/survey.py
@@ -1022,13 +1022,18 @@ def build_timeline(track: FrameTrack, shots: list[Shot], found: dict, meta: dict
# (whip, dissolve, ...) where the transition starts is the same change, seen from its first frame
at_edge = [c for c in cuts if c not in inside and c["span"][0] - edge <= t <= c["span"][1] + edge and c["span"][1] > c["span"][0]
and not (s.transition_in not in (None, "cut", "start", "flash") and t <= c["span"][0] + edge)]
- # hard cuts the survey called inside a gradual transition the detector measured (a dissolve, a fade, a wipe)
- # are that transition, seen on small tiles: one boundary, at the detector's frame, with its kind and span
+ # hard cuts the survey called inside a transition the detector measured (a dissolve, a fade, a wipe, ...) are
+ # that transition, seen on small tiles: one boundary, at the detector's frame, with its kind and span. Only the
+ # frames the transition changes (its first blended frame to the first frame after it): a cut later than that
+ # is a change of its own next to it
tr = s.transition if s.transition_in not in (None, "start", "cut", "jump", "flash") else {}
if tr and "start_frame" in tr and "end_frame" in tr:
- a, z = _t(track, int(tr["start_frame"])), _t(track, int(tr["end_frame"]))
- own = [c for c in cuts if c["by"] == "survey" and c["span"][1] - c["span"][0] <= 2 * edge and a - edge <= c["t"] <= z + edge]
- if own:
+ fa, fz = int(tr["start_frame"]), int(tr["end_frame"])
+ a, z = _t(track, fa), _t(track, fz)
+ own = [c for c in cuts if c["by"] == "survey" and c["span"][1] - c["span"][0] <= 2 * edge and fa < c["frame"] <= fz + 1]
+ if own and inside: # the survey's own transition over it takes the detector's frame below
+ cuts[:] = [c for c in cuts if not any(c is o for o in own)]
+ elif own:
own[0].update(frame=s.start_frame, t=round(t, 3), kind=s.transition_in, span=[round(a, 3), round(z, 3)], by="survey+tool")
own[0].pop("unsure", None)
cuts[:] = [c for c in cuts if not any(c is o for o in own[1:])]