Motion SDK

Export

MP4, GIF and PNG from the CLI, with social presets, safe areas, captions, seamless loops and motion blur.

exports is a map of named targets. motion-sdk render scene.json --export <name> renders one; its format decides the output.

A seamless 4 second loop with captions, exported for X, as a GIF, a TikTok and a poster.
{
  "canvas": { "width": 1080, "height": 1080, "fps": 30 },
  "camera": {
    "position": [0, 1, 6],
    "target": [0, 0, 0],
    "move": { "preset": "arc", "easing": "linear" }
  },
  "lighting": { "rig": "neon_rim" },
  "environment": {
    "background": {
      "radial_gradient": { "inner": "#1a0b2e", "outer": "#05030a" }
    }
  },
  "post": { "bloom": 1 },
  "nodes": {
    "knot": {
      "mesh": { "geometry": { "torus_knot": {} }, "material": "preset:neon" }
    }
  },
  "timeline": {
    "duration": 4,
    "loop": "loop",
    "tracks": {
      "spin": {
        "target": "knot",
        "property": "rotation",
        "keyframes": [
          { "t": 0, "value": [0, 0, 0], "easing": "linear" },
          { "t": 4, "value": [0, 360, 0] }
        ]
      }
    }
  },
  "exports": {
    "x": {
      "preset": "x_1x1",
      "captions": [
        { "start": 0, "end": 2, "text": "One prompt.", "style": "bold_pop" },
        { "start": 2, "end": 4, "text": "One loop.", "style": "bold_pop" }
      ]
    },
    "gif": { "preset": "x_gif" },
    "story": { "preset": "tiktok", "framing": "cover" },
    "poster": { "preset": "x_image", "frame_time": 1 }
  }
}
A seamless 4 second loop with captions, exported for X, as a GIF, a TikTok and a poster. apps/docs/examples/export.json · render it with motion-sdk render apps/docs/examples/export.json -t 1 -o export.png
motion-sdk render scene.json --export x                       # MP4
motion-sdk render scene.json --export gif --dither fs         # GIF, Floyd-Steinberg
motion-sdk render scene.json --preset slide_16x9 --format png-sequence -o frames/
motion-sdk render scene.json --export x --motion-blur 8       # 8 subframes, 180° shutter
motion-sdk render scene.json --export x --require-seamless    # fail on a loop seam
motion-sdk render scene.json --export x --encoder ffmpeg      # libx264 from PATH

Presets

A preset fixes size, fps, format, the loop default, the platform's duration limit and a safe area.

PresetSizeFormatSafe area (top, right, bottom, left)
x_16x9, x_1x1, x_9x161920x1080, 1080x1080, 1080x1920 @ 30MP45%, 5%, 10%, 5%
x_gif480x480 @ 15GIF5%
x_image1600x900PNG5%
linkedin1080x1080 @ 30MP45%, 5%, 10%, 5%
instagram_reel1080x1920 @ 30MP413%, 10%, 22%, 6%
tiktok1080x1920 @ 30MP48%, 12%, 20%, 6%
slide_16x9, slide_4x31920x1080, 1440x1080 @ 30MP45%
slide_still1920x1080PNG5%
web_embed1920x1080 @ 60HTML (browser player, not rendered by the CLI)none

The older names x_landscape, x_square and x_portrait still work. Override any field per export, including width, height, fps, safe_area and framing (contain keeps the whole design visible; cover crops to fill).

Captions

captions are burned in with bold_pop, minimal, karaoke or boxed styles, wrapped to the safe width and kept inside the safe area. X autoplays muted, so caption X exports.

Frames and Loops

  • Frame i is at start + i / fps, independent of anything rendered before it.
  • For looping exports, the frame after the last is compared with the first, and the wrap step with an ordinary step. --require-seamless fails the export on a seam.
  • motion_blur: {"samples": 8, "shutter": 0.5} averages subframes in linear light. A shot's own motion_blur, and a whip transition, take over for the frames they cover.

Formats

  • MP4: H.264 4:2:0, BT.709, fast start, a keyframe every 2 s. Width and height must be even. A scene with audio gets an AAC sound track when ffmpeg is on PATH, or a WAV beside the video when it isn't.
  • GIF: one global palette, ordered or Floyd-Steinberg dithering, frame-difference transparency, infinite loop.
  • PNG and PNG sequences: lossless.

Licensing

H.264 is covered by patents. The default encoder is OpenH264 (BSD-2-Clause), compiled from source. Cisco pays the royalties only for its own prebuilt binaries, so if you ship MP4 export in a product, check whether you need an H.264 patent licence, or build without the openh264 feature and use --encoder ffmpeg. The ffmpeg path links nothing: it runs an ffmpeg binary from PATH. GIF and PNG have no such constraints.

