返回资讯中心
外部精选
软件工程
#开发者实时流

Codetovideo 发布本地网页演示视频生成器,4B 模型即可驱动

来源标题:Codetovideo – Local web app demo generator using 4B models and FFmpeg

Codetovideo 是一个完全本地运行的网页应用演示/宣传视频生成器:指向任意网页应用并写一句话,即可生成 .mp4,由 AI 负责导演、真实程序负责录制。它基于 Ollama + qwen3.5:4b 构建,也兼容 OpenAI 接口的 Gemini 2.5/3.5 等 LLM。支持演示走查和企业宣传两种格式、480p 到 4K,免费且无音频,数据不出本机。

Hacker News 最新anatomik62026/11/24 · 今天22 分钟阅读

以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。

Point it at any web app, write one sentence, get a demo or promo video. The AI directs; a real program records. Free, fully local, no audio.

Quick start · Formats · How it works · Honest status · Help wanted · Manual

▶ Made end to end by CTV with qwen3.5:4b running locally and no manual editing; the neon backdrop was drawn by the model itself (--backdrop generate). Click the animation to play the full video.

So CTV flips the roles: the AI is only the director; the program is real.

You bring any OpenAI-compatible LLM: a free API key, or a small model on your own machine. I built it on Ollama + qwen3.5:4b (a weak 4B model, and it was enough) and also ran it with Gemini 2.5 and 3.5 through their OpenAI-compatible API, which worked too.

One prompt, one .mp4. Say the language in the prompt ("in English", "на русском", "auf Deutsch") and titles/captions follow.

Two formats: a demo walkthrough and a corporate-promo look with camera moves and call-outs. Details.

480p to 4K, genuinely sharper at higher settings.

Runs entirely on your machine, even in a closed environment. With a local model nothing ever leaves your computer: no cloud, no telemetry, no stock/TTS/image APIs. Demo and promo videos of an internal or private app are fine to make offline, even on a small model.

Self-healing local Ollama. If it is installed but not running, CTV starts it and keeps the model warm.

Language-free navigation. No per-site selectors, button texts or word lists in the code. DOM / ARIA / geometry decide how to act, your LLM decides what a button means.

Multi-step uploads. Several --upload files are fed to the app one per step, in order.

Pacing from the prompt. "Scroll slowly" really changes scroll duration, step size and hold time.

Non-destructive editing. Change one scene (title, caption, colors, background, or even re-shoot it) without touching the rest.

Desktop app for setup, generation and edits (Electron, not a localhost web page) and a full CLI.

Quick start

Requirements: Node.js 20+ (22 recommended). For the free local route, install Ollama.

git clone https://github.com/Anatomik5/codetovideo.git cd codetovideo npm install # also downloads Chromium for Playwright ollama pull qwen3.5:4b npm run app # opens the desktop app

Windows: double-click start-app.vbs (no console window; installs on first run). macOS / Linux: ./start-app.sh (unverified, please report).

In the app: choose Ollama (local, free), model qwen3.5:4b, leave the key empty. You do not need to start Ollama yourself.

The repo ships a tiny three-step example app:

npx ts-node scripts/demo-pipeline.ts
--file examples/hello-wizard/server.js
--upload examples/hello-wizard/sample.csv
--model "qwen3.5:4b" --base-url "http://localhost:11434/v1"
--prompt "Show the full workflow from upload to export, in English"

Your own app

npx ts-node scripts/demo-pipeline.ts
--file "path/to/your/project/or/launch-file"
--upload "data/sample.xlsx"
--format promo --quality 1080
--model "gemini-2.5-flash" --base-url "https://generativelanguage.googleapis.com/v1beta/openai/" --api-key "$KEY"
--prompt "Quick, energetic overview: import, review, export. Captions in English."

Already running app? Use --url http://localhost:3000 instead of --file. Free cloud keys work too (Gemini, OpenRouter, Groq, ...); put them in .env (see .env.example) or pass --api-key.

Option Values What it does

--format demo (default) Walkthrough: browser window on an animated backdrop (strokes flicker, light sweeps travel through the artwork), badge + subtitle per scene.

promo Corporate-ad look: clean gradient, floating tilted window, camera pushes toward the real action, a zoomed call-out cropped from the recording, word-by-word captions, logo end card.

--backdrop (demo) auto (default for cloud models) Model draws an SVG; if it is too sparse, a neutral motif fills the edges.

generate The model draws everything. Best with strong models.

motif (default for local models) The model only picks a motif family (circuit, lattice, waves, skyline, constellation); the built-in generator draws it. Fast, ideal for small models.

