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

新增「影视片段」类别:影视解说、混剪、名场面合集按剪进来的影视剧画面判,黑边版式只测框内画面,工具给黑边、24/25fps 源、《片名》线索并标待确认,复刻方案给找原片剪辑;新增影视片段评测集

juneb847d94b4131
diff --git a/docs/what-it-detects.md b/docs/what-it-detects.md
index aec5b35..fe0f92f 100644
--- a/docs/what-it-detects.md
+++ b/docs/what-it-detects.md
@@ -2,16 +2,17 @@
## 画面是怎么做出来的
-每个镜头判成下面 10 类之一。「工具能测」表示离线、不看图也能判断;其余的要靠看图模型或 agent 看画面。
+每个镜头判成下面 11 类之一。「工具能测」表示离线、不看图也能判断;其余的要靠看图模型或 agent 看画面。
| 类别 | 常见例子 | 工具能测 | 评测视频数 |
|---|---|---|---|
| 实拍 | 口播、vlog、带货、探店 | ✓ | 5 |
-| AI 生成视频 | 文生 / 图生视频、AI 短剧 | ✓ | 23 |
+| AI 生成视频 | 文生 / 图生视频、AI 短剧 | ✓ | 24 |
| 数字人 | 一张人像被声音驱动说话 | 部分 | 0 |
| 3D 渲染 | Blender / C4D 科普、产品动画 | ✓ | 14 |
| 2D 动画 | 手绘、Live2D、AE 角色动画 | ✗ 看图 | 0 |
| 定格动画 | 黏土、毛毡、纸偶逐帧拍摄 | ✗ 看图 | 0 |
+| 影视片段 | 影视解说、混剪、名场面合集里剪进来的电影 / 电视剧 / 短剧画面 | ✗ 看图(工具只给线索) | 8 |
| 代码 / 模板 | 文字动效、UI、图表、PPT 式卡片 | ✓ | 16 |
| 录屏 / 截图 | 软件操作、网页 | ✓ | 11 |
| 静图推拉 | 一张图做缩放平移 | ✓ | 3 |
diff --git a/eval/film.yaml b/eval/film.yaml
new file mode 100644
index 0000000..4228ce6
--- /dev/null
+++ b/eval/film.yaml
@@ -0,0 +1,68 @@
+# 影视片段评测集:影视解说、混剪、名场面合集(剪进来的电影 / 电视剧 / 短剧画面),外加一条 AI 短剧解说作反例
+# 视频不入库(eval/media/ 已 gitignore):用 TikHub 抖音搜索(douyin_search_fetch_video_search_v2)找到,
+# douyin_app_v3_fetch_one_video_v3 取地址下载到 eval/media/film/;bit_rate 里 is_h265=2 的档位 ffmpeg 解不了,改用 play_addr_265
+# 真值来源:人工看联系表目测 + 视频标题和画面上的片名;没有生产记录,属于目测真值。
+# 影视片段在像素上就是摄影机拍的画面,工具只给线索(黑边版式、24/25fps 源、《》片名)、不下结论,
+# 所以只开工具时这一组的准确率预期很低,要看「标出待确认」的比例和看图复核后的准确率。
+videos:
+ - id: film_hk_kungfu_beat
+ path: eval/media/film/hk_kungfu_beat.mp4
+ source: 抖音 武术指导《以武为舞,便是最好的节奏!》aweme 7615916888199007514;港片功夫打斗踩点混剪,横屏 720p 30fps
+ label: film_footage
+ real_material: true
+
+ - id: film_gunshot_beat
+ path: eval/media/film/gunshot_beat.mp4
+ source: 抖音 可乐丶《听着很暖和,看着有点爽。数一下多少颗子弹?》aweme 7549583051311926568;欧美枪战电影枪声卡点混剪
+ label: film_footage
+ real_material: true
+
+ - id: film_kdrama_fight
+ path: eval/media/film/kdrama_fight.mp4
+ source: 抖音 一种感觉《拳拳到肉,战力值拉满》aweme 7702034302736861403;韩剧打斗混剪,20 秒;最后 0.7 秒是黑底光条片尾
+ segments:
+ - [0.000, 19.500, film_footage]
+ - [19.500, 20.200, [code_render, static_hold, film_footage]]
+ real_material: true
+
+ - id: film_tvdrama_scenes
+ path: eval/media/film/tvdrama_scenes.mp4
+ source: 抖音 月下栖梧楼《盘点影视剧中为爱退让的名场面》aweme 7699064909601967414;国产古装/现代剧名场面合集,每段左上角标「年份 ·《剧名》」,25fps;开头 2.6 秒是黑底文字卡,中间的白闪是转场
+ segments:
+ - [0.000, 2.600, [code_render, static_hold]]
+ - [2.600, 106.600, film_footage]
+ real_material: true
+
+ - id: film_kangri_funny
+ path: eval/media/film/kangri_funny.mp4
+ source: 抖音 晓洋嘚吧嘚《搞笑名场面经典回顾》aweme 7663357679745748250;抗日题材电视剧片段 + 配音吐槽,左上角账号水印;中间插了 0.4 秒彩条卡,末尾「点赞 转发 关注」叠在剧集画面上
+ segments:
+ - [0.000, 72.600, film_footage]
+ - [72.600, 73.000, [code_render, static_hold]]
+ - [73.000, 166.600, film_footage]
+ real_material: true
+
+ - id: film_vertical_recap
+ path: eval/media/film/vertical_movie_recap.mp4
+ source: 抖音 好气人 电影解说 aweme 7345728948321504547;竖屏 9:16,16:9 电影画面嵌在黑边里,顶部「点个关注吧」,画面下方解说字幕
+ label: film_footage
+ real_material: true
+
+ - id: film_french_comedy_recap
+ path: eval/media/film/french_comedy_recap_90s.mp4
+ source: 抖音 猛虎电影《法国搞笑三人组新作》aweme 7660900818614324490 的前 90 秒(原片 35 分钟,ffmpeg -c copy 截取);法国喜剧电影解说,24→30
+ label: film_footage
+ real_material: true
+
+ - id: film_shortdrama_recap
+ path: eval/media/film/shortdrama_recap.mp4
+ source: 抖音 秋刀鱼(短剧解说)aweme 7619686582341895311;真人竖屏短剧(剧组拍摄)的解说剪辑,29.97fps
+ label: film_footage
+ real_material: true
+
+ # 反例:AI 生成的短剧做的解说,版式和真人短剧解说一样(《片名》、「影视效果」免责声明),画面是 AI 生成
+ - id: film_ai_shortdrama_recap
+ path: eval/media/film/ai_shortdrama_recap.mp4
+ source: 抖音 老北观影 aweme 7704868350626680115,话题 #ai短剧;人物脸过于完美、千人一面,25fps
+ label: ai_video
+ real_material: false
diff --git a/rea_video/aspects/base.py b/rea_video/aspects/base.py
index 8788712..8011695 100644
--- a/rea_video/aspects/base.py
+++ b/rea_video/aspects/base.py
@@ -24,8 +24,8 @@ from ..i18n import T
# shots whose picture is photographic enough for camera / light analysis. Live action gets a shooting plan; AI, 3D
# and avatar shots get the same measurements as a description of the picture (useful for generation prompts).
-PHOTOGRAPHIC = ("live_action", "avatar", "ai_video", "cg_3d", "stop_motion")
-FILMED = ("live_action", "avatar", "stop_motion")
+PHOTOGRAPHIC = ("live_action", "avatar", "ai_video", "cg_3d", "stop_motion", "film_footage")
+FILMED = ("live_action", "avatar", "stop_motion", "film_footage")
@dataclass
diff --git a/rea_video/assets.py b/rea_video/assets.py
index 2850af4..2e241c3 100644
--- a/rea_video/assets.py
+++ b/rea_video/assets.py
@@ -24,10 +24,12 @@ KIND_ZH = LangDict({
"real_footage": "实拍视频素材", "photo_or_image": "照片/图片素材", "screenshot": "界面截图",
"screen_recording": "录屏素材", "video_clip": "嵌入视频片段", "ai_generated": "AI 生成", "rendered": "制作方渲染",
"photo": "真实照片", "ai_image": "AI 生成图", "graphic": "设计图形", "logo": "Logo/品牌标识", "product_photo": "商品实拍图",
+ "film_clip": "影视原片片段",
}, en={
"real_footage": "live footage", "photo_or_image": "photo / image", "screenshot": "UI screenshot",
"screen_recording": "screen recording", "video_clip": "embedded video clip", "ai_generated": "AI-generated", "rendered": "rendered by the creator",
"photo": "photo", "ai_image": "AI-generated image", "graphic": "designed graphic", "logo": "logo / brand mark", "product_photo": "product photo",
+ "film_clip": "clip from a film / series",
})
REF_ZH = LangDict({"product_photo": "商品参考图", "logo": "Logo/品牌参考", "photo": "人物/场景参考图", "real_footage": "动作/场景参考视频",
"screenshot": "界面参考图", "screen_recording": "界面参考录屏", "video_clip": "参考视频", "photo_or_image": "参考图"},
@@ -38,10 +40,11 @@ REF_ZH = LangDict({"product_photo": "商品参考图", "logo": "Logo/品牌参
GENERATED_BASES = ("ai_video", "avatar")
# a 3D render can still carry a pasted screenshot or recording; products / logos / people in it are modelled
RENDER_REF_KINDS = ("product_photo", "logo", "photo", "real_footage", "ai_image")
-ORIGIN_ZH = LangDict({"real": "用户真实素材", "ai_generated": "AI 生成", "rendered": "制作方渲染", "mixed": "混合(含真实素材)", "unknown": "待确认"},
+ORIGIN_ZH = LangDict({"real": "用户真实素材", "ai_generated": "AI 生成", "rendered": "制作方渲染", "mixed": "混合(含真实素材)",
+ "third_party": "影视原片(版权属于片方)", "unknown": "待确认"},
en={"real": "the user's real material", "ai_generated": "AI-generated", "rendered": "rendered by the creator",
- "mixed": "mixed (includes real material)", "unknown": "to confirm"})
-REAL_KINDS = {"real_footage", "photo_or_image", "screenshot", "screen_recording", "video_clip", "photo", "logo", "product_photo"}
+ "mixed": "mixed (includes real material)", "third_party": "film / TV source (rights belong to the studio)", "unknown": "to confirm"})
+REAL_KINDS = {"real_footage", "photo_or_image", "screenshot", "screen_recording", "video_clip", "photo", "logo", "product_photo", "film_clip"}
def _entropy(gray_block: np.ndarray) -> float:
@@ -209,6 +212,9 @@ def material_summary(label: str, image_source: str | None, embedded: list[dict],
items: list[dict] = []
if label == "live_action":
items.append({"kind": "real_footage", "region": "full", "real_material": True})
+ elif label == "film_footage":
+ # the original clip is the material: a remake needs the source file (and the right to use it)
+ items.append({"kind": "film_clip", "region": "full", "real_material": True})
elif label == "screen_capture":
items.append({"kind": "screen_recording" if moving and image_source != "screenshot" else "screenshot", "region": "full", "real_material": True})
elif label in ("static_hold", "still_motion"):
@@ -229,11 +235,11 @@ def material_summary(label: str, image_source: str | None, embedded: list[dict],
continue
kind = e.get("kind", "photo_or_image")
desc = e.get("description", "")
- if label in GENERATED_BASES or (label == "cg_3d" and kind in RENDER_REF_KINDS) or label == "live_action":
+ if label in GENERATED_BASES or (label == "cg_3d" and kind in RENDER_REF_KINDS) or label in ("live_action", "film_footage"):
# generated / modelled / filmed pixels: the product or person is something to supply as a reference
# (for live action the whole frame is already real footage)
# camera footage "in" a generated or filmed picture is not something a remake can be given
- if kind not in ("ai_image", "real_footage", "video_clip") and (label != "live_action" or kind in ("product_photo", "logo")):
+ if kind not in ("ai_image", "real_footage", "video_clip") and (label not in ("live_action", "film_footage") or kind in ("product_photo", "logo")):
refs.append({"kind": kind, "kind_zh": REF_ZH.get(kind, T("参考素材", "reference material")), "description": desc, "source": "vlm"})
continue
if kind == "real_footage":
@@ -248,6 +254,8 @@ def material_summary(label: str, image_source: str | None, embedded: list[dict],
base = "rendered"
elif label in ("live_action", "screen_capture"):
base = "real"
+ elif label == "film_footage":
+ base = "third_party"
elif image_source == "ai_image":
base = "ai_generated"
elif image_source == "graphic":
diff --git a/rea_video/capabilities/routing.yaml b/rea_video/capabilities/routing.yaml
index 3573e4f..892af08 100644
--- a/rea_video/capabilities/routing.yaml
+++ b/rea_video/capabilities/routing.yaml
@@ -33,6 +33,7 @@ signals:
static_hold: {detected_by: [analyze.shot_boundary], desc: 静帧定格(图片或卡片停留)}
anim_2d: {detected_by: [analyze.video_understanding], desc: 2D 动画(手绘逐帧、Live2D、AE/Spine 角色动画),工具测不出,靠看图}
stop_motion: {detected_by: [analyze.video_understanding], desc: 定格动画(实物/黏土/纸偶逐帧拍摄),工具测不出,靠看图}
+ film_footage: {detected_by: [analyze.video_understanding, analyze.ocr_text_track], desc: 剪进来的电影/电视剧/短剧画面(影视解说、混剪、名场面),像素上和实拍、AI 分不开,工具只给线索(黑边版式、24/25fps 源、《》片名),靠看图}
ai_edited_footage: {detected_by: [analyze.video_understanding], desc: 实拍画面被 AI 二次加工(换脸、对口型、风格化、换装、换背景)}
# ---------------------------------------------------------------- 拆分
@@ -213,6 +214,14 @@ rules:
verify: [perceptual_similarity]
why: 首选真的拍:手机固定 + 定格 App 每秒 12 张;AI 生成只能近似定格的顿挫感,提示词写明 stop-motion、12fps
+ - id: R21-film-footage
+ layer: base
+ when: [film_footage]
+ route: [render.compose]
+ prefer: [ffmpeg]
+ verify: [perceptual_similarity]
+ why: 画面来自已有影视作品,复刻是找到原片对应片段再剪(版权属于片方,商用要授权);不用原片时按同样景别、机位、打光自己拍,或用 AI 近似(R07)
+
- id: R16-dialogue-coupled
layer: base
when: [dialogue_coupled]
diff --git a/rea_video/classify.py b/rea_video/classify.py
index 1334066..bb14537 100644
--- a/rea_video/classify.py
+++ b/rea_video/classify.py
@@ -11,8 +11,10 @@ Base layer labels (what produced the moving picture of the shot):
static_hold 静帧停留(图片或卡片定格,无运动)
anim_2d 2D 动画(手绘逐帧、Live2D、AE/Spine 角色动画、Flash 风格)
stop_motion 定格动画(实物/黏土/纸偶逐帧拍摄)
-The last two have no pixel test yet (held frames "on twos" look like a frame-rate conversion); only an image reader
-(VLM or agent) can call them, see UNMEASURED.
+ film_footage 影视片段(剪进来的电影、电视剧、短剧画面:影视解说、混剪、名场面)
+anim_2d / stop_motion have no pixel test yet (held frames "on twos" look like a frame-rate conversion); film_footage is
+camera footage like any other, so pixels cannot tell who shot it (the tools only collect hints: letterbox, 24/25fps
+source, a 《title》 on screen). Only an image reader (VLM or agent) can call these three, see UNMEASURED.
Overlays (composited on top): subtitle / title / label text, static graphics, layout template.
Deterministic evidence is decisive for *temporal* questions (is anything moving? is the
@@ -28,9 +30,9 @@ from difflib import SequenceMatcher
from .i18n import LangDict, T, join
LABELS = ["live_action", "ai_video", "avatar", "cg_3d", "code_render", "screen_capture", "still_motion", "static_hold",
- "anim_2d", "stop_motion"]
+ "anim_2d", "stop_motion", "film_footage"]
# labels the deterministic layer cannot score: decided by image readers only (see pipeline._vlm_gate)
-UNMEASURED = ("anim_2d", "stop_motion")
+UNMEASURED = ("anim_2d", "stop_motion", "film_footage")
LABEL_ZH = LangDict({
"live_action": "实拍",
"ai_video": "AI 生成视频",
@@ -42,6 +44,7 @@ LABEL_ZH = LangDict({
"static_hold": "静帧停留",
"anim_2d": "2D 动画",
"stop_motion": "定格动画",
+ "film_footage": "影视片段",
}, en={
"live_action": "live action",
"ai_video": "AI-generated video",
@@ -53,12 +56,14 @@ LABEL_ZH = LangDict({
"static_hold": "static hold",
"anim_2d": "2D animation",
"stop_motion": "stop motion",
+ "film_footage": "film / TV footage",
})
IMAGE_SOURCE_ZH = LangDict({"ai_image": "AI 生成图", "photo": "真实照片", "graphic": "设计/渲染图形", "screenshot": "截图", "unknown": "未知"},
en={"ai_image": "AI-generated image", "photo": "photo", "graphic": "designed / rendered graphic", "screenshot": "screenshot", "unknown": "unknown"})
# how much to trust the deterministic layer per label (VLM weight is 1.0)
DET_WEIGHT = {"static_hold": 1.6, "still_motion": 1.4, "code_render": 1.0, "screen_capture": 0.6,
- "cg_3d": 0.5, "live_action": 0.6, "ai_video": 0.6, "avatar": 0.4, "anim_2d": 0.3, "stop_motion": 0.3}
+ "cg_3d": 0.5, "live_action": 0.6, "ai_video": 0.6, "avatar": 0.4, "anim_2d": 0.3, "stop_motion": 0.3,
+ "film_footage": 0.3}
# weight of the model's opinion (VLM or an agent's review) relative to the deterministic layer
@@ -111,6 +116,30 @@ RULES = {
}
+FILM_HINT_ZH = LangDict({"letterbox": "画面嵌在上下或左右的黑边里(影视解说常见的版式)",
+ "source_24": "素材是 24/25fps 源(电影、电视剧的帧率;AI 视频也常是这个帧率)",
+ "title_mark": "画面上有《》书名号标注的片名"},
+ en={"letterbox": "the picture sits inside black bars (the usual film-recap layout)",
+ "source_24": "the source is 24/25fps (the frame rate of films and TV; AI video often uses it too)",
+ "title_mark": "a title in 《》 brackets is on screen"})
+TITLE_MARK = re.compile(r"《[^《》]{1,24}》")
+
+
+def film_hints(f: dict, text: dict | None, fps: float | None, pulldown: str | None) -> list[str]:
+ """Hints that a photographic shot was cut from a film / series. letterbox: the picture inside fixed black bars,
+ wider than tall (features.picture_box). source_24: a 24/25fps source, pulled up to 30 or native. title_mark: a
+ 《title》 on screen. source_24 alone is the AI-video signature too, so it only counts next to another hint."""
+ out = []
+ if f.get("picture_box") and f.get("picture_aspect", 0) >= 1.3:
+ out.append("letterbox")
+ if any(TITLE_MARK.search(t) for tr in (text or {}).get("tracks", []) for t in tr.get("texts", [])):
+ out.append("title_mark")
+ native_film_rate = bool(fps and (23.5 <= fps <= 25.5) and f.get("dup_ratio", 1) < 0.05)
+ if out and (pulldown in ("24→30", "24→60", "25→30?") or native_film_rate):
+ out.append("source_24")
+ return out
+
+
def lowlight_photo(f: dict, faces: float = 0.0) -> bool:
"""Dim footage with a person in it (see RULES["lowlight"]): crushed shadows shrink the palette and add flat
blocks, so the "rendered texture" cues do not apply."""
@@ -140,8 +169,13 @@ def video_context(shots: list[dict], provenance: dict | None, fps: float | None)
if f.get("dup_ratio", 1) < 0.02 and f.get("sharp_period_ac", 0) < 0.45:
native_dur += d
native30 = bool(fps and 29 <= fps <= 31 and photo_dur >= 3 and native_dur / photo_dur >= 0.7)
+ # photographic time carrying a film / TV hint (letterbox, 《title》): a film recap or compilation looks like this
+ film_dur = sum(float(r.get("duration", 0)) for r in shots
+ if (r.get("features") or {}).get("palette95", 0) >= 100 and film_hints(r.get("features") or {}, r.get("text"), fps, None))
+ total = sum(float(r.get("duration", 0)) for r in shots) or 1.0
return {"transcoded": bool(plat), "platform": plat, "native30": native30,
- "native30_share": round(native_dur / photo_dur, 3) if photo_dur else None}
+ "native30_share": round(native_dur / photo_dur, 3) if photo_dur else None,
+ "film_hint_share": round(film_dur / total, 3)}
def deterministic(f: dict, overlay: dict | None = None, text: dict | None = None, faces: float = 0.0,
@@ -322,6 +356,16 @@ def deterministic(f: dict, overlay: dict | None = None, text: dict | None = None
"Duplicate frames follow a {pd} pattern ({dup:.0%}, period {per}): a 24/25fps source transcoded up, typical of AI-generated video, 3D / animation renders or cinema footage",
pd=pulldown, dup=dup, per=per))
+ # ---- film / TV footage hints -------------------------------------------------
+ # who shot the picture is not in the pixels (a film still is camera footage, an AI drama can look the same):
+ # these only say "this may be a clip cut from a film or series", the call is left to an image reader
+ hints = film_hints(f, text, fps, pulldown) if photo > 0.5 and family in ("dynamic", "mostly_static", "planar") else []
+ facts["film_hints"] = hints
+ if hints:
+ ev.append(T("影视片段线索:{h}。这些只说明可能是剪进来的影视剧画面,和 AI 视频、自己拍的实拍在像素上分不开,要看图确认",
+ "Film / TV footage hints: {h}. They only suggest a clip cut from a film or series; pixels cannot tell it from AI video "
+ "or self-shot footage, an image reader has to confirm", h=join(FILM_HINT_ZH[k] for k in hints)))
+
live_hint = 0.0
live_hint += 1.2 * _sig((noise - 0.9) / 0.2)
live_hint += 0.6 * _sig((tnoise - 0.8) / 0.15)
@@ -376,6 +420,7 @@ def deterministic(f: dict, overlay: dict | None = None, text: dict | None = None
# ---- assemble scores ---------------------------------------------------------
s = {k: 0.02 for k in LABELS}
+ s["film_footage"] = 0.0 # scored only from film hints below; a floor here would dilute every other label
if family == "frozen":
# a frozen *rendered* card is code/template output; a frozen photo/AI picture is a still hold
screenshot_like = graphic > 0.45 and axis > 0.42 and text_cov > 0.05
@@ -420,6 +465,9 @@ def deterministic(f: dict, overlay: dict | None = None, text: dict | None = None
s["avatar"] += 0.6 * photo * (1 if faces > 0.6 else 0.1) * (1.0 if speech else 0.4) * (1 - live_hint) * moving_cam
if pulldown:
s["cg_3d"] *= 1.2
+ if hints:
+ # a runner-up at most: enough to show up in the probabilities, never enough to win on hints alone
+ s["film_footage"] += 0.25 * photo * len(hints)
if gen_tags:
s["ai_video"] += 1.0
s["avatar"] += 0.3
@@ -440,7 +488,7 @@ def image_source_guess(f: dict, facts: dict) -> str:
# Fusion decides the group first, then the subtype inside it: when the tools say "AI video" and an agent says
# "digital avatar", both are votes for "generated" and must not be outvoted by a third source's "live action".
GROUPS = {"ai_video": "generated", "avatar": "generated", "cg_3d": "rendered", "code_render": "rendered", "anim_2d": "rendered",
- "stop_motion": "live_action"}
+ "stop_motion": "live_action", "film_footage": "live_action"}
def group_of(label: str) -> str:
@@ -467,13 +515,16 @@ def fuse(det: dict[str, float], vlm: dict[str, float] | None, family: str, major
# hard temporal constraints: a frozen shot cannot be a generated *video*
mult = {k: 1.0 for k in LABELS}
if family == "frozen":
- for k in ("ai_video", "live_action", "avatar", "cg_3d", "still_motion", "anim_2d", "stop_motion"):
+ for k in ("ai_video", "live_action", "avatar", "cg_3d", "still_motion", "anim_2d", "stop_motion", "film_footage"):
mult[k] = 0.05
if family == "planar":
- for k in ("live_action", "avatar"):
+ for k in ("live_action", "avatar", "film_footage"):
mult[k] = 0.2
- sub = {k: _log_pool(det.get(k, 0.0), vlm.get(k, 0.0), DET_WEIGHT[k]) * mult[k] for k in LABELS}
- raw = {k: _log_pool(det.get(k, 0.0), vlm.get(k, 0.0), DET_WEIGHT[k]) for k in LABELS}
+ # the tools cannot tell film / TV footage from self-shot footage (both are camera pictures), so inside the filmed
+ # group their live-action score stands for both and the image reader picks the subtype
+ pool_det = dict(det, film_footage=max(det.get("film_footage", 0.0), det.get("live_action", 0.0)))
+ sub = {k: _log_pool(pool_det.get(k, 0.0), vlm.get(k, 0.0), DET_WEIGHT[k]) * mult[k] for k in LABELS}
+ raw = {k: _log_pool(pool_det.get(k, 0.0), vlm.get(k, 0.0), DET_WEIGHT[k]) for k in LABELS}
dg, vg = _group_sum(det), _group_sum(vlm)
members: dict[str, list[str]] = {}
for k in LABELS:
diff --git a/rea_video/features.py b/rea_video/features.py
index 44de783..69e6c57 100644
--- a/rea_video/features.py
+++ b/rea_video/features.py
@@ -229,6 +229,96 @@ def _periodicity(flags: list[bool]) -> dict:
return {"period": period, "regularity": regularity}
+def _picture_run(lit: np.ndarray, gap: int) -> tuple[int, int] | None:
+ """Longest run of picture lines (rows or columns), bridging gaps of up to `gap` dark lines."""
+ idx = np.flatnonzero(lit)
+ if not len(idx):
+ return None
+ best, start, prev = (0, 0), idx[0], idx[0]
+ for i in list(idx[1:]) + [None]:
+ if i is not None and i - prev <= gap + 1:
+ prev = i
+ continue
+ if prev - start > best[1] - best[0]:
+ best = (start, prev)
+ if i is not None:
+ start = prev = i
+ return int(best[0]), int(best[1]) + 1
+
+
+def picture_box(frames: list[np.ndarray]) -> dict | None:
+ """A picture sitting inside black bars that stay put for the whole shot: a film or TV clip letterboxed into a
+ vertical frame (the usual 影视解说 layout, a title in the top bar and subtitles under the picture), or a
+ widescreen film inside a 16:9 frame. Returns the box (0-1 x, y, w, h) and its aspect ratio, or None.
+ A picture line is lit across most of its width in at least one sampled frame (a dark scene lights up somewhere
+ in the shot); a bar line is dark in every frame apart from text, which lights only a small part of a line."""
+ if len(frames) < 2:
+ return None
+ lit = np.stack([cv2.cvtColor(f, cv2.COLOR_BGR2GRAY) > 24 for f in frames])
+ h, w = lit.shape[1:]
+ # rows over the full width, then columns inside those rows, then rows again inside the columns
+ # (a picture filling a third of the height lights only a third of each column)
+ y0, y1, x0, x1 = 0, h, 0, w
+ for _ in range(2):
+ rr = _picture_run(lit[:, :, x0:x1].mean(axis=2).max(axis=0) > 0.6, max(1, h // 50))
+ if not rr:
+ return None
+ y0, y1 = rr
+ cr = _picture_run(lit[:, y0:y1, :].mean(axis=1).max(axis=0) > 0.6, max(1, w // 50))
+ if not cr:
+ return None
+ x0, x1 = cr
+ rows = lit[:, :, x0:x1].mean(axis=2).max(axis=0)
+ cols = lit[:, y0:y1, :].mean(axis=1).max(axis=0)
+ outside_r = np.concatenate([rows[:y0], rows[y1:]])
+ outside_c = np.concatenate([cols[:x0], cols[x1:]])
+ bars_r = (y0 + h - y1) / h
+ bars_c = (x0 + w - x1) / w
+ # bars must be real: wide enough, dark apart from text, and the picture edge sharp (a lit line right at the edge)
+ ok_r = bars_r >= 0.06 and (not len(outside_r) or np.median(outside_r) < 0.1) and min(rows[y0], rows[y1 - 1]) > 0.8
+ ok_c = bars_c >= 0.06 and (not len(outside_c) or np.median(outside_c) < 0.1) and min(cols[x0], cols[x1 - 1]) > 0.8
+ if not (ok_r or ok_c):
+ return None
+ if not ok_r:
+ y0, y1 = 0, h
+ if not ok_c:
+ x0, x1 = 0, w
+ if (y1 - y0) < 0.2 * h or (x1 - x0) < 0.2 * w:
+ return None
+ return {"box": [x0 / w, y0 / h, (x1 - x0) / w, (y1 - y0) / h], "aspect": (x1 - x0) / max(1, y1 - y0),
+ "bar_share": 1.0 - (x1 - x0) * (y1 - y0) / float(h * w)}
+
+
+def crop_box(frame: np.ndarray, box) -> np.ndarray:
+ """The part of a frame inside a 0-1 (x, y, w, h) box."""
+ H, W = frame.shape[:2]
+ x, y, w, h = box
+ return frame[int(y * H):int((y + h) * H), int(x * W):int((x + w) * W)]
+
+
+def photo_letterbox(frames: list[np.ndarray]) -> dict | None:
+ """picture_box(), kept only when the boxed picture is film / TV shaped (at least 4:3 wide) and looks photographic
+ (palette >= 100 colours). A rendered card on a black ground, or a portrait phone recording pasted on black
+ (a screen-capture layout, where the black surround is part of the evidence), keep their whole-frame statistics."""
+ pbox = picture_box(frames)
+ if not pbox or pbox["aspect"] < 1.3:
+ return None
+ pal = [spatial_features(c)["palette95"] for c in (crop_box(f, pbox["box"]) for f in frames)
+ if c.shape[0] >= 16 and c.shape[1] >= 16]
+ return pbox if pal and np.median(pal) >= 100 else None
+
+
+def intersect_box(a: tuple | list | None, b: tuple | list | None) -> tuple[float, float, float, float] | None:
+ """Intersection of two 0-1 (x, y, w, h) regions; either may be None (= the whole frame)."""
+ if not a or not b:
+ return tuple(a or b) if (a or b) else None
+ x0, y0 = max(a[0], b[0]), max(a[1], b[1])
+ x1, y1 = min(a[0] + a[2], b[0] + b[2]), min(a[1] + a[3], b[1] + b[3])
+ if x1 - x0 < 0.1 or y1 - y0 < 0.1:
+ return tuple(b)
+ return x0, y0, x1 - x0, y1 - y0
+
+
def shot_features(samples: ShotSamples, fps: float) -> dict:
sp = [spatial_features(f) for f in samples.frames] or [spatial_features(np.zeros((32, 32, 3), np.uint8))]
agg = {k: float(np.median([s[k] for s in sp])) for k in sp[0]}
diff --git a/rea_video/pipeline.py b/rea_video/pipeline.py
index c2ed60d..9d380f3 100644
--- a/rea_video/pipeline.py
+++ b/rea_video/pipeline.py
@@ -12,8 +12,8 @@ from . import SCHEMA, __version__
from .assets import detect_embedded, material_summary
from .audio import analyze_audio, merge_audio_with_vlm
from .sound_source import MUSIC_ZH, classify_sound_sources, per_clip_audio
-from .classify import LABEL_ZH, OVERLAY_KIND_ZH, RULES, UNMEASURED, decide, deterministic, drop_scene_text, fuse, group_of, image_source_guess, overlay_layers, top, verdict_text, video_context
-from .features import collect_samples, shot_features
+from .classify import FILM_HINT_ZH, LABEL_ZH, OVERLAY_KIND_ZH, RULES, UNMEASURED, decide, deterministic, drop_scene_text, fuse, group_of, image_source_guess, overlay_layers, top, verdict_text, video_context
+from .features import collect_samples, crop_box, intersect_box, photo_letterbox, shot_features
from .media import cut_clip, extract_frame, require_tools, video_info
from .overlay import ocr_frames, persistent_template, static_overlays, summarize_text
from .plan import Planner
@@ -91,19 +91,29 @@ def decompose(video: str | Path, out_dir: str | Path, *, use_vlm: bool = False,
for s in shots:
smp = samples_by_shot[s.index]
crop = clean_region(pack["stickers"], s.start, s.end) if pack else None
+ # a film / TV clip letterboxed into the frame: black bars read as flat, frozen, few-colour "rendered" pixels,
+ # so the picture is measured inside its box
+ lbox = photo_letterbox(smp.frames)
+ if lbox:
+ crop = intersect_box(lbox["box"], crop)
# a sticker / GIF sitting on the shot would skew the picture statistics: measure the rest of the frame
feats = shot_features(collect_samples(str(video), info, s, crop=crop) if crop else smp, info.fps)
- if crop:
+ if lbox:
+ feats.update(picture_box=[round(v, 4) for v in lbox["box"]], picture_aspect=round(lbox["aspect"], 3),
+ bar_share=round(lbox["bar_share"], 3))
+ if crop and not lbox:
feats["measured_region"] = list(crop)
ov = static_overlays(smp.frames)
text = summarize_text(ocr_frames(smp.frames, smp.frame_times)) if ocr else {"tracks": [], "text_coverage": 0.0, "items": []}
embedded = detect_embedded(smp.frames, text.get("items"))
- fd = shot_faces(smp.frames)
+ # faces, framing and light are read on the picture itself (inside the letterbox), not on the bars
+ pic = [crop_box(f, lbox["box"]) for f in smp.frames] if lbox else smp.frames
+ fd = shot_faces(pic)
faces = fd["presence"]
areas = [p["face"]["area"] for p in fd["frames"] if p.get("face")]
feats["face_presence"] = faces
feats["face_area"] = float(np.median(areas)) if areas else 0.0
- asp = aspects.measure_shot(smp.frames, fd, feats, s.duration)
+ asp = aspects.measure_shot(pic, fd, feats, s.duration)
probs, evidence, facts = deterministic(feats, ov, text, faces, audio, prov, fps=info.fps)
layers = overlay_layers(ov, text, template)
sid = f"shot_{s.index:03d}"
@@ -234,6 +244,13 @@ def _ai_or_live_doubt(label: str, facts: dict, prov: dict, vctx: dict, seen_live
seen_live: how strongly the image readers (VLM / agent) think the shot was filmed."""
if label not in ("ai_video", "live_action") or prov.get("aigc"):
return None
+ hints = facts.get("film_hints") or []
+ if hints and not seen:
+ # letterbox / 《title》 on screen: a film recap or compilation looks exactly like this, and so can an AI drama
+ return T("{l}还是影视片段待确认:{h};剪进来的影视剧画面和{l}在像素上分不开,需要看图(认得出的演员或剧集、片名、台标、群演和布景的规模)",
+ "{l} or film / TV footage, to confirm: {h}; a clip cut from a film or series cannot be told from {l} by pixels, needs an image reader "
+ "(recognisable actors or series, a title, a channel logo, the scale of extras and sets)",
+ l=LABEL_ZH[label], h=join(FILM_HINT_ZH[k] for k in hints))
if label == "ai_video" and facts.get("pulldown") in PULLDOWN_24 and not (prov.get("hints") or {}).get("generator"):
# a cinema / mirrorless camera shooting 24p and exported at 30 fps leaves the same cadence as a generator:
# measured on a phone clip converted 30 -> 24 -> 30, the tools call it AI at 89% (eval/RESULTS.md 2026-11-01)
@@ -241,8 +258,8 @@ def _ai_or_live_doubt(label: str, facts: dict, prov: dict, vctx: dict, seen_live
return T("AI 还是 24p 相机实拍待确认:帧率痕迹只说明素材是 24fps 源,看图的一方认为是实拍,又没有 AIGC 标识",
"AI or 24p camera footage, to confirm: the frame-rate marks only say the source was 24fps, the image reader calls it live action, and there is no AIGC label")
if not seen:
- return T("AI 还是 24p 相机实拍待确认:只有帧率证据(24fps 源)、没有 AIGC 标识,需要看图确认",
- "AI or 24p camera footage, to confirm: only frame-rate evidence (24fps source) and no AIGC label, needs an image reader")
+ return T("AI 还是 24p 相机实拍 / 影视片段待确认:只有帧率证据(24fps 源,电影和电视剧也是这个帧率)、没有 AIGC 标识,需要看图确认",
+ "AI, 24p camera footage or film / TV footage, to confirm: only frame-rate evidence (a 24fps source, which films and TV share) and no AIGC label, needs an image reader")
if label == "ai_video" and facts.get("pulldown") == "interpolated" and not (prov.get("hints") or {}).get("generator"):
# a sharpness rhythm with no duplicate frames: a re-encode whose platform tags were stripped leaves the same rhythm
if seen_live >= 0.5:
@@ -483,6 +500,7 @@ def finalize(breakdown: dict, out: Path, engine: str | None = None) -> dict:
if not doubt and decided != "user" and label in UNMEASURED and not (rec.get("vlm") and rec.get("review")):
doubt = (T("{l}只有一方看图判断(工具测不出这一类):", "{l} rests on a single image reader (the tools cannot measure this class): ", l=LABEL_ZH[label]) +
(T("定格动画和 AI 视频、实拍容易混", "stop motion is easily confused with AI video and live action") if label == "stop_motion"
+ else T("影视片段和 AI 短剧、自己拍的实拍容易混", "film / TV footage is easily confused with AI dramas and self-shot footage") if label == "film_footage"
else T("2D 动画和代码动效、AI 视频容易混", "2D animation is easily confused with code-driven motion graphics and AI video")) + T(",请再看一眼", ", take another look"))
if doubt:
rec["base"]["confidence"] = round(min(conf, DOUBT_CAP), 3)
@@ -506,6 +524,9 @@ def finalize(breakdown: dict, out: Path, engine: str | None = None) -> dict:
if (rec.get("features") or {}).get("measured_region"):
rec["base"]["evidence"].append(T("画面统计只在贴纸/动图之外的区域测量(x{:.0%} y{:.0%} 宽{:.0%} 高{:.0%})",
"Picture statistics measured only outside the sticker / GIF region (x{:.0%} y{:.0%} w{:.0%} h{:.0%})").format(*rec["features"]["measured_region"]))
+ if (rec.get("features") or {}).get("picture_box"):
+ rec["base"]["evidence"].append(T("画面嵌在黑边里(画面框 x{:.0%} y{:.0%} 宽{:.0%} 高{:.0%}),画面统计只在框内测量",
+ "The picture sits inside black bars (box x{:.0%} y{:.0%} w{:.0%} h{:.0%}); picture statistics measured inside the box only").format(*rec["features"]["picture_box"]))
# imported real material: full-frame from the base label, embedded regions only where
# the frame is a rendered layout (photographic bases would trip the region detector)
rendered_frame = label in ("code_render", "screen_capture", "cg_3d") or (label in ("static_hold", "still_motion") and img_src in ("graphic", "screenshot"))
@@ -552,6 +573,10 @@ def finalize(breakdown: dict, out: Path, engine: str | None = None) -> dict:
verdict += T("(其中 {r:.0%} 时长实拍还是 AI 待确认:平台转码抹掉了噪声证据,需开 VLM 或人工看画面)",
" ({r:.0%} of the duration is live action or AI, to confirm: the platform transcode erased the noise evidence, needs a VLM pass or a human look at the frames)",
r=unsure / total)
+ if (vctx.get("film_hint_share") or 0) > 0.3 and not any(r["base"]["label"] == "film_footage" for r in shot_records):
+ verdict += T("(其中 {r:.0%} 时长有影视片段线索(黑边版式、《》片名),可能是影视解说或混剪,需看图确认)",
+ " ({r:.0%} of the duration carries film / TV hints (letterbox layout, a 《title》), possibly a film recap or compilation, to confirm by looking)",
+ r=vctx["film_hint_share"])
doubtful = sum(r["duration"] for r in shot_records if r["base"].get("uncertain"))
if doubtful / total > 0.3 and not (unsure / total > 0.3 and not any(visual_opinion(r) for r in shot_records)):
verdict += T("(其中 {r:.0%} 时长实拍还是 AI 证据不足,待确认)", " ({r:.0%} of the duration lacks evidence for live action vs AI, to confirm)", r=doubtful / total)
diff --git a/rea_video/plan.py b/rea_video/plan.py
index 5f3e781..1e3f929 100644
--- a/rea_video/plan.py
+++ b/rea_video/plan.py
@@ -23,6 +23,7 @@ LABEL_ROUTE = {
"static_hold": ("R18-static-hold", "local_ffmpeg", None),
"anim_2d": ("R19-2d-animation", "capsule_cinema", "first_last_frame"),
"stop_motion": ("R20-stop-motion", "capsule_cinema", "image_to_video"),
+ "film_footage": ("R21-film-footage", "source_footage", None),
}
NOTE = LangDict({
"ai_video": "原片为 AI 生成:取原镜头首尾帧做首尾帧生成,可高度还原构图与动作;换主体时先用图像模型改首帧",
@@ -35,6 +36,7 @@ NOTE = LangDict({
"static_hold": "静帧:一张图定格即可",
"anim_2d": "2D 动画:先出角色设定图定画风,再首尾帧生成;要精确口型和动作时做 AE / Live2D / Spine 工程",
"stop_motion": "定格动画:首选真的拍(手机固定 + 定格 App,每秒约 12 张);AI 生成只能近似顿挫感",
+ "film_footage": "影视片段:画面剪自已有的电影/电视剧/短剧,复刻要找到原片对应片段再剪(版权属于片方,商用要授权);不用原片时,按同样景别、机位和打光自己拍,或用 AI 做近似画面",
}, en={
"ai_video": "Source is AI-generated: use the shot's first and last frames for first/last-frame generation to closely match composition and motion; to change the subject, edit the first frame with an image model first",
"live_action": "Source is live action: reshoot per the shooting plan (shot size / camera setup / lighting); only fall back to AI image-to-video (first frame as reference) when a shoot is not possible",
@@ -46,6 +48,7 @@ NOTE = LangDict({
"static_hold": "Static frame: one held image is enough",
"anim_2d": "2D animation: make a character sheet to lock the style, then first/last-frame generation; for precise lip sync and motion, build an AE / Live2D / Spine project",
"stop_motion": "Stop motion: shooting for real is the first choice (phone locked off + a stop-motion app, about 12 frames per second); AI generation only approximates the stepped feel",
+ "film_footage": "Film / TV footage: the picture is cut from an existing film, series or short drama; a remake has to find the same clip in the source and cut it (rights belong to the studio, commercial use needs a licence); without the source, shoot it yourself with the same shot size, camera setup and lighting, or approximate it with AI",
})
# AI edits on filmed footage: what was done, which routing rule rebuilds it, how in one line
AI_EDITS = {
diff --git a/rea_video/production.py b/rea_video/production.py
index 7e40d48..2971d2e 100644
--- a/rea_video/production.py
+++ b/rea_video/production.py
@@ -16,7 +16,7 @@ from pathlib import Path
import cv2
-from .classify import LABEL_ZH
+from .classify import LABEL_ZH, TITLE_MARK
from .aspects.camera import SUPPORT_ZH
from .plan import CODE_STYLES, Planner, code_scene, shot_prompts
@@ -436,12 +436,29 @@ def production_plan(b: dict, out: Path, engine: str = "seedance2.0") -> dict:
plan["local"] = [{"shot": r["index"], "label_zh": r["base"]["label_zh"], "duration": r["duration"]}
for r in shots if r["base"]["label"] in LOCAL_LABELS]
plan["avatar"] = [r["index"] for r in shots if r["base"]["label"] == "avatar"]
+ plan["footage"] = footage_runs(shots)
plan["_labels"] = {r["index"]: r["base"]["label"] for r in shots}
plan["summary"] = summary_line(plan, b)
del plan["_labels"]
return plan
+def footage_runs(shots: list[dict]) -> list[dict]:
+ """Film / TV clips in a row, with the 《titles》 read on screen: what to look for in the source."""
+ runs, cur = [], []
+ for r in shots + [None]:
+ if r is not None and r["base"]["label"] == "film_footage":
+ cur.append(r)
+ continue
+ if cur:
+ titles = list(dict.fromkeys(m for x in cur for tr in (x.get("text") or {}).get("tracks", [])
+ for t in tr.get("texts", []) for m in TITLE_MARK.findall(t)))
+ runs.append({"shots": [x["index"] for x in cur], "start": cur[0]["start"], "end": cur[-1]["end"],
+ "duration": round(cur[-1]["end"] - cur[0]["start"], 3), "titles": titles[:8]})
+ cur = []
+ return runs
+
+
def _s(n: int) -> str:
"""English plural suffix (unused in Chinese)."""
return "" if n == 1 else "s"
@@ -478,6 +495,9 @@ def summary_line(plan: dict, b: dict) -> str:
if plan["local"]:
n = len(plan["local"])
bits.append(T("静图推拉/静帧 {n} 镜 → 本地重建", "still-image move / static frame {n} shot{s} → rebuilt locally", n=n, s=_s(n)))
+ if plan.get("footage"):
+ n = sum(len(f["shots"]) for f in plan["footage"])
+ bits.append(T("影视片段 {n} 镜 → 找原片剪辑", "film / TV footage {n} shot{s} → cut from the source", n=n, s=_s(n)))
if plan["avatar"]:
n = len(plan["avatar"])
bits.append(T("数字人 {n} 镜 → TTS + 数字人驱动", "digital avatar {n} shot{s} → TTS + avatar driver", n=n, s=_s(n)))
@@ -596,4 +616,12 @@ def report_md(plan: dict) -> list[str]:
if plan["local"]:
L += ["", T("### 本地重建", "### Local rebuild"), "", "- " + semi().join(f"#{x['shot']} {x['label_zh']} {x['duration']:.1f}s" for x in plan["local"])
+ T(":一张图 + 测得的缩放/平移参数,ffmpeg 直接出", ": one image + the measured zoom / pan parameters, rendered straight from ffmpeg")]
+ if plan.get("footage"):
+ L += ["", T("### 影视原片", "### Film / TV source"), "",
+ T("- 这些镜头剪自已有的影视作品:找到原片对应片段再剪,版权属于片方,商用要授权;不用原片时按同样景别、机位和打光自己拍,或用 AI 做近似画面",
+ "- These shots are cut from existing films or series: find the same clips in the source and cut them; rights belong to the studio and commercial use needs a licence. "
+ "Without the source, shoot them yourself with the same shot size, camera setup and lighting, or approximate them with AI"), ""]
+ for f in plan["footage"]:
+ L.append(f"- {f['start']:.1f}–{f['end']:.1f}s " + T("{n} 镜", "{n} shot{s}", n=len(f["shots"]), s=_s(len(f["shots"])))
+ + (T(",画面上的片名:{t}", ", titles on screen: {t}", t=T("、", ", ").join(f["titles"])) if f["titles"] else ""))
return L
diff --git a/rea_video/report.py b/rea_video/report.py
index bf433a7..18f8f19 100644
--- a/rea_video/report.py
+++ b/rea_video/report.py
@@ -37,10 +37,10 @@ MODE_ZH = LangDict({"music": "背景音乐", "voice": "人声", "sfx": "音效"}
# how a shot gets remade, in words (the rule ids stay in breakdown.json for agents)
ROUTE_ZH = LangDict({"ai_video": "AI 生成(首尾帧)", "live_action": "实拍", "avatar": "TTS + 数字人", "cg_3d": "AI 生成 / 3D 渲染",
"code_render": "代码渲染", "screen_capture": "录屏重建", "still_motion": "本地 ffmpeg 推拉", "static_hold": "静帧",
- "anim_2d": "AI 生成(2D 动画)", "stop_motion": "实拍定格"},
+ "anim_2d": "AI 生成(2D 动画)", "stop_motion": "实拍定格", "film_footage": "找原片剪辑"},
en={"ai_video": "AI generation (first / last frame)", "live_action": "reshoot", "avatar": "TTS + avatar", "cg_3d": "AI generation / 3D render",
"code_render": "code render", "screen_capture": "screen recording", "still_motion": "local ffmpeg move", "static_hold": "static frame",
- "anim_2d": "AI generation (2D animation)", "stop_motion": "stop motion shoot"})
+ "anim_2d": "AI generation (2D animation)", "stop_motion": "stop motion shoot", "film_footage": "cut from the source film"})
SFX_SRC_ZH = LangDict({"vlm": "听到", "deterministic": "信号候选(低置信)", "review": "看图复核", "merged": "听到 + 信号"},
en={"vlm": "heard", "deterministic": "signal candidate (low confidence)", "review": "agent review", "merged": "heard + signal"})
ENDING_ZH = LangDict({"natural_end": "自然结束", "fade_out": "淡出", "hard_cut": "硬切断"}, en={"natural_end": "ends naturally", "fade_out": "fades out", "hard_cut": "cut off hard"})
diff --git a/rea_video/review.py b/rea_video/review.py
index 3f3daa5..b1d9407 100644
--- a/rea_video/review.py
+++ b/rea_video/review.py
@@ -133,7 +133,7 @@ def build_tasks(breakdown: dict, out_dir: str) -> tuple[dict, dict]:
pk_answers = {"stickers": [{"id": st["id"], "is_overlay": None, "what": ""} for st in sts],
"text": [{"id": c["id"], "kind": ""} for c in txt[:80]], "missed": []}
tasks = {"instructions": INSTRUCTIONS, "video": video, "storyboard": "storyboard.jpg",
- "video_context": {k: ctx.get(k) for k in ("transcoded", "platform", "native30") if k in ctx},
+ "video_context": {k: ctx.get(k) for k in ("transcoded", "platform", "native30", "film_hint_share") if k in ctx},
"aigc": (breakdown.get("provenance") or {}).get("aigc"),
"shots": shots}
if pk_tasks:
diff --git a/rea_video/visual.py b/rea_video/visual.py
index fe23c93..5cedf4b 100644
--- a/rea_video/visual.py
+++ b/rea_video/visual.py
@@ -13,12 +13,13 @@ LABEL_COLOR = {
"live_action": (46, 160, 67), "ai_video": (217, 70, 239), "avatar": (236, 72, 153), "cg_3d": (14, 165, 233),
"code_render": (245, 158, 11), "screen_capture": (100, 116, 139), "still_motion": (168, 85, 247),
"static_hold": (148, 163, 184), "anim_2d": (234, 88, 12), "stop_motion": (161, 98, 7),
+ "film_footage": (190, 18, 60),
}
# short names for the storyboard strip (the full names are too long for a 200px cell)
LABEL_SHORT = {
"live_action": "实拍", "ai_video": "AI 视频", "avatar": "数字人", "cg_3d": "3D 渲染", "code_render": "代码渲染",
"screen_capture": "录屏/截图", "still_motion": "静图推拉", "static_hold": "静帧", "anim_2d": "2D 动画",
- "stop_motion": "定格动画",
+ "stop_motion": "定格动画", "film_footage": "影视片段",
}
_FONT_CANDIDATES = [
"/System/Library/Fonts/PingFang.ttc", "/System/Library/Fonts/STHeiti Medium.ttc", "/System/Library/Fonts/STHeiti Light.ttc", "/System/Library/Fonts/Hiragino Sans GB.ttc",
diff --git a/rea_video/vlm.py b/rea_video/vlm.py
index 9bd6a34..1bde837 100644
--- a/rea_video/vlm.py
+++ b/rea_video/vlm.py
@@ -206,6 +206,7 @@ SHOT_PROMPT = """你是视频制作逆向工程专家。判断这个镜头的「
- static_hold:静帧定格(图片或卡片停留不动)
- anim_2d:2D 动画(手绘逐帧、Live2D、AE/Spine 角色动画、扁平插画风动画):线条和平涂色块、角色有骨骼或逐帧动作,常见"一拍二"(每两帧才变一次)
- stop_motion:定格动画(黏土、毛毡、纸偶、乐高等实物逐帧拍摄):真实材质和灯光、动作一顿一顿、帧间轻微闪烁、指纹和纹理细节
+- film_footage:剪进来的已有影视作品画面(电影、电视剧、网剧、竖屏短剧的片段,影视解说、混剪、名场面合集常见):认得出的演员或剧集、专业剧组的布光和多机位、大量群演和成套布景、片头片尾字幕、台标或平台水印、画面上的《片名》、嵌在黑边里的宽画幅
如果画面是实拍或写实画面,再拆「怎么拍、怎么打光」(aspects 里各项),纯图形/文字/界面画面这些字段写"不适用"。
@@ -216,6 +217,7 @@ SHOT_PROMPT = """你是视频制作逆向工程专家。判断这个镜头的「
注意区分:卡通/3D 风格的 AI 视频(形变、闪烁、不精确)与真正的 3D 渲染(几何稳定、精确);
AI 生成的写实视频与实拍(看手、文字、背景细节、物理);AI 生成的动画风视频(形变、线条游移)与真正的 2D 动画(线条稳定、按帧精确);
AI 仿定格风格(材质在帧间漂移)与真正的定格动画(同一实物、光照不变、只有逐帧位移);
+影视片段(剪自已有的电影/电视剧/短剧:live_action 只用于视频作者或客户自己拍的画面)与 AI 短剧(脸过于完美且千人一面、手和文字出错、群演和背景稀少、物体形变);"影视效果""剧情需要"这类免责声明和《片名》在 AI 短剧解说里也常见,不能单独作为影视片段的证据;
暗底发光粒子拼成的器官、人体、地球、分子等科普画面是代码渲染(粒子系统),不是 3D 实体模型,也不是 AI 视频或实拍:亮部由成千上万个点或细线组成、没有连续的明暗表面,常配 HUD 式章节牌和引线标注。
代码绘制的画面没有材质纹理:大面积平滑渐变、纯色块、辉光、毛玻璃卡片、CSS 3D 翻转卡片都是代码渲染,不是 3D 渲染(3D 渲染有布料/木纹/金属等材质、有投影和物体间的光影关系);分形缩放、plasma 之类彩虹色场是着色器生成,不是实拍或 AI 视频。
@@ -227,7 +229,7 @@ AI 仿定格风格(材质在帧间漂移)与真正的定格动画(同一
只返回 JSON,不要任何其他文字:
{{
- "label_probs": {{"live_action": 0, "ai_video": 0, "avatar": 0, "cg_3d": 0, "code_render": 0, "screen_capture": 0, "still_motion": 0, "static_hold": 0, "anim_2d": 0, "stop_motion": 0}},
+ "label_probs": {{"live_action": 0, "ai_video": 0, "avatar": 0, "cg_3d": 0, "code_render": 0, "screen_capture": 0, "still_motion": 0, "static_hold": 0, "anim_2d": 0, "stop_motion": 0, "film_footage": 0}},
"image_source": "ai_image|photo|graphic|screenshot|unknown",
"evidence": ["具体可见证据,尽量指明位置/时间"],
"generator_guess": "可能的生成模型或工具(如 Seedance/Kling/Veo/Hailuo/Blender/Remotion/剪映 模板),无法判断写 unknown",
@@ -261,7 +263,7 @@ WHOLE_PROMPT = """你是短视频拆解专家。完整观看并**仔细收听**
只返回 JSON:
{{
"summary": "一句话概括",
- "format": "口播|剧情|商品展示|知识讲解|MV|混剪|其他",
+ "format": "口播|剧情|商品展示|知识讲解|MV|混剪|影视解说|其他",
"hook": "开头 3 秒如何抓人",
"segments": [{{"start": 0.0, "end": 3.0, "beat": "这一段在叙事上的作用", "copy": "这一段的旁白/字幕文案", "audio": "人声/音乐/音效"}}],
"narration": {{"type": "tts|human|none|mixed", "voice": "性别/年龄感/音色", "style": "语速、情绪、口癖", "language": "zh|en|...",
diff --git a/skills/rea-video/SKILL.md b/skills/rea-video/SKILL.md
index c6120f4..ca55cf7 100644
--- a/skills/rea-video/SKILL.md
+++ b/skills/rea-video/SKILL.md
@@ -1,13 +1,13 @@
---
name: rea-video
-description: 逆向拆解一条视频是怎么做出来的——逐镜头判断实拍 / AI 生成 / 3D 渲染 / 2D 动画 / 定格动画 / 代码模板渲染 / 录屏截图 / 静态图推拉 / 静帧,以及实拍是否经过 AI 加工(换脸、对口型、风格化),标出后期叠加层(逐句字幕时间轴、花字、标题、贴纸 / GIF / 表情包、画中画)和用户真实素材,拆解人声、背景音乐、音效(卡在哪个画面事件上)与剪辑节奏,并给出可执行的复刻方案(可对接 capsule-cinema)。当用户给出参考视频、问"这条视频怎么做的 / 是不是 AI / 用了什么素材 / 怎么复刻"时使用。
+description: 逆向拆解一条视频是怎么做出来的——逐镜头判断实拍 / 影视片段 / AI 生成 / 3D 渲染 / 2D 动画 / 定格动画 / 代码模板渲染 / 录屏截图 / 静态图推拉 / 静帧,以及实拍是否经过 AI 加工(换脸、对口型、风格化),标出后期叠加层(逐句字幕时间轴、花字、标题、贴纸 / GIF / 表情包、画中画)和用户真实素材,拆解人声、背景音乐、音效(卡在哪个画面事件上)与剪辑节奏,并给出可执行的复刻方案(可对接 capsule-cinema)。当用户给出参考视频、问"这条视频怎么做的 / 是不是 AI / 用了什么素材 / 怎么复刻"时使用。
---
# rea-video:视频制作方式逆向拆解
你是视频制作的逆向工程师。用户给你一条视频,你要回答清楚:
-1. **每个镜头的底层画面是怎么来的?**从 10 类里选:实拍 / AI 视频 / 数字人 / 3D 渲染 / 2D 动画 / 定格动画 / 代码模板渲染 / 录屏截图 / 静态图推拉 / 静帧。2D 动画和定格动画工具测不出,要你看图判断。实拍镜头再看有没有被 AI 加工过(换脸、对口型、风格化、换装、换背景),填在 `ai_edits` 里(对照 `references/taxonomy.md`)。
+1. **每个镜头的底层画面是怎么来的?**从 11 类里选:实拍 / 影视片段 / AI 视频 / 数字人 / 3D 渲染 / 2D 动画 / 定格动画 / 代码模板渲染 / 录屏截图 / 静态图推拉 / 静帧。2D 动画、定格动画和影视片段(剪进来的电影、电视剧、短剧画面)工具测不出,要你看图判断。实拍镜头再看有没有被 AI 加工过(换脸、对口型、风格化、换装、换背景),填在 `ai_edits` 里(对照 `references/taxonomy.md`)。
2. **上面叠了什么?(剪辑包装)**逐句字幕(时间轴、颜色、描边、关键词高亮、入场方式)、花字、标题、章节牌、跟着物体走的标签、表情包 / GIF / 贴纸 / 画中画、版式模板,以及哪些音效卡在文字弹出或贴纸出现上。
3. **哪些是用户真实素材?**分两类:画面里嵌入的真实像素(实拍、照片、截图、录屏、版式里播放的视频片段),复刻时必须拿到原文件;AI / 3D 画面里出现的商品、Logo、人物,是复刻时要准备的参考图(报告里的「复刻要准备的参考素材」),不是嵌入素材。
4. **声音怎么做的?**人声(TTS 还是真人)、BGM(风格 / BPM / 调性 / 段落)、音效(时间点、类型、对应哪个画面事件),以及切镜是否卡在节拍上。**重点是来源:AI 生成的还是现成的。**先看视频形式——AI 音乐 MV(整片是一首唱出来的歌)大概率是 AI 歌;普通视频配乐大概率是现成曲库,但 AI 工作流的视频 BGM 也常是 Suno 生成,必须标"待确认"并给确认方法。
@@ -94,7 +94,7 @@ rea-video summary out/ref/breakdown.json # 用并入后的结果写回复
|---|---|
| `references/setup.md` | 安装、配置 VLM |
| `references/review.md` | 看图复核:融合规则、看不了图、原片判 AI、平台转码 |
-| `references/taxonomy.md` | 10 类画面、AI 加工、判断要点速查、易混对照 |
+| `references/taxonomy.md` | 11 类画面、AI 加工、判断要点速查、易混对照 |
| `references/audio.md` | 声音复核 |
| `references/materials.md` | 真实素材复核 |
| `references/output-template.md` | 交付格式 |
diff --git a/skills/rea-video/references/review.md b/skills/rea-video/references/review.md
index 95a68ef..a1159c7 100644
--- a/skills/rea-video/references/review.md
+++ b/skills/rea-video/references/review.md
@@ -6,7 +6,7 @@ SKILL.md 第 1 节流程的补充:看图结果怎么和工具融合,以及
实测得来(仓库 `eval/RESULTS.md`):
-- 只有一个看图来源(只有 VLM 或只有你)时,看图结果只能在工具前两名候选里选。工具对"AI / 实拍 / 数字人"有把握时不改;转码后带 24→30 重复帧的镜头不会仅凭"看起来真"改成实拍。镜头自身没有重复帧(原生 30fps 节奏)时,你的实拍判断会被采纳,哪怕整片因为混了 AI 开场而没被标成原生 30fps;工具前三名都不到 0.4、且你选的类别只比次选差一点时,也以你为准。看图结果在 3D / 代码动效 / 录屏之间的区分最有用。
+- 只有一个看图来源(只有 VLM 或只有你)时,看图结果只能在工具前两名候选里选。工具对"AI / 实拍 / 数字人"有把握时不改;转码后带 24→30 重复帧的镜头不会仅凭"看起来真"改成实拍。镜头自身没有重复帧(原生 30fps 节奏)时,你的实拍判断会被采纳,哪怕整片因为混了 AI 开场而没被标成原生 30fps;工具前三名都不到 0.4、且你选的类别只比次选差一点时,也以你为准。看图结果在 3D / 代码动效 / 录屏之间的区分最有用。2D 动画、定格动画、影视片段是例外:工具测不出这三类,你判成它们时直接采纳,但只有一方看图时结论保留「待确认」。
- VLM 和你都答了:先判大类(生成 / 渲染 / 实拍 / 录屏 / 静图),再判细类。工具首选只要有你们其中一方支持(同细类或同大类,比如工具判 AI 视频、你判数字人),就按工具首选的大类;你们两个一致反对工具时,按正常融合。
- 标了「有分歧」的镜头(工具和 VLM 对是不是实拍意见相反)必看:核对 VLM 写的证据在截图里是否真的看得见,VLM 会编理由。
- review_tasks.json 里写着"用户过去 n 次把工具判的 X 改成 Y"的镜头,是用户反复纠正过的类型,要重点看。
@@ -23,6 +23,15 @@ SKILL.md 第 1 节流程的补充:看图结果怎么和工具融合,以及
只有一个连续镜头、没有 AIGC 标识、也没有 24→30 重复帧的写实或手作质感视频(定格动画、俯拍生活片、手作微缩场景),工具常会判成 AI。看图后如果找不到明确的 AI 破绽(形变、纹理闪烁、物理错误、文字乱码),**不要给高置信度**:写成"AI 还是实拍 / 定格动画待确认(倾向 X)",列出正反两方的证据,置信度不超过 0.7。
+## 影视解说、混剪:先判是不是剪进来的影视片段
+
+画面嵌在黑边里、有《片名》、或标题写着解说 / 混剪 / 名场面时,工具会在证据里写「影视片段线索」,并把镜头标成「AI 视频还是影视片段待确认」或「实拍还是影视片段待确认」。工具测不出谁拍的,这一步要你看图:
+
+- 认得出演员或剧集、剧组规模的布光和布景、群演、台标或平台水印、清楚可读的场景文字 → `film_footage`。
+- 脸过于完美、不同角色长得很像、手和文字出错、纹理漂移 → `ai_video`(AI 短剧解说的版式和真人剧解说一模一样,别只看版式)。
+- 作者自己出镜的口播、插进来的截图或 AI 画面,按镜头分别标。
+- `live_action` 只给作者或客户自己拍的画面。
+
## 平台转码视频(微信 / 抖音 / TikTok 下载的文件)
元数据里有 `Tencent CAPD MTS`、`Wxmm_`、`vid:v…` 时,工具会标 `video_context.transcoded`。二次压缩会抹掉传感器噪声、带来假的插帧节奏,所以:
diff --git a/skills/rea-video/references/taxonomy.md b/skills/rea-video/references/taxonomy.md
index ca513e8..990006d 100644
--- a/skills/rea-video/references/taxonomy.md
+++ b/skills/rea-video/references/taxonomy.md
@@ -1,6 +1,6 @@
# 制作方式分类与易混对照
-## 10 类底层画面
+## 11 类底层画面
| 标签 | 中文 | 典型证据 | 复刻路线 |
|---|---|---|---|
@@ -14,8 +14,11 @@
| static_hold | 静帧 | 85% 以上帧逐像素重复 | 一张图 |
| anim_2d | 2D 动画 | 工具测不出,只能看图:线条和平涂色块稳定、角色有骨骼或逐帧动作、常见"一拍二" | 角色设定图 + 首尾帧生成;要精确口型动作时做 AE / Live2D / Spine |
| stop_motion | 定格动画 | 工具测不出,只能看图:真实材质(黏土、毛毡、纸)、动作一顿一顿、帧间轻微闪烁、同一实物光照不变 | 首选真的拍(固定机位、每秒约 12 张);AI 只能近似 |
+| film_footage | 影视片段 | 工具测不出,只给线索:画面嵌在黑边里、24/25fps 源、画面上有《片名》。看图看:认得出的演员或剧集、专业布光和多机位正反打、大量群演和成套布景、台标或平台水印 | 找原片对应片段再剪(版权属于片方,商用要授权);不用原片就按同样景别和打光自己拍,或 AI 近似 |
-`anim_2d` / `stop_motion` 只由看图来源判断:只有一方看图时结论标「待确认」,VLM 和 agent 都看过才去掉。
+`anim_2d` / `stop_motion` / `film_footage` 只由看图来源判断:只有一方看图时结论标「待确认」,VLM 和 agent 都看过才去掉。
+
+`live_action` 只用于视频作者或客户自己拍的画面;剪自已有电影、电视剧、短剧的画面一律是 `film_footage`,哪怕拍得再像实拍。
## 实拍上的 AI 加工(ai_edits)
@@ -38,7 +41,9 @@
| 相邻帧逐像素重复、首尾无变化 | 静帧;如果是平涂渲染卡片,归为代码渲染 |
| 整帧按一个刚体变换缩放/平移,补偿后无残差,且**没有** 24fps 源的帧率痕迹 | 静态图推拉 |
| 平涂色块多、用色少、横竖直边多 | 渲染(代码或 3D);背景像素逐帧完全不变、只有局部在动 → 2D 代码动效 |
-| 约 20% 帧重复、周期 4–6(24→30) | 源是 24fps:AI 生成 / 3D / 电影素材,不是手机原生拍摄 |
+| 约 20% 帧重复、周期 4–6(24→30) | 源是 24fps:AI 生成 / 3D / 电影或电视剧素材,不是手机原生拍摄 |
+| 竖屏里一块 16:9 或更宽的画面嵌在黑边中间,上面标题、下面解说字幕 | 影视解说版式 → 倾向影视片段;AI 电影感短片也会加黑边,要看图 |
+| 画面上有「年份 ·《剧名》」、台标、平台水印,或多段画风和调色互不相同的片段快速切换 | 影视混剪 / 名场面合集 → 倾向影视片段 |
| 只有清晰度按周期起伏、没有重复帧(插帧) | 弱证据:插帧和重新压缩都会造出来,要看图确认 |
| 原生 ≥48fps 且无重复、无插帧周期 | 多为手机/相机实拍 |
| 传感器噪声和时域噪声明显、手持抖动 | 实拍 |
@@ -103,6 +108,13 @@
- AI 仿定格:材质本身在帧间变化(黏土纹理漂移),没有真实的顿挫节奏。
- 工具常把定格判成 AI(帧率规律相似),看图时重点看材质是否稳定。
+**影视片段 vs AI 短剧 vs 自己拍的实拍**
+- 影视片段:认得出的演员或剧集;专业剧组的布光(主光、轮廓光、布景里的实用光源)、景深和多机位正反打;大量群演、成套布景和道具、动作戏有替身和威亚;画面里的文字(招牌、报纸、屏幕)清楚可读;常带台标、平台水印、片头片尾字幕,或嵌在黑边里的宽画幅。
+- AI 短剧:脸过于完美、不同角色长得很像;手、牙齿、文字出错;背景人物少且模糊;物体和衣服纹理在帧间漂移;镜头多是 5–10 秒的单人近景。「影视效果」「剧情需要」这类免责声明和《片名》在 AI 短剧解说里也常见,不能单独当证据。
+- 自己拍的实拍:口播、vlog、开箱这类作者本人或客户出镜,手机或小团队拍摄,没有剧组规模的布景和群演。
+- 解说类视频里如果插了作者自己的口播或 AI 画面,按镜头分别标。
+- 工具只开像素时会把影视片段判成「AI 视频」或「实拍」并标出「待确认」,复核时要改判。
+
**静帧:AI 图 vs 真实照片 vs 渲染卡片**
- 渲染卡片(平涂、少色)→ 归为代码渲染。
- AI 图和真实照片在确定性层无法区分,交给 VLM;判断不了就写"图片素材(真实/AI 待确认)"。
diff --git a/tests/test_film.py b/tests/test_film.py
new file mode 100644
index 0000000..d29b35a
--- /dev/null
+++ b/tests/test_film.py
@@ -0,0 +1,104 @@
+import numpy as np
+
+from rea_video.classify import UNMEASURED, deterministic, fuse, group_of, video_context
+from rea_video.features import intersect_box, photo_letterbox, picture_box
+from rea_video.pipeline import _ai_or_live_doubt, _vlm_gate
+from rea_video.production import footage_runs
+
+PHOTO = {"noise_sigma": 0.5, "temporal_noise": 1.2, "flat_ratio": 0.02, "palette95": 220, "axis_edge_ratio": 0.2,
+ "dup_ratio": 0.2, "dup_period": 5, "dup_regularity": 0.6, "moving_pair_ratio": 1.0, "zero_pixel_ratio": 0.1,
+ "camera": "smooth_move", "saturation": 0.3}
+TITLE = {"tracks": [{"texts": ["2026 ·《长安十二时辰》"], "text_height": 0.03}], "text_coverage": 0.02}
+
+
+def _letterboxed(seed: int, h: int = 852, w: int = 480, top: int = 300, ph: int = 270) -> np.ndarray:
+ rng = np.random.default_rng(seed)
+ f = np.zeros((h, w, 3), np.uint8)
+ f[top:top + ph] = rng.integers(30, 255, (ph, w, 3), dtype=np.uint8)
+ f[top - 60:top - 40, 150:330] = 230 # a title line in the top bar
+ return f
+
+
+def test_picture_box_finds_a_film_letterboxed_into_a_vertical_frame():
+ frames = [_letterboxed(i) for i in range(4)]
+ box = picture_box(frames)
+ assert box is not None
+ x, y, bw, bh = box["box"]
+ assert x == 0 and bw == 1.0 and abs(y - 300 / 852) < 0.01 and abs(bh - 270 / 852) < 0.01
+ assert 1.7 < box["aspect"] < 1.85
+ assert photo_letterbox(frames) is not None
+
+
+def test_no_box_on_full_frame_pictures_or_rendered_cards():
+ rng = np.random.default_rng(0)
+ full = [rng.integers(30, 255, (270, 480, 3), dtype=np.uint8) for _ in range(3)]
+ assert picture_box(full) is None
+ card = [np.zeros((852, 480, 3), np.uint8) for _ in range(3)]
+ for f in card:
+ f[300:570] = (40, 120, 220) # one flat colour: a rendered card, not a film clip
+ assert photo_letterbox(card) is None
+
+
+def test_intersect_box():
+ assert intersect_box(None, None) is None
+ assert intersect_box((0, 0.3, 1, 0.4), None) == (0, 0.3, 1, 0.4)
+ x, y, w, h = intersect_box((0, 0.3, 1, 0.4), (0, 0, 0.8, 1))
+ assert (x, y) == (0, 0.3) and abs(w - 0.8) < 1e-9 and abs(h - 0.4) < 1e-9
+
+
+def test_film_hints_are_evidence_not_a_verdict():
+ f = dict(PHOTO, picture_box=[0, 0.35, 1, 0.31], picture_aspect=1.78)
+ probs, ev, facts = deterministic(f, text=TITLE, fps=30.0)
+ assert set(facts["film_hints"]) == {"letterbox", "title_mark", "source_24"}
+ assert any("影视片段线索" in e or "Film / TV footage hints" in e for e in ev)
+ assert max(probs, key=probs.get) != "film_footage" # the tools never call it on hints alone
+ assert probs["film_footage"] > 0.05
+
+
+def test_24fps_alone_is_not_a_film_hint():
+ _, _, facts = deterministic(PHOTO, fps=30.0)
+ assert facts["film_hints"] == []
+
+
+def test_tool_only_run_flags_film_hints_as_to_confirm():
+ f = dict(PHOTO, picture_box=[0, 0.35, 1, 0.31], picture_aspect=1.78)
+ _, _, facts = deterministic(f, text=TITLE, fps=30.0)
+ doubt = _ai_or_live_doubt("ai_video", facts, {}, {}, seen=False)
+ assert doubt and ("影视片段" in doubt or "film / TV" in doubt)
+
+
+def test_film_footage_is_filmed_and_left_to_image_readers():
+ assert group_of("film_footage") == "live_action"
+ assert "film_footage" in UNMEASURED
+ det = {"ai_video": 0.6, "live_action": 0.3, "film_footage": 0.0}
+ det = {**{k: 0.01 for k in ("avatar", "cg_3d", "code_render", "screen_capture", "still_motion", "static_hold", "anim_2d", "stop_motion")}, **det}
+ rec = {"deterministic": {"probs": det, "facts": {"pulldown": "24→30"}}}
+ seen = {"film_footage": 0.85, "ai_video": 0.1, "live_action": 0.05}
+ assert _vlm_gate(rec, seen, {}) == seen # not dropped for missing from the tools' top two
+ out = fuse(det, seen, "dynamic")
+ assert max(out, key=out.get) == "film_footage"
+
+
+def test_video_context_film_share():
+ shots = [{"duration": 3.0, "features": dict(PHOTO, picture_box=[0, 0.35, 1, 0.31], picture_aspect=1.78)},
+ {"duration": 1.0, "features": dict(PHOTO)}]
+ assert video_context(shots, None, 30.0)["film_hint_share"] == 0.75
+
+
+def test_footage_runs_collect_titles():
+ def shot(i, label, texts=()):
+ return {"index": i, "start": i, "end": i + 1, "base": {"label": label}, "text": {"tracks": [{"texts": list(texts)}]}}
+ runs = footage_runs([shot(1, "film_footage", ["2024 ·《庆余年》"]), shot(2, "film_footage"), shot(3, "live_action"),
+ shot(4, "film_footage", ["《狂飙》第 3 集"])])
+ assert [r["shots"] for r in runs] == [[1, 2], [4]]
+ assert runs[0]["titles"] == ["《庆余年》"] and runs[1]["titles"] == ["《狂飙》"]
+
+
+def test_reader_picks_film_over_live_action_inside_the_filmed_group():
+ det = {k: 0.01 for k in ("avatar", "cg_3d", "code_render", "screen_capture", "still_motion", "static_hold", "anim_2d", "stop_motion")}
+ det.update(live_action=0.6, ai_video=0.25, film_footage=0.0)
+ out = fuse(det, {"film_footage": 0.85, "live_action": 0.1, "ai_video": 0.05}, "dynamic")
+ assert max(out, key=out.get) == "film_footage"
+ # and a reader who saw self-shot footage keeps live action
+ out = fuse(det, {"live_action": 0.85, "film_footage": 0.1, "ai_video": 0.05}, "dynamic")
+ assert max(out, key=out.get) == "live_action"