Communitygithub.com

TrBn17/blender-video-editor

Autonomous end-to-end video editing in Blender's Video Sequence Editor (VSE) via the existing Blender MCP and Blender Python API (4.4–5.3+). Use when inspecting or importing media, assembling multi-track timelines, trimming/splitting/retimed clips, adding transitions, eased keyframes, color grading, Blender 5.x compositor effects, audio mixing and ducking, Whisper SRT subtitles, animated titles/motion graphics, visual contact-sheet preview QA, or rendering and validating final videos.

What is blender-video-editor?

blender-video-editor is a Codex agent skill that autonomous end-to-end video editing in Blender's Video Sequence Editor (VSE) via the existing Blender MCP and Blender Python API (4.4–5.3+). Use when inspecting or importing media, assembling multi-track timelines, trimming/splitting/retimed clips, adding transitions, eased keyframes, color grading, Blender 5.x compositor effects, audio mixing and ducking, Whisper SRT subtitles, animated titles/motion graphics, visual contact-sheet preview QA, or rendering and validating final videos.

Works with~Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/TrBn17/blender-video-editor-skill/tree/HEAD/skills/blender-video-editor

Ask in your favorite AI

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

Documentation

Blender Video Editor

Autonomous, visual-QA-gated video production pipeline driving the user's live Blender VSE via an existing blender MCP server (mcp-for-blender via uvx mcp-for-blender or compatible blender-mcp exposing execute_blender_code, get_addon_status, get_scene_info, and look) plus four focused local helpers in scripts/.

Prerequisites

  • Blender 4.4–5.3+ running with the Blender MCP addon started (uvx mcp-for-blender install-addon).
  • Configured blender MCP server (command: "uvx", args: ["mcp-for-blender"]). Never duplicate or spawn a competing Blender MCP server; fail cleanly and direct the user to start the Blender MCP addon if get_addon_status cannot connect.
  • Host Python 3.10+ with imageio-ffmpeg (or system ffmpeg), opencv-python, pillow, numpy, scipy, and one local Whisper backend (faster-whisper, openai-whisper, or transformers + torch) when generating subtitles.

Tool Roles (Zero Duplication)

  • Existing blender MCP: Sole interface to live Blender. Call get_addon_status once to confirm version/connection, execute_blender_code for all bpy timeline operations and preview/final renders, and look(image=...) to visually inspect rendered stills and contact sheets.
    • Serialize Blender MCP calls: Issue one blender MCP call per turn to avoid socket aborts (WinError 10053) on single-connection Blender addons.
  • scripts/vse_lib.py: Pure-bpy VSE library imported inside execute_blender_code via sys.path.insert(0, r"<skill_dir>/scripts"); import vse_lib. Handles Blender 4.4–5.3+ API compatibility, tracks, trims, transitions, Action-Slot eased keyframes, color grading, Blender 5.x compositor/audio modifiers, SRT import, timeline audit, preview stills, and FFmpeg export presets.
  • scripts/media_tools.py: Host Python CLI (auto-discovers ffmpeg from PATH or imageio-ffmpeg, plus OpenCV/Pillow). Runs probe, preprocess (VFR→CFR, 16 kHz WAV, 2-pass EBU R128 loudnorm), analyze-audio (LUFS + speech/silence intervals), contact-sheet, and validate.
  • scripts/transcribe.py: Local Whisper ASR CLI (faster-whisper → openai-whisper → transformers cascade) outputting broadcast-wrapped .srt and .json.
  • scripts/gfx_tools.py: Supersampled Pillow RGBA motion-graphics generator (lower-third, title-card, badge, end-card) for crisp ALPHA_OVER overlays.

Disclosed References

Consult on demand when a branch requires deep detail:


End-to-End Autonomous Workflow

Follow all 7 stages in order. Never skip visual inspection (Stage 6) or automated render validation (Stage 7).

Stage 1 — Environment Check & Media Intake

  1. Call blender MCP get_addon_status once; confirm Blender version and live connection.
  2. Probe every source media file on the host:
    python "<skill_dir>/scripts/media_tools.py" probe <file1> [file2 ...]
    
  3. Preprocess before importing when probe reports:
    • vfr_suspected: true (screen recordings / mobile clips) → transcode to CFR at target project FPS:
      python "<skill_dir>/scripts/media_tools.py" preprocess <in> -o <cfr_out.mp4> --fps 30
      
    • Unnormalized dialogue or inconsistent clip levels → 2-pass EBU R128 normalize (--normalize-lufs -16).
  4. For dialogue/narration tracks, measure loudness and speech/silence spans for jump-cut and ducking planning:
    python "<skill_dir>/scripts/media_tools.py" analyze-audio <dialogue_or_video>
    

