Communitygithub.com

Short Video Factory

Batch edit vertical promotional short videos (for Douyin/WeChat Channels, ~30 seconds): raw footage + event 'summary card' → auto-write scripts based on trending templates, SAMI dubbing from Jianying, select clips, render to 60fps, auto quality check, single command outputs N uniquely varied videos. Use when users say "batch edit videos / replicate trending videos / output by template / edit N copies like this video / mall event promotional videos / mass produce short videos". Code repo at E:/short-video-factory (GUI: app.py).

What is Short Video Factory?

Short Video Factory is a powerful, specialized AI skill designed for batch production of vertical short promotional videos—typically 30 seconds—for platforms like Douyin and WeChat Channels. It transforms a set of raw footage clips, a single event summary card ("明白卡"), and a reference trending video into dozens of varied, delivery-ready videos with a single command. The skill supports both a graphical workbench (app.py, accessible via a local server) and a command-line interface for advanced batch operations. It leverages Jianying's (剪映) SAMI text-to-speech system for dubbing, integrates with Jianying's cloud music library, and renders locally at 60fps for high-quality output. Key features include automated script writing based on customizable templates, smart clip selection with risk material detection, multi-style output rotation (e.g., information seeding, host speaking, beat-synced edits, list-style, ambiance), and automated quality assurance with frame extraction and report generation. The system operates under strict rules: promotional numbers must come only from the project's whitelist, banned words are enforced, and risky footage (e.g., children's faces, blurred shots, out-of-season signage) is automatically excluded. It is intended for developers and content creators who need to rapidly generate large volumes of unique, on-brand short videos from existing assets, following a reference video or template.

Works with✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Joho6666/short-video-factory/tree/HEAD/skills/short-video-factory

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

What does Short Video Factory do?

Turn "a pile of raw footage + an event summary card + a reference trending video" into dozens of distinct, delivery-ready 30-second vertical promotional videos.

Repository: E:/short-video-factory (Python, standalone .venv). Project data resides in a separate project directory (as specified by config.json's project key); the codebase contains no customer content.

When to Use

  • User wants to "create N copies following a trending video", "batch produce videos", or "edit these clips into promotional shorts"
  • An existing project needs ongoing video output, script changes, style adjustments, or client feedback fixes

Hard Rules (Violations Lead to Delivery Failures)

  1. Promotional numbers must come only from the summary card: These are written in the project's project.json under number_whitelist. If any number outside the whitelist appears in a script, the generator will reject it—do not add numbers to the whitelist to bypass this; ask the user first.
  2. Banned words: Defined in banned_words (extreme claims + words the client expressly forbids, e.g., "双节" (Double Festival)).
  3. Avoid risky footage: Clips marked in the index (children's faces, bystanders' faces, celebrity likenesses, brand-owned discount signs, camera operator's fingers, blurred shots, signage for out-of-season events like Hamburg Festival).
  4. Spoken numbers: Dubbing text is automatically converted to Chinese characters (e.g., "450 group 500" becomes "四百五十团五百"), while subtitles display Arabic numerals. When adding new numbers, update spoken_numbers accordingly.
  5. No paid services: Dubbing uses Jianying's SAMI (via the jianying-editor skill), music uses Jianying's cloud library, and everything is rendered locally. Ask the user before using paid dubbing or generative services.
  6. Only modify the project directory and the repository; original footage is read-only.
  7. If you cannot see the visuals or hear the audio, base your conclusions on "frame extraction / transcription verification" and let the user judge the audio feel.

Standard Workflow

cd E:/short-video-factory
.venv/Scripts/python app.py                 # Graphical workbench at http://127.0.0.1:7860
# Or via command line:
.venv/Scripts/python svf/batch.py --n 6 --start 601 -j 3 --qc-sample 0.2   # Output 6 videos
.venv/Scripts/python svf/batch.py --n 70 --start 900 --dry                   # Preview script repetition only

Output: <project>/成片/批次_bXXX-bYYY/ (mp4 + frame extracts + report.md + manifest.csv). Each video also generates a Jianying draft (can be manually refined and exported from Jianying).

New Project Setup (One-Time)

  1. Create a project directory and write project.json (refer to the repo's projects/example/project.json): brand name, source footage sources, whitelist, banned words, dubbing, music, host speech clips.
  2. svf/ingest_mingbaika.py <summary_card.xlsx> → List the numbers from the summary card, confirm with the user, then write the whitelist.
  3. svf/ingest_proxy.py → Convert all footage to 1080x1920/60fps previews (with automatic HDR tone mapping).
  4. svf/ingest_sheets.py → Generate a contact sheet; Claude reviews the contact sheet, classifies each clip, and tags risk markers, writes 数据/素材索引.json (fields: filename/duration/category/content/markers/preview).
  5. svf/ingest_transcribe.py → Transcribe the host's speech, select usable original sentences, and write them into project.json's host_clips.
  6. Analyze the reference trending video: break it down frame by frame (clip duration, transition points, subtitle styles, text overlays), if needed, overlap frames with the material to reconstruct the editor's timeline; save results to templates/.
  7. Write 数据/文案池.json (5–10 variations per category). Verify in the GUI "文案池" (Script Pool) page before outputting videos.

Five Styles (Rotated)

S1: Informative Seeding · S2: Host Speech (original audio + lip-sync accelerated) · S3: Beat-Synced Montage (clips snap to music beats) · S4: List Style (N reasons) · S5: Ambiance Showcase (slow tempo)

Handling Client Feedback

  • Wording changes → Modify the script pool / banned words; do not manually edit a single script (generator will overwrite)
  • Speech speed → Adjust project.json's batch.speed (per style)
  • Shaky/choppy video → Default is 60fps + 1.5x pre-upscaling; if it persists, check the original clip
  • Misplaced subtitle breaks → Add the word to caption_words (it will not be split across lines)

Experience & Pitfalls

See the repository's docs/经验教训.md for details. Key points: Jianying 6.0+ drafts are encrypted and cannot be auto-exported from version 11.5; SAMI may pronounce 500 as "五零零"; full-length transcriptions may miss or duplicate sentences (work sentence by sentence); parallel rendering is CPU-bound; HDR footage without tone mapping will appear washed out.

Related Skills