Assist with Motion Previs Studio v4 — the open-source desktop app for extracting pose, depth, camera motion, and control layers from reference video for AI-film production.
When to use this skill
- Setup & build: Installing dependencies, building from source, cross-platform configuration (Windows, macOS, Linux)
- Feature integration: Adding new pose estimators, depth models, camera solvers, or export formats
- UI/logic debugging: Canvas issues, progress tracking, export pipeline failures, frame encoding problems
- Export & workflow: Troubleshooting bundle output, Seedance/ComfyUI/Blender export compatibility, OpenPose keypoint export
- Performance optimization: Faster frame processing, memory management, encoding bottlenecks
- Project architecture: Understanding MediaHandler, PoseAnalyzer, CameraSolver, ControlLayerGenerator, and bundler components
When not to use this skill
- Pure Blender scripting: Use
blenderordesign-systemskills instead - ComfyUI node development: Use
ai-video-generationor similar AI-video skills - General desktop app UX: Use
ui-design-guidelinesorresponsive-design - CI/CD for unrelated projects: Use
deployment-automationorgit-workflow
Core architecture (v4)
Main components:
- MediaHandler — loads and trims video clips (local files, URLs)
- PoseAnalyzer — runs OpenPose/BODY_25 keypoint extraction per frame
- DepthAnalyzer — computes depth maps (MiDaS, or depth-from-motion models)
- CameraSolver — solves camera pan/tilt/zoom/roll via optical flow + RANSAC, masking the tracked subject
- ControlLayerGenerator — produces reference, depth, edges, lineart, pose, normals, etc.
- Bundler — exports production packs (MP4, JSON, Python scripts, manifests for downstream tools)
- BlockoutBridge — sends reference/depth to running Blockout sessions (optional one-click relay)
Security model (v4):
- Custom
mps://protocol withwebSecurity: on - IPC allowlist (main ↔ renderer message types)
- Path allowlist for all file access (imports, exports, temp files)
Setup & build
Prerequisites
- Node.js 18+
- ffmpeg (for frame-by-frame video encoding)
- Python 3.8+ (for downstream Blender/ComfyUI export scripts)
- Platform SDKs: Xcode (macOS), Visual Studio Build Tools (Windows), or gcc/clang (Linux)
Quick start
git clone https://github.com/wassermanproductions/motion-previs-studio.git
cd motion-previs-studio
npm install
npm run dev # dev server (hot reload)
npm run build # production bundle
npm run electron # desktop app (requires build first)
Cross-platform build
# macOS (Intel/Apple Silicon)
npm run build:mac
# Windows (64-bit)
npm run build:win
# Linux
npm run build:linux
# All platforms
npm run build:all
Common workflows
Extracting pose + camera from a reference shot
- Import local clip or URL in the UI
- Trim to the shot window you want to analyze
- Select mode:
Camera only— extract camera move, replace subject/worldActor motion— keep pose + cameraObject motion— track vehicle/object path + cameraFull scene— preserve camera, blocking, depth, subject motion
- Pick control layers (reference, depth, edges, pose, OpenPose, etc.)
- Run → watch Prepare → Pose → Camera → Encode → Bundle stages with live progress
- Export → receive bundle folder + ZIP with
openpose_pose.mp4,openpose_keypoints.json, Blender/ComfyUI/Seedance exports - (Optional) Send to Blockout as a ghost reference underlay
Troubleshooting common issues
"Pose extraction stalled / blank pose.mp4"
- Check that the reference subject is visible and well-lit
- Verify ffmpeg is installed:
ffmpeg -version - Check temp disk space for frame-by-frame encoding
- Inspect the
PoseAnalyzerlogs; confirm OpenPose model loaded
"Camera motion not detected / zero camera_motion.json"
- Ensure the camera has distinct motion (pan, tilt, zoom, roll)
- Verify the subject mask is valid; if not, the solver cannot isolate background motion
- Check CameraSolver log for optical flow success rate
- Try different RANSAC thresholds in settings
"Export hangs during Encode stage"
- Confirm disk space is sufficient
- Check if ffmpeg child process is stuck:
ps aux | grep ffmpeg - Try exporting a shorter clip first (10-20 frames)
- Inspect
Bundlerlogs for frame-write errors
"Blockout "Send" button fails / 400 error"
- Verify Blockout is running and listening on the expected port (default: 6789)
- Check the
BlockoutBridgeIPC payload size (large videos may exceed limits) - Use the manual export method: copy the exported reference/depth MP4 to Blockout's ghost folder
Integration points
Adding a new pose estimator
- Create a new analyzer in
src/analyzers/PoseAnalyzer.tsor a parallel module - Implement the interface:
interface PoseEstimator { loadModel(modelPath: string): Promise<void>; estimateFrame(frame: Uint8Array, width: number, height: number): Promise<Keypoint[]>; getName(): string; } - Update
PoseAnalyzerto instantiate and use your estimator - Add export logic for the keypoint format (OpenPose, MediaPipe, custom JSON)
- Test with a sample clip; verify
openpose_keypoints.jsonstructure
Adding a new export format
- Create a generator in
src/exporters/ - Implement:
interface ControlLayerExporter { generate(bundle: ProductionBundle): Promise<ExportedLayer>; getFileExtension(): string; getLayerName(): string; } - Register in
Bundler.ts - Test the export; validate structure with downstream tool
Extending DepthAnalyzer
- Replace
MiDaSwithZoeDepth,DPT, or custom depth model - Ensure output format: per-frame normalized depth (0–255 uint8 or 0–1 float)
- Integrate into the Encode stage; test with reference clips of known depth scenes
Export bundle format
Each production pack includes:
Videos:
reference.mp4— original or mode-adjusted referencedepth.mp4— normalized depth visualizationai_depth.mp4— optional local AI depth passedges.mp4,lineart.mp4,pose_high_contrast.mp4,openpose_pose.mp4combined_reference_depth_pose.mp4— tiled composite
Keypoints & analysis:
openpose_keypoints.json— per-frame BODY_25 keypoints (75 values/person, OpenPose standard)pose_landmarks.json— pose analysis metadatacamera_motion.json— camera pan/tilt/zoom/roll curve datamodel_presets.json— analyzer settings used
Downstream scripts & manifests:
blender_import_pose.py— Blender armature import scriptblender_import_camera.py— camera rig importblender_import_scene.py— full scene setupcomfyui_manifest.json— control-net graph templateseedance_prompt.md— Seedance CLI usage guidebundle_manifest.json— inventory and checksums
Metadata:
contact_sheet.jpg— frame gallerybundle_manifest.json— full metadata and export settings
Performance notes
- Frame encoding: Deterministic frame-by-frame ffmpeg (no
captureStream) ensures reproducibility - Memory: Monitor GPU/CPU during Pose and Depth stages; reduce clip length if OOM
- Camera solve: RANSAC + optical flow are CPU-bound; 4–8 cores recommended for real-time feedback
- Batch processing: For workflows requiring many clips, consider queueing or server-side deployment
Security & IPC
Custom protocol & allowlist:
- All file access routes through an IPC allowlist
- Path allowlist restricts imports to specified folders and exports to designated output paths
webSecurity: onprevents external script injection in the renderer
Before adding new IPC messages:
- Define the message type in
src/ipc/messages.ts - Add handler to the allowlist in
src/ipc/allowlist.ts - Validate and sanitize all user input in the handler
References
- Repository: wassermanproductions/motion-previs-studio
- License: Apache License 2.0 — cite Sam Wasserman when using or building on this work
- Docs: See
docs/folder in the repository (installation, workflow, export specs) - Downstream tools: Blockout, Seedance, ComfyUI, Blender
Best practices
- Keep clips under 5 min for initial testing; longer clips require more processing time and disk space
- Verify camera move is distinct before running Camera Solver; static-camera shots may produce zero motion data
- Test exports early with your downstream tool (Blender, ComfyUI, Seedance) to catch compatibility issues
- Use project save/restore to resume long analysis sessions if they timeout or cancel
- Profile Pose + Camera stages to identify performance bottlenecks; GPU acceleration flags may be needed
- Document custom analyzers and exporters in
MODIFICATIONS.mdif you fork or extend the app