--quality 480 … 2160 Output height in px (default 720). The browser is captured at a matching real device scale factor, so higher is sharper, and slower.

Both formats are silent by design.

Every run is saved as a session (out/sessions/<id>/: manifest.json, clips/scene_NN.mp4, props.json, final.mp4).

change a title (re-renders only the affected frames)

npx ts-node scripts/demo-pipeline.ts --edit-scene 2 --edit-prompt "Change this scene's title to Cost Breakdown"

re-shoot only scene 3

npx ts-node scripts/demo-pipeline.ts --edit-scene 3 --edit-prompt "Re-shoot this step and scroll down to the table"

Your LLM decides which mode the instruction needs:

Editable source: docs/architecture.drawio · regenerate with node scripts/build-diagram.cjs.

Flag Meaning

--file / --repo Project folder or launch file. CTV studies the repo, starts the app, finds its URL.

--url URL of an already running web app (skips launching).

--launch "<cmd>" Command that starts the app. Overrides the model's proposal (see Security).

--port Preferred port of the launched app.

--prompt Free-form instructions in any language: scenario, caption language, style, colors, pacing.

--upload File to upload in the app. Repeat for several; used in order.

--model --base-url --api-key Your LLM (LLM_MODEL, LLM_BASE_URL, LLM_API_KEY also work). Ollama needs no key.

--theme auto · dark · light

--format --backdrop --quality See above.

--out Output .mp4 (default out/demo.mp4).

--project-dir / --session Saved session to edit (default: newest in out/sessions/).

--edit-scene <n|id> --edit-prompt "…" Scene (1-based or id like beat_3) and what to change.

--re-render-only Rebuild the final video from saved clips and manifest; no browser.

--max-steps <n> --no-render Developer aids for quick smoke tests.

Honest status

CTV is alpha. It works end to end, but on a very small test surface. Please read this before you invest time:

If any of this bites you, open a run report: that is exactly the feedback the project needs.

I built CTV alone because I was annoyed, and it has outgrown what one person on one machine can test. If this idea is useful to you, please help make it solid. Concretely:

The full list with context is in ROADMAP.md; ground rules are in CONTRIBUTING.md. Small PRs and honest bug reports are equally welcome. ⭐ A star helps others find the project.

CTV launches your app and clicks through it like a user. Do not point it at systems with real data or side effects.

Repo excerpts and page labels go only to the LLM endpoint you configure. Local model = nothing leaves your machine. No telemetry, no other network calls.

Model-proposed start commands are ignored unless they are a plain call to a known dev runtime (python, node, npm, uvicorn, cargo, ...). Use --launch for anything else. Treat untrusted repositories as untrusted code anyway.

The desktop app stores your API key encrypted with the OS keychain when available.

Details and how to report a vulnerability: SECURITY.md.

Is it really free? CTV has no per-use cost: your own LLM or a free API key, plus local tools. Mind Remotion's license for commercial use and your provider's free-tier limits.

Why not just use a text-to-video model? Those invent UI. CTV only shows what your app actually does.

Why not just screen-record? You can! CTV adds the director: it plans scenes, drives the app, times captions to the real clicks, and lets you edit one scene later without redoing everything.

Which model should I use? Start with qwen3.5:4b via Ollama (what it was built on). For better plans and captions use a stronger model; for the demo background, pick --backdrop generate with strong models or motif with small ones.

Can it narrate? Not yet; videos are silent by design for now.

My app needs a login. Not supported out of the box. Run the app logged in or with a demo account via --url, and tell us how it went.

app/ desktop app (Electron): main.js, preload.js, index.html scripts/demo-pipeline.ts the whole pipeline + CLI scripts/build-diagram.cjs regenerates docs/architecture.* src/ Remotion compositions: DynamicDemoScene (demo), PromoScene (promo) examples/hello-wizard/ tiny app to try CTV with tests/ unit tests (npm test) docs/ manual, architecture diagram, demo, translations out/sessions/ your saved sessions (git-ignored)

Community

CONTRIBUTING.md · CODE_OF_CONDUCT.md · SECURITY.md · CHANGELOG.md · ROADMAP.md · THIRD_PARTY.md

Translations: Русский (community-style translation, may lag behind this file).

CTV is released under the MIT License: use it for free, for any purpose, modify it and share it. The dependencies keep their own licenses, most importantly Remotion's (companies above a small size need its commercial license): see THIRD_PARTY.md.

正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。

打开原文
去社区讨论 →