Skip to content

fix(video-agent-kit): retain videos without scene cuts - #91

Open
Ricardo-M-L wants to merge 1 commit into
zai-org:mainfrom
Ricardo-M-L:fix/video-agent-uncut-shot-coverage
Open

Ricardo-M-L wants to merge 1 commit into
zai-org:mainfrom
Ricardo-M-L:fix/video-agent-uncut-shot-coverage

Conversation

@Ricardo-M-L

Copy link
Copy Markdown

Plugin type (required) / 插件类型(必填)

  • UI Plugin / 是 UI 插件 — provides MCP Apps interactive pages / 提供 MCP Apps 交互页面
  • Standard plugin / 普通插件(非 UI) — does not provide MCP Apps interactive pages / 不提供 MCP Apps 交互页面
  • Not applicable / 不适用 — repository-only changes; no plugin content changed / 仅仓库级改动,不涉及插件内容

Affected plugin name(s) / 涉及的插件名称:video-agent-kit (Standard plugin)

What / 改动内容

detect_shots returns zero shots for a video with no scene cuts because PySceneDetect excludes an uncut scene by default. Both normal and frame-skipping detection are affected, and the empty result can be reused from cache. Downstream recap/editing workflows then lose the entire source video.

Use SceneManager.get_scene_list(start_in_scene=True) in both modes. A two-second uncut video now produces one shot, including when its duration is shorter than min_len. Using the SceneManager API also preserves compatibility with early SceneDetect 0.6 versions whose convenience detect() wrapper lacks the option. Real cut boundaries remain contiguous.

Upgrade the cache contract to cover-all-v3 so old empty caches are rebuilt, synchronize the MCP tool description, add plugin-local real-video regressions and equivalent English/Chinese README notes, and bump both manifests plus the marketplace from 0.4.3 to 0.4.4.

No dependency, permission, network access, or third-party material is added. The tool continues to write the existing shots timeline, rebuilding caches from the older contract.

This is independent of #89 (concat path escaping) and #38 (Python launcher resolution). If another video-agent-kit PR publishes first, this branch will need to rebase and use the next available plugin version.

Validation

  • Real FFmpeg-generated uncut/two-scene videos: four regression tests pass with both SceneDetect 0.6.1 and 0.6.7.1. The original code fails five assertions for uncut/short videos and old empty-cache reuse.
  • Tests cover normal and frame-skipping detection, a video shorter than min_len, cut continuity, old-cache invalidation, and new-cache reuse. Early SceneDetect end timestamps are allowed their existing one-frame precision difference.
  • Root Python suite: 122 tests run, 19 skipped, no failures.
  • pnpm install --frozen-lockfile and pnpm build passed with Node.js 24.20.0.
  • python3 scripts/validate.py: 34 plugins validated.
  • python3 scripts/build_dist.py: 34 artifacts / 292 assets built.
  • git diff --check passed.

The tool function was exercised with real FFmpeg and SceneDetect. Installation and invocation inside the ZCode desktop host were not performed.

Self-check / 自查清单

  • Plugin name is unique kebab-case; existing fixes retain ownership / 插件名唯一且 kebab-case,已有插件修复保留原归属
  • Usage category is set independently of publisher ownership / 用途分类已填写,与维护归属分开
  • Plugin type and affected names are declared above / 已声明插件类型与涉及的插件名称
  • version bumped in BOTH plugin.json and marketplace.json / 插件清单与市场版本已同步升级
  • README.md (EN) and README_CN.md (中文) both updated and equivalent — this legacy official plugin has only a Chinese README.md; the new explanation is provided in both languages in that existing file
  • description_i18n has both en and zh-CN / 包含两种语言
  • No secrets, machine-specific paths, or private dependencies / 不含密钥、机器专属路径或私有依赖
  • Model/API/network dependencies documented / 依赖已写明
  • python3 scripts/validate.py and python3 scripts/build_dist.py pass locally / 本地校验与构建均通过

@panda920

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically.

This branch has not been deployed

No deployments
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.

2 participants