speedpainter

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

speedpainter-go

Lightweight Go SDK, storyboard scene estimator, and MCP JSON-RPC request helper for SpeedPainter — turning scripts, documentation, and notes into narrated hand-drawn whiteboard explainer videos and AI drawing timelapses.

Install

go get github.com/SpeedPainterOrg/speedpainter-go@v0.1.0

Quick Example

package main

import (
	"fmt"
	"github.com/SpeedPainterOrg/speedpainter-go"
)

func main() {
	req := speedpainter.VideoRequest{
		Prompt:          "Explain how OAuth 2.0 PKCE works for mobile and desktop apps",
		Language:        "en",
		DurationSeconds: 36,
		AspectRatio:     speedpainter.Aspect16x9,
		Subtitles:       true,
	}
	payload, err := speedpainter.BuildToolCallPayload(1, "generate_explainer_video", req)
	if err != nil {
		panic(err)
	}
	fmt.Printf("Estimated scenes: %d\nPayload: %s\n", speedpainter.EstimateSceneCount(req.DurationSeconds), string(payload))
}

Testing

go test -v ./...

Support

Documentation

Overview

Package speedpainter provides a lightweight Go SDK and storyboard helper for generating narrated hand-drawn whiteboard explainer videos and AI drawing timelapses with SpeedPainter.

Official resources:

Index

Constants

View Source
const (
	// DefaultBaseURL is the SpeedPainter web application base URL.
	DefaultBaseURL = "https://www.speedpainter.org/en"
	// DefaultMCPEndpoint is the remote streamable-HTTP MCP server endpoint.
	DefaultMCPEndpoint = "https://api.speedpainter.org/mcp"
)

Variables

This section is empty.

Functions

func BuildToolCallPayload

func BuildToolCallPayload(id int, toolName string, req VideoRequest) ([]byte, error)

BuildToolCallPayload validates req and returns a JSON-RPC 2.0 payload ready to send to the SpeedPainter remote MCP server.

func EstimateSceneCount

func EstimateSceneCount(durationSeconds int) int

EstimateSceneCount returns a recommended number of hand-drawn scenes based on target video duration (~6 seconds per illustrated beat).

Types

type AspectRatio

type AspectRatio string

AspectRatio defines supported output frame ratios for explainer videos.

const (
	Aspect16x9 AspectRatio = "16:9"
	Aspect9x16 AspectRatio = "9:16"
	Aspect1x1  AspectRatio = "1:1"
)

type Client

type Client struct {
	Endpoint   string
	HTTPClient *http.Client
	Token      string
}

Client interacts with the SpeedPainter MCP JSON-RPC endpoint.

func NewClient

func NewClient(token string) *Client

NewClient constructs a Client targeting DefaultMCPEndpoint.

func (*Client) CallMCP

func (c *Client) CallMCP(ctx context.Context, payload []byte) (*http.Response, error)

CallMCP posts a JSON-RPC payload to the configured SpeedPainter MCP endpoint.

type MCPRequest

type MCPRequest struct {
	JSONRPC string `json:"jsonrpc"`
	ID      int    `json:"id"`
	Method  string `json:"method"`
	Params  any    `json:"params,omitempty"`
}

MCPRequest represents a JSON-RPC 2.0 request envelope for MCP tool calls.

type VideoRequest

type VideoRequest struct {
	Prompt          string      `json:"prompt"`
	Language        string      `json:"language,omitempty"`
	DurationSeconds int         `json:"duration_seconds,omitempty"`
	AspectRatio     AspectRatio `json:"aspect_ratio,omitempty"`
	Subtitles       bool        `json:"subtitles"`
	Voice           string      `json:"voice,omitempty"`
}

VideoRequest describes parameters for a narrated hand-drawn explainer video.

func (VideoRequest) Validate

func (r VideoRequest) Validate() error

Validate checks that required fields are present and within practical bounds.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL