Skip to content

fix(video): pin output framerate on rendered analyzer clips - #53

Open
Abdullah-Builds wants to merge 1 commit into
google:mainfrom
Abdullah-Builds:fix/analyzer-clip-output-framerate
Open

Abdullah-Builds wants to merge 1 commit into
google:mainfrom
Abdullah-Builds:fix/analyzer-clip-output-framerate

Conversation

@Abdullah-Builds

@Abdullah-Builds Abdullah-Builds commented Sep 11, 2026 •

Copy link
Copy Markdown

Fix analyzer clip output framerate

Fixes #52

What

render_timeline_clip() never set an explicit output frame rate on the final ffmpeg encode, so the encoder fell back to a default 25fps and duplicated frames to preserve real duration — every analyzer clip was silently encoded at ~25fps instead of the requested fps (default 15), with ~40% duplicate frames.

Why it matters

This function's one job is to keep a frame index mappable back to a real recording timestamp (start_time + frame_offset). UnifiedMobileController.render_timeline_clip calls it on the production path for every analyzer clip the agent renders, so the framerate drift was live in every such clip, not just this test fixture.

Fix

Add -r {fps} to the output stage of the ffmpeg command so the encoder has an explicit target framerate instead of guessing:

             "-filter_complex", ";".join(filter_parts),
             "-map", "[outv]",
+            "-r", str(fps),
             "-c:v", "libx264",

Testing

tests/unit/test_unified_controller_video.py::test_analyzer_clip_keeps_timeline_time_across_restart_gap was failing on main (assert 77 <= 47); now passes — frame count drops from 77 → 46, inside the expected 43–47 range.
Full file: uv run pytest tests/unit/test_unified_controller_video.py -q → 22 passed.
ruff format --check, ruff check, pyright --project pyright-core.json clean on the changed file.
Reproduced independently of pytest (raw ffmpeg command + cv2.VideoCapture frame count) to confirm this isn't a test-fixture artifact — the ffmpeg log shows the fallback explicitly: frame=77 ... time=00:00:03.00 ... dup=31 drop=0.

Scope

One-line change, single file (artemis/utils/video.py), no behavior change to segment planning or gap handling — only the output encode step.

giveUphope added a commit to giveUphope/autoGamer that referenced this pull request Oct 12, 2026
先更正假陈述(google#53):§零 写着「CI 用 node scripts/spike-mcp.mjs 做同一比对」,而工作流里 spike-mcp
命中 0 次、plugin-contracts job 没有任何 Python 环境 —— 那份 14 工具 fixture 一直是人工带着走的产物。

接得进去是因为 google#52:runner 上没 adb 没设备,--type adb 只能 list、调用必环境级失败;--type mock 全部
14 个工具跑得动,且两面清单逐字节相同(同一个 adb_mcp 对象)。spike-mcp.mjs 一行没改 —— 它的默认模式
本来就是漂移检查,不匹配即非零退出。放在 python-quality 而不是给 plugin-contracts 再装一套 uv:语义上属
py 面,且那里已有 uv sync。

验收都实跑过:本地同一条命令 exit 0 且 tools(14);变异校验从 fixture 删掉 compare_ui_frames ⇒ exit=1
并报 fixture is out of date,还原后转绿、fixture 未被写脏。G63 先登记后结案,registry 与已关闭差距史
各一行;留白如实写明这一步还没在真 run 里跑过(G54),按 R27 第 4 条不许写成「CI 已保证」。
giveUphope added a commit to giveUphope/autoGamer that referenced this pull request Oct 12, 2026
用户点名的失效正是本会话我自己撞的三种,google#58 逐条带命令:
① 未核实就叙述"已完成"(我写过"方案甲已落地 / google#50 / G63 / 188 项测试",git 核对全不存在,
   当时 HEAD 8eecb39、条目 49 条)——只留在对话里,但照它继续做就会去验收不存在的东西;
② 新事实推翻旧行而旧行还在(§零"CI 用 spike-mcp 做比对"grep 0 命中、"CI 侧全绿"那次 run 整体
   failure,google#53 已更正);
③ 派生数不回抄与替换不校验命中(google#45/google#56)。

四条判据:当轮必落一次文档提交并改到受影响那一行(验收带 git grep 反判据,本身要能红);
否定旧表述必须改掉或标作废加出处;说"已完成 X"必须指到 commit 或命令输出,否则写"待做";
派生计数只留复测命令。与 R24(从哪取证)、R27(锁会不会红)同族 —— R28 管"取到的证有没有
落到别人会读的地方"。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix analyzer clip framerate

1 participant