Completion criterion: Every source file is probed, VFR assets are converted to CFR, and target resolution, FPS, and audio spans are known.

Stage 2 — Editorial Plan & Scene Initialization

  1. Lock the edit specification (target resolution, FPS, aspect ratio, shot list with in/out times, transition style, color look, music/VO balance, title/subtitle plan).
  2. Initialize a clean VSE scene in Blender via execute_blender_code:
    import sys
    sys.path.insert(0, r"<skill_dir>/scripts")
    import vse_lib as vse
    
    scene = vse.setup_vse_scene(
        name="VideoEdit", width=1920, height=1080, fps=30,
        frame_start=1, frame_end=300, clear_existing=True,
    )
    
    setup_vse_scene enforces view_transform = "Standard", look = "None", sequencer_colorspace = "sRGB", use_sequencer = True, and 48 kHz stereo audio.
  3. Follow the deterministic channel layout in vse.CHANNELS:
    • 1: Music bed | 2: Ambience | 3: SFX | 4: Voiceover/Dialogue
    • 6–7: Main Video A/B (alternating for overlapping transitions) | 8: B-Roll / PIP
    • 9: Transitions | 10: Master Adjustment / Color Grade | 11–12: Letterbox bars
    • 13: RGBA Motion Graphics (lower-thirds, badges, cards) | 14: Titles | 15: Subtitles

Completion criterion: Dedicated VSE scene exists with view_transform == "Standard", matching resolution/FPS, and locked channel plan.

Stage 3 — Multi-Track Assembly, Trimming & Sequencing

  1. Import media via vse.add_movie, vse.add_sound, vse.add_image, vse.add_image_sequence, vse.add_color, or 3D vse.add_scene_strip.
  2. Trim non-destructively with vse.trim_strip(strip, offset_start=..., offset_end=...), cut via vse.split_strip(strip, frame), re-time via vse.set_speed(scene, strip, factor=...).
  3. Sequence clips across alternating channels VIDEO_A / VIDEO_B with overlap frames for transitions using vse.sequence_strips(clips, start_frame=1, overlap=15, alternate_channels=(6, 7)).
  4. Fit scene bounds with vse.sync_scene_range(scene) and audit with vse.inspect_timeline(scene).

Completion criterion: vse.inspect_timeline(scene) returns zero missing-media warnings and zero unintended visual gaps.

Stage 4 — Transitions, Keyframes, Color Grading & Audio Mixing

  1. Transitions: Apply vse.add_crossfade, vse.add_wipe, vse.add_dip_to_color, and vse.add_fade on visual/audio boundaries. Keep cuts tight (crossfades 10–18 frames at 30 fps; reserve wipes for intentional chapter shifts).
  2. Motion & Keyframes: Use vse.add_ken_burns on still shots/cards, vse.animate_slide / vse.animate_pop on overlays, and vse.keyframe_strip_prop for custom eased animations (CUBIC, SINE, EXPO, BACK).
  3. Color Grading & Cinematic Effects:
    • Grade per-clip for matching exposure/white balance, then apply an AdjustmentStrip (vse.add_adjustment_layer) across the sequence with vse.apply_color_grade(adj, preset="cinematic_teal_orange") (or custom Lift/Gamma/Gain + S-curve).
    • Add Blender 5.x native VSE Compositor modifiers when stylistically warranted: vse.add_compositor_vignette, vse.add_compositor_bloom, vse.add_compositor_sharpen, and optional vse.add_letterbox(scene, aspect=2.35).
  4. Audio Mixing:
    • Keep dialogue near 0 dB (normalized to -16 LUFS source).
    • Duck background music automatically around speech spans using vse.duck_audio(scene, music, speech_frame_ranges, base_db=-10.0, duck_db=-22.0) with smooth fade-in/fade-out.
    • Use Blender 5.x audio modifiers (vse.add_audio_echo, vse.add_audio_pitch) for sound design when needed.

