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 格式输出。
Python agent-skillsai-videoaigc-detectionclaude-codecodexffmpegprompt-engineeringremotionreverse-engineeringshort-videoshot-detectionsubtitlesvideo-analysisvideo-breakdownvideo-editingvideo-generationvideomdvlm
Carry acting into English prompts
june2b9175403d31
diff --git a/rea_video/performance.py b/rea_video/performance.pyindex ff20d08..d75fbf1 100644--- a/rea_video/performance.py+++ b/rea_video/performance.py@@ -30,7 +30,8 @@ GUIDE = """画面里有人物、动物、卡通角色或数字人在表演(脸- body:头、肩、手、姿态、呼吸(点头、歪头、耸肩、手捂嘴、身体前倾、深吸一口气)- arc:镜头里情绪有变化时按秒写,t 是相对镜头开头的秒:[{"t": 0.0, "state": "这一刻看得见的表情和动作"}];没变化写 []- voice:画面里的角色在这一镜开口(说话、笑、叹气)时写语气、语速、音量、停顿("压低声音,语速慢,句尾带笑");画外旁白或没人开口留空-- key:true = 表演是这一镜的看点(反应镜头、情绪爆发、反转时的表情),复刻时要专门保证"""+- key:true = 表演是这一镜的看点(反应镜头、情绪爆发、反转时的表情),复刻时要专门保证+- en:把 face、body、arc 合成一句英文,只写看得见的动作,不写情绪词("eyes slightly red, corners of the mouth pressed down; at 1.5s she looks up"),给英文提示词用;上面几项已经是英文时留空"""def intensity_code(v) -> str:@@ -58,7 +59,8 @@ def clean(v) -> dict | None:arc.append({"t": t, "state": _txt(a.get("state"), 80)})out = {"who": _txt(v.get("who"), 30), "emotion": _txt(v.get("emotion"), 20), "intensity": intensity_code(v.get("intensity")),"face": _txt(v.get("face")), "body": _txt(v.get("body")), "arc": sorted(arc, key=lambda a: a["t"])[:6],- "voice": _txt(v.get("voice"), 100), "key": v.get("key") is True or str(v.get("key")).lower() == "true"}+ "voice": _txt(v.get("voice"), 100), "key": v.get("key") is True or str(v.get("key")).lower() == "true",+ "en": _txt(v.get("en"), 240) if _txt(v.get("en"), 240).isascii() else ""}if not any(out[k] for k in ("emotion", "face", "body", "arc", "voice")):return Nonereturn out@@ -80,6 +82,26 @@ def _strength() -> dict[str, str]:"high": T("情绪外放,但五官不变形", "openly expressed, features stay natural")}+STRENGTH_EN = {"low": "very subtle, barely visible", "mid": "moderate, not exaggerated", "high": "openly expressed, features stay natural"}+++def prompt_line_en(p: dict | None) -> str:+ """The acting for the English prompt: the reader's English sentence, or the fields themselves when they are+ already English. Chinese cues are never mixed into an English prompt."""+ if not p:+ return ""+ body = p.get("en") or ""+ if not body:+ bits = [x for x in (p.get("face"), p.get("body")) if x]+ bits += [f"at the start {a['state']}" if a["t"] < 0.05 else f"at {a['t']:.1f}s {a['state']}" for a in p.get("arc") or []]+ body = "; ".join(bits)+ if not body.isascii():+ return ""+ if not body:+ return ""+ return "Acting" + (f" ({STRENGTH_EN[p['intensity']]})" if p.get("intensity") else "") + ": " + body++def prompt_line(p: dict | None) -> str:"""The acting as prompt words: visible cues, strength and the change over time; no bare emotion word."""if not p:diff --git a/rea_video/plan.py b/rea_video/plan.pyindex d526fc7..2d6667b 100644--- a/rea_video/plan.py+++ b/rea_video/plan.py@@ -92,18 +92,19 @@ def _where(cx: float | None, cy: float | None) -> tuple[str, str] | None:f"subject in the {(v[1] + ' ') if v[1] else ''}{h[1]} of the frame".replace("upper centre", "upper middle").replace("lower centre", "lower middle")-def with_acting(prompt: str, act: dict | None, image: bool = False) -> str:+def with_acting(prompt: str, act: dict | None, image: bool = False, en: bool = False) -> str:"""Add the visible acting (face, body, change over time, strength) to a shot prompt, unless the prompt already- carries it. Readers' prompts tend to name the emotion or leave the face out, which gives a flat or mask-like remake."""- from .performance import image_line, prompt_line+ carries it. Readers' prompts tend to name the emotion or leave the face out, which gives a flat or mask-like remake.+ en=True: the English prompt, which only takes English acting words."""+ from .performance import image_line, prompt_line, prompt_line_en- line = image_line(act) if image else prompt_line(act)+ line = prompt_line_en(act) if en else image_line(act) if image else prompt_line(act)if not prompt or not line:return prompt- cue = (act or {}).get("face") or ""+ cue = ((act or {}).get("en") or "") if en else ((act or {}).get("face") or "")if cue and cue in prompt:return prompt- end = "" if prompt.rstrip().endswith(("。", ".", ";", ";")) else T("。", ". ")+ end = "" if prompt.rstrip().endswith(("。", ".", ";", ";")) else ". " if en else T("。", ". ")return prompt.rstrip() + end + line@@ -325,7 +326,7 @@ class Planner:plan["capsule"] = {"engine": engine, "generation_type": gen_type, "duration": gen_dur,"trim_to": round(dur, 3), "aspect_ratio": video.get("aspect_ratio", "9:16"),- "prompt": with_acting(_with_framing(prompt, fw), act), "prompt_en": _with_framing(rep.get("video_prompt_en", ""), fw_en),+ "prompt": with_acting(_with_framing(prompt, fw), act), "prompt_en": with_acting(_with_framing(rep.get("video_prompt_en", ""), fw_en), act, en=True),"image_prompt": with_acting(_with_framing(rep.get("image_prompt", ""), still), act, image=True), "framing": fw,"needs_split": dur > hi,}diff --git a/rea_video/production.py b/rea_video/production.pyindex 45adacd..b567dfb 100644--- a/rea_video/production.py+++ b/rea_video/production.py@@ -417,7 +417,8 @@ def _unit(seg: list[dict], k: int, lim: dict, model: dict | None, style: str, caacc = zlines.append(T("镜头{i}({a:.1f}–{z:.1f}s):{text}", "Shot {i} ({a:.1f}–{z:.1f}s): {text}", i=i, a=a, z=z, text=text) if len(seg) > 1 else text)if p.get("video_prompt_en"):- lines_en.append(f"Shot {i} ({a:.1f}-{z:.1f}s): {p['video_prompt_en']}" if len(seg) > 1 else p["video_prompt_en"])+ en = with_acting(p["video_prompt_en"], act, en=True)+ lines_en.append(f"Shot {i} ({a:.1f}-{z:.1f}s): {en}" if len(seg) > 1 else en)parts = 1if len(seg) == 1 and dur > lim["max"]:parts = int(-(-dur // lim["max"]))diff --git a/rea_video/review.py b/rea_video/review.pyindex 786248b..bcc53e8 100644--- a/rea_video/review.py+++ b/rea_video/review.py@@ -13,7 +13,7 @@ from . import aspects, narrative, performancefrom .narrative import ROLE_GUIDEfrom .vlm import SHOT_PROMPT, shot_hints-PERF_TEMPLATE = {"who": "", "emotion": "", "intensity": "", "face": "", "body": "", "arc": [], "voice": "", "key": False}+PERF_TEMPLATE = {"who": "", "emotion": "", "intensity": "", "face": "", "body": "", "arc": [], "voice": "", "key": False, "en": ""}SHOOT_LIKE = ("live_action", "avatar", "stop_motion", "film_footage") # shots where "how was it shot / lit" appliesAGENT_WEIGHT = 0.85 # agent answers are softened toward uniform before fusionIMAGE_SOURCES = ("ai_image", "photo", "graphic", "screenshot", "unknown")diff --git a/rea_video/vlm.py b/rea_video/vlm.pyindex 2c1c08b..21d19ba 100644--- a/rea_video/vlm.py+++ b/rea_video/vlm.py@@ -349,7 +349,7 @@ AI 仿定格风格(材质在帧间漂移)与真正的定格动画(同一"material_origin": "real|ai_generated|rendered|mixed(画面主要来自真实素材 / AI 生成 / 制作方渲染 / 混合)","embedded_assets": [{{"kind": "real_footage|photo|screenshot|screen_recording|product_photo|logo|ai_image", "description": "是什么、在画面哪里", "is_real_material": true}}],"ai_edits": [{{"kind": "face_swap|lip_sync|restyle|outfit_swap|bg_replace|object_edit|beautify", "evidence": "看到的破绽"}}],- "performance": {{"who": "", "emotion": "", "intensity": "low|mid|high", "face": "", "body": "", "arc": [], "voice": "", "key": false}},+ "performance": {{"who": "", "emotion": "", "intensity": "low|mid|high", "face": "", "body": "", "arc": [], "voice": "", "key": false, "en": ""}},"replication": {{"image_prompt": "复刻首帧的中文图像提示词(主体、构图、光线、风格,具体可执行;有人物时写首帧的表情)","video_prompt": "复刻该镜头的中文视频提示词:写清动作过程和结束状态、运镜;人物表演写看得见的表情和动作(眼、眉、嘴、头、手),不写「开心」「难过」这类情绪词,幅度宁小勿大;只写想要的内容,不写否定句",diff --git a/tests/test_performance.py b/tests/test_performance.pyindex a6baaf2..2787364 100644--- a/tests/test_performance.py+++ b/tests/test_performance.py@@ -72,3 +72,20 @@ def test_generation_unit_prompt_and_report_use_the_acting(tmp_path):{"start": 0.2, "end": 1.0, "speaker": "A", "text": "你听我说", "delivery": "急促"}]}}assert [ln.get("delivery") for ln in script(b)] == ["压低声音,句尾带哭腔", "急促"]json.dumps(plan, ensure_ascii=False)+++def test_english_prompt_gets_english_acting_only(tmp_path):+ set_lang("zh")+ act = performance.clean(ACT)+ assert act["en"] == "" and performance.prompt_line_en(act) == "" # Chinese cues never go into the English prompt+ assert with_acting("She stands by the window.", act, en=True) == "She stands by the window."+ act_en = performance.clean(dict(ACT, en="eyes slightly red, mouth corners pressed down; at 1.5s she looks up"))+ line = with_acting("She stands by the window", act_en, en=True)+ assert line == "She stands by the window. Acting (very subtle, barely visible): eyes slightly red, mouth corners pressed down; at 1.5s she looks up"+ assert performance.clean(dict(ACT, en="眼眶微红"))["en"] == "" # a non-English "en" is dropped+ english = performance.clean({"face": "brows drawn together", "arc": [{"t": 0.5, "state": "glances away"}], "intensity": "mid"})+ assert performance.prompt_line_en(english) == "Acting (moderate, not exaggerated): brows drawn together; at 0.5s glances away"+ shots = [_shot(1, 0.0, 2.0, "ai_video", KITCHEN, tmp_path), _shot(2, 2.0, 2.0, "ai_video", KITCHEN, tmp_path)]+ shots[1]["review"] = {"performance": act_en}+ u = production_plan(_b(shots), tmp_path)["units"][0]+ assert "Shot 2 (2.0-4.0s): shot 2. Acting (very subtle" in u["prompt_en"] and "眼眶" not in u["prompt_en"]