webapp-walkthrough — System Instructional Video (All Features)
Turn a "finished system" into a "tutorial that can be shown directly to users/students/reviewers".
Two modes:
| Mode | Input | Output | Use Case |
|---|---|---|---|
| Instructional Video (Recommended, Main Mode) | lesson.json lesson script | Chaptered instructional video + teaching script + feature checklist | For explaining "how each feature is used" and covering all features |
| Auto-browse (Legacy) | Auto-discovers plan.json | Tab-by-tab demo video + walkthrough script | For quickly scanning each page for white screens/errors |
Underlying technology: ego-browser (ego lite) for real clicks/input → Page.captureScreenshot for periodic frame capture → Windows SAPI Chinese TTS → ffmpeg for composition (intro/chapter cards/subtitles/outro). The teaching layer (chapter cards, cursor, element highlights, click ripples, lower-third title bar) is implemented via injected DOM overlays and is captured directly into the video.
When to Use
- System launch/delivery, needing a "feature-complete user instructional video"
- Need to show students/clients/reviewers "how each feature works and how to read the results"
- Opportunistic discovery of 500 errors, white screens, and other basic issues (the generated feature checklist flags anomalies)
Not suitable for: pixel-perfect animations (frame capture ~2–4 fps); recording desktop/other applications.
Prerequisites
| Dependency | Check | If Missing |
|---|---|---|
| ego-browser | Script auto-scans C:\Program Files\Citro Labs\ego lite\Application\*\ego-browser.exe for highest version | Install per ~/.agents/skills/ego-browser/references/install.md |
| ffmpeg | ffmpeg -version or winget package path | winget install Gyan.FFmpeg |
| Python 3.10+ | python --version | Already installed |
| numpy / pillow | python -I -c "import numpy, PIL" | pip install numpy pillow |
| Chinese TTS | edge_tts installed with network access (preferred); or SAPI with Microsoft Huihui Desktop | Falls back to SAPI if edge unavailable; any zh-CN voice |
The target system must be locally accessible (http://127.0.0.1:xxxx) and initialized with demo data. If login is required, credentials should be written into the login step of lesson.json (the instructional video typically includes the login process itself).
Directory Convention
~/ego-walkthrough/
├── active.txt # Points to current working directory (written by run_all.py automatically)
└── <project>/
├── config.json # Base configuration (system name, address, viewport, voice, etc.)
├── lesson.json # Lesson script (core input for main mode)
├── plan.json # Auto-discovered (auto-browse mode only)
└── run/ # Current run outputs
├── frames/ # Captured frames + index.json
├── shots/ # One screenshot per feature point
├── steps.jsonl # Step-by-step stream (single source of truth for narration and editing)
├── meta.json
├── 教学讲稿.md # Chapter timeline + narration text + key points + anomalies
├── 功能点清单.md # Full feature checklist (including status, screenshots)
├── narration.wav / narration.srt / timeline.json
└── concat.txt
Quick Start (Instructional Video)
1. Write config.json
Copy from templates/config.json, minimally modify:
{
"systemName": "基于BERT的学生评教文本情感分析系统",
"baseUrl": "http://127.0.0.1:8037",
"outDir": "D:/work/xxx/video_demo",
"recorder": { "width": 1440, "height": 860, "jpegQuality": 70 },
"voice": { "name": "Microsoft Huihui Desktop", "rate": 1 }
}
outDir: Output directory (preferred); falls back to<projectDir>/video_demo/, thenD:/video_demo/.recorder: Shooting viewport, determines video resolution;jpegQuality68–75 is balanced.
2. Write lesson.json (Lesson Script)
This is the core of the instructional video: organized by "chapter → feature point", each step clearly describes "what this step teaches, how to operate it, how to read the result, and what key points exist". Refer to templates/lesson.example.json.
{
"systemName": "…",
"baseUrl": "http://127.0.0.1:8037",
"cardMs": 2000,
"intro": "Opening remark, one sentence explaining what this video covers.",
"outro": "Closing remark.",
"chapters": [
{
"title": "登录与工作台",
"summary": "What this chapter covers (will be displayed on the chapter card).",
"steps": [
{
"title": "账号登录",
"url": "/login",
"narration": "This sentence is the voiceover and also the subtitle. Colloquial, explaining one feature point at a time.",
"tips": "Optional, small text shown in the lower third",
"actions": [
{ "type": "fill", "selector": "input[placeholder=\"用户名 / 学号\"]", "value": "admin" },
{ "type": "fill", "selector": "input[placeholder=\"密码\"]", "value": "123456" },
{ "type": "click", "selector": "button.el-button", "label": "点击登录" },
{ "type": "wait", "ms": 1500 }
],
"holdMs": 1400
}
]
}
]
}
Field Description:
| Field | Required | Description |
|---|---|---|
cardMs | Chapter card duration in ms, default 2000 | |
intro / outro | Intro/outro narration; auto-generated if omitted | |
chapters[].title | ✅ | Chapter name (used for chapter card, lower third, teaching script) |
chapters[].summary | ✅ | Chapter introduction (subtitle of the chapter card + narration for that chapter) |
chapters[].card | Set to false to skip the chapter card for this chapter | |
steps[].title | ✅ | Feature point name (lower third main title + teaching script/checklist row name) |
steps[].url | Route for this feature point; navigation occurs before operation | |
steps[].narration | ✅ | Explanation text for this step (voiceover + subtitle) |
steps[].tips | Yellow key-point small text in the lower third | |
steps[].actions | Sequence of operations (see table below); empty means just display the page | |
steps[].highlight | Target to highlight after completion: { "selector": "..." } or { "text": "..." } | |
steps[].holdMs | Extra hold time after operations, default = settleMs | |
steps[].settleMs | Override for stabilization wait time after navigation for this step |
Supported type in actions:
| type | Parameters | Effect |
|---|---|---|
fill | selector (or omitted=first visible input), value | Clears and types character by character (visible typing for ≤44 characters) |
click | text or selector; findSelector (for highlight positioning); label; ms | Clicks, draws cursor/highlight/ripple |
goto | url, ms | Route navigation |
press | key | Keyboard press (e.g., Enter) |
hover | text/selector | Hover |
scroll | dy | Page scroll |
wait | ms | Pure wait (for API/animation) |
When clicking a button in a multi-row table, use
selector: ".el-table__body .el-button >> nth=0", andfindSelector: ".el-table__body .el-button"to specify the highlight target, to avoid "matched 2 elements" errors.
3. One-Click Video Generation
python -I scripts/run_all.py ~/ego-walkthrough/<project>
If lesson.json is detected in the working directory, it runs in instructional video mode (skipping auto-discovery). Four phases: recording → narration/subtitles/teaching script → composition, with real-time logging.
Alternatively, use --lesson path/to/lesson.json to explicitly specify (copied to working directory).
4. Fine-Tuning (Optional)
To change the narration of a single step without re-recording, write a narration.json (keys are step indices) and re-run only narration and composition:
python -I scripts/run_all.py ~/ego-walkthrough/<project> --narrate-only --script narration.json
TTS Voices (voice)
The TTS engine can be switched, configured in config.json under voice:
| engine | Example | Description |
|---|---|---|
edge (Recommended) | {"engine":"edge","name":"zh-CN-YunxiNeural","rate":1} | Microsoft neural voices, high naturalness, requires internet (edge-tts) |
sapi | {"engine":"sapi","name":"Microsoft Huihui Desktop","rate":0} | Offline Windows SAPI, more robotic |
| Auto | Only fill name | If name starts with zh-CN-, uses edge; otherwise uses sapi |
Common Chinese neural voices (for the name field):
- Female:
zh-CN-XiaoxiaoNeural(Xiaoxiao·warm),zh-CN-XiaoyiNeural(Xiaoyi·lively),zh-CN-liaoning-XiaobeiNeural(Northeastern dialect·humorous),zh-CN-shaanxi-XiaoniNeural(Shaanxi dialect·bright) - Male:
zh-CN-YunxiNeural(Yunxi·sunny),zh-CN-YunyangNeural(Yunyang·steady professional),zh-CN-YunjianNeural(Yunjian·passionate),zh-CN-YunxiaNeural(Yunxia·cartoonish cute)
Optional fields: volume (e.g., "+0%"), pitch (e.g., "+0Hz"), edgeRate (e.g., "+10%", takes precedence over rate). If edge synthesis fails (no network/not installed), it automatically falls back to SAPI offline voice without interrupting video generation.
To use your own real voice: ① Send your recorded audio files segmented by speech lines, and the script will replace them with external audio tracks (100% real voice); ② Integrate a voice-cloning TTS (CosyVoice / GPT-SoVITS / Volcano / MiniMax / Azure) and replace the
synthmodule. The built-in engine does not include the ability to clone a recording and generate arbitrary speech.
Upload to Cloud Effect (alongside thesis)
After video generation, the output can be automatically uploaded to a specified directory in a Codeup repository on Alibaba Cloud Effect, by default placed in the same directory as the thesis (论文/). Configure publish in config.json:
"publish": {
"enabled": true,
"repo": "https://example-cn-beijing.devops.aliyuncs.com/codeup/bishe007.git",
"branch": "main",
"dir": "论文",
"subdir": "",
"filename": "{system}_教学视频_{date}.mp4",
"includeDocs": false,
"localRepo": "D:/existing_clone_path (optional)",
"commit": "docs(演示视频): 新增《{system}》教学视频({date})"
}
- Trigger:
publish.enabled=trueor command line--publish;--no-publishskips;--dry-run-publishfor rehearsal only. dirdefaults to论文(same directory as thesis); can also use"dir":"论文","subdir":"系统演示视频"for a subdirectory.- Credentials: Reuses local git credentials (Git Credential Manager); can also configure
publish.token(+user) for temporary authentication, not stored on disk. - Safety: Only
git adds the target files in the target directory; no force push; aborts iflocalRepohas unpushed commits or tracked changes (override with--force). - Standalone execution:
python -I scripts/publish.py <working_directory> --video <output.mp4> [--dry-run].
One-Click: Just Provide the Cloud Effect Repo ID (e.g., bishe-lw)
python -I scripts/make.py 007
Automatically completes: Parse repo ID (reuse bishe-lw cloud effect config and token) → Clone to D:\Tools_Home\DeepseekHarness_Load\video\<project_id>\repo → Auto-start the system → Generate lesson script (if not provided, auto-enumerate menus) → Record/Synthesize → Upload back to Cloud Effect (defaults to 论文/ directory).
Common parameters:
| Parameter | Effect |
|---|---|
--lesson lesson.json | Specify lesson script (higher quality; if omitted, auto-generates via menu enumeration) |
--url http://127.0.0.1:8080 | Skip auto-start if system is already running |
--voice zh-CN-YunxiNeural | TTS voice (default Xiaoxiao) |
--no-publish | Local output only, no upload |
--workdir-root <directory> | Local root directory (default D:\Tools_Home\DeepseekHarness_Load\video) |
--username/--password | Auto-login credentials (default admin/123456) |
Local directory structure: D:\Tools_Home\DeepseekHarness_Load\video\<project_id>\: repo\ (clone), config.json, lesson.json, video_demo\*.mp4, run\ (intermediate files).
Auto-start supports Python (FastAPI/Flask)+SQLite final-year projects with a
frontend/distdirectory; for Java/Spring or frontends that require building, use--urlto specify a running address (see troubleshooting §8).
Let the Agent Write lesson.json for You (Recommended Workflow)
- First read the route tables / menu components / each page's vue in the system source code to list "module → page → feature point (buttons, forms, queries, modals, charts)".
- Write the
lesson.jsonfollowing the "chapter → feature point" structure, ensuring every feature point has a corresponding step; each step'snarrationshould be "what this is + how to operate + how to read the result". - First run a short segment (1–2 chapters) to verify selectors and login, then run the full set.
This produces not a "click through each tab" demo, but a "explain how each feature is used" tutorial.
Auto-Browse Mode (Legacy Compatible)
If no lesson.json is present, it falls back to the old logic: first discover a plan, manually review it, then run the entire process.
python -I scripts/run_all.py <project> --discover-only # Only generate plan.json, manually review
python -I scripts/run_all.py <project> # Auto-browse when lesson.json not present
menuSelector: Sidebar selector. Element Plus.el-menu-item; Ant.ant-menu-item; Nativeaside a, nav a.expandSubmenus(default true): Automatically expand collapsed submenus before discovery to avoid missing second-level menus.- Only clicks items on the
safeButtonswhitelist (query/refresh type), never delete/submit/payment.
Recording Principle & Hard Constraints (ego lite 0.6.3.17 Tested)
- Frame capture uses
page.cdp("Page.captureScreenshot", {format:"jpeg"})for periodic polling, deduplicates by screen changes, saves as jpg, and records timestamps. Approximately 2–4 fps; static pages only output frames on change; the final video uses "pause + narration" for pacing. - Do NOT use
Page.startScreencast+Page.screencastFrameAck: The new version of ego'sPage.cdpforbidssessionIdin params, but the ack requires it, causing only 1–3 frames before freezing (tested). The captureScreenshot path is stable. - Chapter cards/cursor/highlights/lower-third/ripples are injected as
#wt-uioverlay layers (position:fixed; z-indexextremely high,pointer-events:none) intodocument.body. Full-page navigation (goto) clears the overlay, so the script re-injects after each navigation. - Viewport is fixed using
Emulation.setDeviceMetricsOverridetorecorder.width × recorder.heightto avoid inconsistent frame sizes. - Positioning always uses temporary
data-wtmarkers or semantic selectors, never changes the target element'sid(would break the page's owngetElementById, which has been tested to cause loss of query box values). - Recording state (login tokens) is stored in the browser's same-origin localStorage; subsequent
gotooperations maintain login.
Output Artifacts
| File | Description |
|---|---|
<outDir>/<systemName>_教学_<yyyyMMdd-HHmm>.mp4 | Final video: intro card + chapter cards + feature-by-feature screens (with cursor/highlights/lower-third) + narration + burned-in subtitles + outro card |
run/教学讲稿.md | Chapter timeline + step-by-step narration + key points + anomaly list, directly editable |
run/功能点清单.md | Full feature checklist: Feature point / Page / Status (✅Normal / ❌Error) / Screenshot |
run/narration.srt | External subtitle file |
run/shots/*.png | One screenshot per feature point |
run/steps.jsonl | Structured stream (including chapters, feature points, operations, anomaly judgments) |
Output Specifications
- Video: H.264 / yuv420p / 30fps / AAC mono, resolution =
recorder.width × recorder.height - Structure: Intro card → (Chapter card → feature points in that chapter) xN → Outro card
- Naming:
<systemName>_教学_<yyyyMMdd-HHmm>.mp4
Common Failures
See references/troubleshooting.md. Most frequent:
- Stuck or only a few frames → Using old screencast path, or frame capture interval too large; this version uses captureScreenshot polling.
plan.jsonmodule count is 0 (auto-browse) →menuSelectoris wrong, or menu is inside an iframe.- Click error
matched 2 elements→ Add>> nth=0or use a more preciseselector. - No audio → SAPI voice name mismatch; leave
voice.nameempty to default to zh-CN. - Lesson script step selector not found → The step logs an anomaly and continues; check
run/shots/andsteps.jsonl, then modifylesson.jsonand re-run.