API Reference

ExportTarget

One output to render. Pick a preset, then override anything.

PropertyTypeDefaultDescription
captionsCaption[]—Burned-in captions (X autoplays muted, so captions matter).
durationnumber (≥ 0)—Seconds to render. Defaults to the main timeline duration.
formatExportFormat—Override the preset's file type.
fpsinteger (1 to 120)—Override the preset's frame rate.
frame_timenumber—Time of the still frame for png (defaults to start).
framingFraming"contain"How the scene adapts to a different aspect ratio than the canvas.
heightinteger (16 to 8192)—Override the preset's height in pixels (MP4 needs an even number).
motion_blurMotionBlur—Average subframes for motion blur (off by default).
presetExportPreset—The platform preset: size, fps, format, duration limit and safe area.
qualityQuality"high"Render quality. draft is a fast preview for self-review.
safe_areaSafeArea—Margins kept clear of platform UI (defaults to the preset's).
seamless_loopboolean—Make the last frame flow into the first (requires a looping timeline whose duration matches the export duration).
startnumber (≥ 0)0Start time in seconds on the main timeline.
widthinteger (16 to 8192)—Override the preset's width in pixels (MP4 needs an even number).

ExportPreset

Tuned output presets. Each fixes size, fps, format, loop default, the platform's duration limit and the safe area kept clear of platform UI.

ValueDescription
"x_16x9"X/Twitter 16:9 video, 1920x1080 MP4.
"x_1x1"X/Twitter 1:1 video, 1080x1080 MP4.
"x_9x16"X/Twitter 9:16 vertical video, 1080x1920 MP4.
"x_landscape"Same as x_16x9 (older name).
"x_square"Same as x_1x1 (older name).
"x_portrait"Same as x_9x16 (older name).
"x_gif"Looping 1:1 GIF tuned for size, 480x480 @ 15fps (X takes GIFs up to 15 MB).
"x_image"X link-card / post image, 1600x900 PNG.
"linkedin"LinkedIn feed video, 1:1 1080x1080 MP4 (fills the mobile feed).
"instagram_reel"Instagram Reel, 9:16 1080x1920 MP4; keeps clear of the caption and action-button overlays.
"tiktok"TikTok, 9:16 1080x1920 MP4; keeps clear of the caption and side-bar overlays.
"slide_16x9"16:9 slide background/hero video, 1920x1080 MP4.
"slide_4x3"4:3 slide video, 1440x1080 MP4.
"slide_still"Slide still (poster frame), 1920x1080 PNG.
"web_embed"Self-contained interactive HTML embed (websites, slides with web embeds).

ExportFormat

ValueDescription
"mp4"
"webm"
"gif"
"png"
"png_sequence"
"html"

Framing

Aspect-ratio adaptation.

ValueDescription
"contain"Widen/narrow the view so the canvas' safe area stays fully visible.
"cover"Fill the frame, cropping the edges.

SafeArea

Fractions of the frame (0..0.5) kept clear on each side, e.g. of a platform's overlaid buttons and captions. Burned-in captions stay inside.

PropertyTypeDefaultDescription
bottom*number (0 to 0.5)requiredFraction of the height kept clear at the bottom.
left*number (0 to 0.5)requiredFraction of the width kept clear on the left.
right*number (0 to 0.5)requiredFraction of the width kept clear on the right.
top*number (0 to 0.5)requiredFraction of the height kept clear at the top.

Quality

ValueDescription
"standard"
"high"
"draft"Fast preview (self-review loop).

MotionBlur

Motion blur by averaging subframes across the shutter interval.

PropertyTypeDefaultDescription
samplesinteger (2 to 64)8Subframes rendered and averaged per output frame.
shutternumber (0 to 1)0.5Fraction of the frame interval the shutter is open (0.5 = 180°).

Caption

A timed caption.

PropertyTypeDefaultDescription
end*numberrequiredSeconds when the caption leaves.
positionCaptionPosition"bottom"Where the caption sits inside the safe area.
start*numberrequiredSeconds when the caption appears.
styleCaptionStyle"bold_pop"How the caption looks and animates.
text*stringrequiredThe caption's words.

CaptionStyle

ValueDescription
"bold_pop"Big bold words that pop in (short-form video look).
"minimal"Clean small subtitles.
"karaoke"Word-by-word highlight.
"boxed"Text on a rounded translucent box.

CaptionPosition

ValueDescription
"top"
"center"
"bottom"