SVG to Video

v0.44.1
io.github.GehDoc/svg-to-video Checked 4 hours ago Published 2 days ago

Convert animated SVG (CSS/SMIL) to video (MP4/WebM) or image (GIF/aPNG) with in-band delivery.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

render_svg_to_video

Render an animated SVG (from raw SVG code or file path) into a high-quality video (MP4, WebM, MKV, MOV) or animated image (aPNG, GIF) with in-band Base64 media delivery. Use this tool when you need to convert animated SVG graphics into video or image files. First use inspect_svg_animation to detect duration and dimensions if unknown. Specify svgContent for raw XML input or svgFilePath for local files. Pass transparent: true for WebM/GIF/aPNG transparency.

ParameterTypeDescription
bgColorstringBackground color hex code (e.g. #ffffff). When transparent is true, acts as a keying/matting color for formats requiring color keying (e.g. gif).
bitratestringTarget video bitrate (e.g. 5M, 2000k) for video formats (MP4, WebM, MOV, MKV). Optional; if omitted, format default rate control is used.
crfnumberConstant Rate Factor (0-63) for video formats (e.g. 18-28). Optional; defaults to 20 for MP4/MKV when bitrate is omitted.
durationnumberDesired animation duration in seconds. If omitted, duration is auto-detected.
formatstringOutput media format. Defaults to webm if transparent is true, otherwise mp4.
fpsnumberFrames per second (e.g. 24, 30, 60). Default: 60.
holdnumberSeconds to freeze the last frame at the end of the video.
loopLoop control for animated formats (GIF, aPNG). Accepts an integer loop count (0 = infinite [default], 1 or -1 = play once, N = loop count) or boolean (false = play once, true = infinite).
outDirstringOutput directory to preserve generated file locally. Omit to deliver purely in-band via ephemeral storage.
qualitynumberQuality level (1-100) for animated exports (GIF palette generation max colors, APNG compression). Optional; defaults to max quality (100) if omitted.
resolutionstringResolution preset (original, 1080p, 720p) or formatted dimension string (e.g. 1080x1080, 1080x1920). Default: original.
scalenumberScale factor (1-4) when using original resolution. Default: 1.
svgContentstringRaw SVG XML string content.
svgFilePathstringPath to the input .svg file (required if svgContent is not provided).
transparentbooleanRender with full alpha-channel transparency (supported for webm, gif, apng, mov).

inspect_svg_animation

Analyze an SVG file or raw SVG content to detect CSS keyframe animations, estimate duration, and extract viewBox dimensions. Call this tool first before rendering to discover animation parameters and calculate optimal resolution.

ParameterTypeDescription
svgContent *stringRaw SVG XML string content.
svgFilePathstringPath to the input .svg file (required if svgContent is not provided).