local-ai-video-pipeline
Skill0 starsChanged 5 months agoMITView on GitHub
無料ローカルでAI動画を作る時(静止画→動画クリップ→連結)。ComfyUI/RealVisXL静止画にffmpegでKen Burnsモーションを付けて繋ぐ。ffmpegがbashのwhile-readループのstdinを食う罠に当たった時も。
In this repository99 other files it gives its agents.
- agents-tools-quoted-jsonSkill
- asc-api-app-store-submitSkill
- asd-ste100Skill
- automation-bool-selector-pitfallsSkill
- automation-stale-cooldown-flagSkill
- autonomous-build-verifySkill
- book-to-skillSkill
- ccusage-cli-cost-trackingSkill
- chrome-ext-mv3-programmatic-injectSkill
- chrome-ext-store-assetsSkill
- claude-headless-p-invocationSkill
- claude-plugin-context-auditSkill
- claude-session-log-to-kbSkill
- cloudflare-workers-do-deploySkill
- codebase-to-courseSkill
- codesign-keychain-prompt-fixSkill
- codex-cli-setupSkill
- codex-delegation-handoffSkill
- content-factory-grounding-dedupSkill
- conversation-log-append-patternSkill
- cron-to-launchd-macosSkill
- cross-automation-shared-resource-killSkill
- design-token-migration-rnSkill
- discord-bot-image-to-claudeSkill
- discord-gateway-resume-dedupSkill
- excel-filtered-url-http-auditSkill
- execution-budget-vs-capsSkill
- expo-free-local-ios-testflightSkill
- ga4-connect-projectsSkill
- gcal-oauth-desktop-setupSkill
- git-commit-helperSkill
- git-prepush-secret-remote-checkSkill
- gsc-cli-automationSkill
- hatena-blogsync-autopostSkill
- hook-latency-wrapSkill
- hook-log-append-patternSkill
- html-to-pdf-slide-deckSkill
- humanizerSkill
- human-review-gate-shellSkill
- implementation-model-routingSkill
- insights-to-claude-mdSkill
- ios-permission-key-security-matrixSkill
- ios-sim-store-screenshotsSkill
- launchd-exit78-exconfig-debugSkill
- llm-content-pipeline-quality-gateSkill
- local-flux-mflux-image-genSkill
- local-llm-slow-diagnosisSkill
- local-music-generationSkill
- lottie-skottie-authoring-pitfallsSkill
- machine-wide-api-ratelimit-latchSkill
- macos-hook-path-timeoutSkill
- md-to-docx-reportSkill
- memory-md-inject-bloat-auditSkill
- message-display-secrets-maskSkill
- metric-source-attributionSkill
- migrate-icloud-desktop-assetsSkill
- nextauth-local-e2e-sessionSkill
- nextjs-rsc-payload-slimSkill
- nothing-designSkill
- openclaw-ollama-setupSkill
- The first 60 shown.
The file
Files
Procedure
実装正典: ~/dev/ai-video-factory(07-pc-automation)。generate.sh scenes/x.txt [--bgm f] [--fps 30]。
構成(流用可):
- 静止画:
lib/comfy_txt2img.py "<prompt>" out.png [seed]— ComfyUI API(127.0.0.1:8188)/RealVisXL V5.0/1344x768。先にcd ~/dev/comfyui && .venv/bin/python main.py --port 8188 &。初回~145秒。 - モーション(Tier1・追加DL不要):
lib/kenburns.py still.png clip.mp4 [dur] [fps] [motion] [W] [H]— ffmpeg zoompanでパン/ズーム。motion=zoom_in|zoom_out|pan_left|pan_right|pan_up|pan_down|auto。 - モーション(Tier2・opt-in):
lib/svd_img2vid.py still.png clip.mp4— SVD img2vid(本物の生成モーション)。要svd_xt.safetensors9.5GB(未DLなら手順表示で停止)。MPSで数分/クリップ。 - 連結:
lib/stitch.py out.mp4 clip1 clip2 ... [--bgm f] [--xfade 0.6]— xfadeクロスフェード+BGMはloudnorm整音+末尾フェード。
シーン定義(1行1シーン): <英語prompt> :: <秒> :: <motion>(::以降省略可・#コメント)。
Pitfalls
- 🔴 ffmpegがwhile-readのstdinを食う:
while read line; do ffmpeg ...; done < fileだと ffmpeg が標準入力からfileの残り行を読み取り、1呼び出しごとに1行飛ぶ(2行目以降が欠落)。必ずffmpeg -nostdin ...(または</dev/null)。subprocessでも同じ。これが今回の主因だった。 - zoompanのジッター/crop失敗: プリスケールがcropサイズ未満だと "Invalid too big or non positive size"。
scale={W*2}:{H*2}:force_original_aspect_ratio=increase,crop={W*2}:{H*2}で出力比2倍へ拡大してからzoompan、で両方解決。 - ComfyUI 8188 残存プロセス衝突:
lsof -nP -iTCP:8188 -sTCP:LISTEN -t | xargs kill -9。 - SDXLは日本語不可: テロップは後段でPIL等で乗せる(senior-tube方式)。
- 配信用BGM: 権利フリーのみ(music-labの自作MIDI等)。AI生成物は「AI生成」と明示。実在人物なりすまし・アダルト量産はやらない。
Verification
ffprobe -v error -show_entries format=duration:stream=width,height,nb_frames -of default=noprint_wrappers=1 out.mp4- 尺の検算: xfade連結の総尺 = Σdur − (clips−1)×xfade。例 4+3.5+4 − 2×0.6 = 10.3s。
- 静止画はReadで目視(ダミー/壊れでないか)。全シーン数=stills数=clips数を確認(ffmpeg stdin罠の検出)。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

