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
blenderMCP 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 ifget_addon_statuscannot connect. - Host Python 3.10+ with
imageio-ffmpeg(or systemffmpeg),opencv-python,pillow,numpy,scipy, and one local Whisper backend (faster-whisper,openai-whisper, ortransformers+torch) when generating subtitles.
Tool Roles (Zero Duplication)
- Existing
blenderMCP: Sole interface to live Blender. Callget_addon_statusonce to confirm version/connection,execute_blender_codefor allbpytimeline operations and preview/final renders, andlook(image=...)to visually inspect rendered stills and contact sheets.- Serialize Blender MCP calls: Issue one
blenderMCP call per turn to avoid socket aborts (WinError 10053) on single-connection Blender addons.
- Serialize Blender MCP calls: Issue one
scripts/vse_lib.py: Pure-bpyVSE library imported insideexecute_blender_codeviasys.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-discoversffmpegfromPATHorimageio-ffmpeg, plus OpenCV/Pillow). Runsprobe,preprocess(VFR→CFR, 16 kHz WAV, 2-pass EBU R128loudnorm),analyze-audio(LUFS + speech/silence intervals),contact-sheet, andvalidate.scripts/transcribe.py: Local Whisper ASR CLI (faster-whisper→openai-whisper→transformerscascade) outputting broadcast-wrapped.srtand.json.scripts/gfx_tools.py: Supersampled Pillow RGBA motion-graphics generator (lower-third,title-card,badge,end-card) for crispALPHA_OVERoverlays.
Disclosed References
Consult on demand when a branch requires deep detail:
- Blender 4.4–5.3+ VSE API & breaking changes (
.strips,new_effect, Action Slots/Channelbags,media_type, Compositor/Audio strip modifiers):references/blender-5-vse-api.md - Editorial grammar, presets, color/audio targets & safe areas:
references/editing-craft-and-presets.md - Failure modes & verified fixes:
references/troubleshooting.md - Complete runnable reference pipeline:
examples/build_sample_showcase.py
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
- Call
blenderMCPget_addon_statusonce; confirm Blender version and live connection. - Probe every source media file on the host:
python "<skill_dir>/scripts/media_tools.py" probe <file1> [file2 ...] - Preprocess before importing when
probereports: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).
- 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
- 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).
- 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_sceneenforcesview_transform = "Standard",look = "None",sequencer_colorspace = "sRGB",use_sequencer = True, and 48 kHz stereo audio. - Follow the deterministic channel layout in
vse.CHANNELS:1: Music bed |2: Ambience |3: SFX |4: Voiceover/Dialogue6–7: Main Video A/B (alternating for overlapping transitions) |8: B-Roll / PIP9: Transitions |10: Master Adjustment / Color Grade |11–12: Letterbox bars13: 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
- Import media via
vse.add_movie,vse.add_sound,vse.add_image,vse.add_image_sequence,vse.add_color, or 3Dvse.add_scene_strip. - Trim non-destructively with
vse.trim_strip(strip, offset_start=..., offset_end=...), cut viavse.split_strip(strip, frame), re-time viavse.set_speed(scene, strip, factor=...). - Sequence clips across alternating channels
VIDEO_A/VIDEO_Bwith overlap frames for transitions usingvse.sequence_strips(clips, start_frame=1, overlap=15, alternate_channels=(6, 7)). - Fit scene bounds with
vse.sync_scene_range(scene)and audit withvse.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
- Transitions: Apply
vse.add_crossfade,vse.add_wipe,vse.add_dip_to_color, andvse.add_fadeon visual/audio boundaries. Keep cuts tight (crossfades 10–18 frames at 30 fps; reserve wipes for intentional chapter shifts). - Motion & Keyframes: Use
vse.add_ken_burnson still shots/cards,vse.animate_slide/vse.animate_popon overlays, andvse.keyframe_strip_propfor custom eased animations (CUBIC,SINE,EXPO,BACK). - Color Grading & Cinematic Effects:
- Grade per-clip for matching exposure/white balance, then apply an
AdjustmentStrip(vse.add_adjustment_layer) across the sequence withvse.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 optionalvse.add_letterbox(scene, aspect=2.35).
- Grade per-clip for matching exposure/white balance, then apply an
- Audio Mixing:
- Keep dialogue near
0 dB(normalized to-16 LUFSsource). - 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.
- Keep dialogue near
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
- Whisper Subtitles (for any narrated/dialogue video):
(If dialogue spans multiple timeline strips, exportpython "<skill_dir>/scripts/transcribe.py" <voiceover_or_mixdown> -o <subs.srt> --output-json <subs.json> --model basevse.mixdown_audio(scene, "mixdown.wav")first, transcribe the mixdown, and import atframe_offset=0.) - 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) - 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 channel13(ALPHA_OVER) with eased slide/pop/fade keyframes. - For simple kinetic callouts, use
vse.add_texton channel14with loaded TrueType font, contrast shadow/box, and safe-area placement (avoid colliding with subtitles in the bottom 15% band or letterbox bars).
- Generate crisp RGBA PNG overlays with
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
- Pick 6–12 diagnostic frames covering: opening title, every scene cut, transition midpoints, lower-third/graphics peak, subtitle frames, and closing card.
- Render preview PNGs cleanly via
execute_blender_code:vse.render_preview_frames(scene, frames=[...], out_dir=r"<work_dir>/previews", resolution_percentage=50) - 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 - Inspect
<work_dir>/contact_sheet.pngvisually viaread_file(or Blender MCPlook(image=r"<work_dir>/contact_sheet.png", max_size=1280)— note that if the client offloads MCP image payloads to disk, callread_fileon the PNG path so you inspect every pixel directly). Inspect individual full-frame stills when checking fine typography. - 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).
- Fix every discovered defect on the timeline, re-render affected frames, and re-inspect via
lookuntil 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
- Save the
.blendproject file and render final output viavse.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
.blendfirst and warn/render in chunks or non-blocking CLI when available so the MCP call stays responsive.
- For long timelines (>30 s at 1080p), save
- 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> - Extract a final-render contact sheet directly from
<out.mp4>and visually spot-check vialook(image=...):python "<skill_dir>/scripts/media_tools.py" contact-sheet "<out.mp4>" -o "<work_dir>/final_qa_sheet.png" --cols 3 --video-samples 9 - If validation reports any
FAIL(or severeWARNsuch 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.