Completion criterion: All transitions, grade modifiers, keyframed curves, and audio mix envelopes are confirmed via vse.inspect_timeline(scene).

Stage 5 — Subtitles, Animated Titles & Motion Graphics

  1. Whisper Subtitles (for any narrated/dialogue video):
    python "<skill_dir>/scripts/transcribe.py" <voiceover_or_mixdown> -o <subs.srt> --output-json <subs.json> --model base
    
    (If dialogue spans multiple timeline strips, export vse.mixdown_audio(scene, "mixdown.wav") first, transcribe the mixdown, and import at frame_offset=0.)
  2. Import subtitles into Blender VSE on channel 15:
    vse.import_srt(scene, r"<subs.srt>", channel=vse.CHANNELS["SUBTITLE"], font_size=42, y_pos=0.11, use_box=True)
    
  3. Motion Graphics & Titles:
    • Generate crisp RGBA PNG overlays with gfx_tools.py (title-card, lower-third, badge, end-card) using a cohesive palette and import onto channel 13 (ALPHA_OVER) with eased slide/pop/fade keyframes.
    • For simple kinetic callouts, use vse.add_text on channel 14 with loaded TrueType font, contrast shadow/box, and safe-area placement (avoid colliding with subtitles in the bottom 15% band or letterbox bars).

Completion criterion: Every title, graphic, and subtitle strip sits inside safe margins with zero channel collisions or overlap with letterbox/caption bands.

Stage 6 — Preview Rendering, Visual Inspection & Iterative Refinement

  1. Pick 6–12 diagnostic frames covering: opening title, every scene cut, transition midpoints, lower-third/graphics peak, subtitle frames, and closing card.
  2. Render preview PNGs cleanly via execute_blender_code:
    vse.render_preview_frames(scene, frames=[...], out_dir=r"<work_dir>/previews", resolution_percentage=50)
    
  3. Assemble a labeled contact sheet on the host:
    python "<skill_dir>/scripts/media_tools.py" contact-sheet "<work_dir>/previews/"*.png -o "<work_dir>/contact_sheet.png" --cols 3 --fps 30
    
  4. Inspect <work_dir>/contact_sheet.png visually via read_file (or Blender MCP look(image=r"<work_dir>/contact_sheet.png", max_size=1280) — note that if the client offloads MCP image payloads to disk, call read_file on the PNG path so you inspect every pixel directly). Inspect individual full-frame stills when checking fine typography.
  5. Audit every tile against the visual QA rubric:
    • Color accuracy (no AgX washout, consistent white balance/contrast across cuts).
    • Framing & scaling (no unintended letterboxing/pillarboxing or clipped edges).
    • Typography & legibility (sharp fonts, high contrast, zero overlap between titles, lower-thirds, subtitles, and letterbox bars).
    • Transition midpoints (smooth blends, no single-frame black flashes or abrupt jumps).
  6. Fix every discovered defect on the timeline, re-render affected frames, and re-inspect via look until clean.

Completion criterion: Latest contact sheet inspected via look(image=...) passes every visual rubric item with zero unresolved defects.

Stage 7 — Final Render & Automated Quality Validation

  1. Save the .blend project file and render final output via vse.render_video(scene, output_path=r"<out.mp4>", preset="h264_high", save_blend_path=r"<project.blend>").
    • For long timelines (>30 s at 1080p), save .blend first and warn/render in chunks or non-blocking CLI when available so the MCP call stays responsive.
  2. Run the automated QA validator on the rendered video:
    python "<skill_dir>/scripts/media_tools.py" validate "<out.mp4>" --expect-width 1920 --expect-height 1080 --expect-fps 30 --min-duration <sec>
    
  3. Extract a final-render contact sheet directly from <out.mp4> and visually spot-check via look(image=...):
    python "<skill_dir>/scripts/media_tools.py" contact-sheet "<out.mp4>" -o "<work_dir>/final_qa_sheet.png" --cols 3 --video-samples 9
    
  4. If validation reports any FAIL (or severe WARN such as clipping > -0.5 dBTP, silent audio, wrong dimensions, or black frames), fix the root cause in Blender, re-render, and re-validate.

Completion criterion: media_tools.py validate exits 0 (PASS, or explicitly justified WARN), final contact sheet is visually verified via look, and both <project.blend> and <out.mp4> are saved on disk.

Related Skills