How do I control video playback?

Trim, loop, mute and set playback rate on a video layer using dot-notation parameters.

Published ·Updated

Video element parameters let you control how video content behaves within your template — replace video sources, trim clips, control audio, and enable looping. These work through the same modifications system used for text and images.

Supported Parameters#

ParameterTypeDescription
{id}stringReplace the video URL
{id}.trimStartnumberStart time in seconds
{id}.trimEndnumberEnd time in seconds
{id}.mutedbooleantrue to mute, false to include audio
{id}.loopbooleantrue to loop the video

Where {id} is the parameter name of the video element in your template.

Replacing Video Sources#

Pass a new URL to swap the video content:

JSON
{
  "modifications": {
    "bgVideo": "https://example.com/new-video.mp4"
  },
  "response": {
    "format": "mp4",
    "type": "url"
  }
}

Supported Video Formats#

  • .mp4 (H.264 recommended)
  • .webm (VP9)
  • .mov

Trimming Video#

Extract a specific portion of a video by setting start and end times in seconds:

JSON
{
  "modifications": {
    "bgVideo": "https://example.com/long-video.mp4",
    "bgVideo.trimStart": 5,
    "bgVideo.trimEnd": 15
  },
  "response": {
    "format": "mp4"
  }
}

This extracts a 10-second clip from the 5-second mark to the 15-second mark.

Trim from the Start#

JSON
{
  "modifications": {
    "bgVideo.trimEnd": 10
  }
}

Takes the first 10 seconds of the video.

Trim from the End#

JSON
{
  "modifications": {
    "bgVideo.trimStart": 30
  }
}

Starts from the 30-second mark and plays to the end.

Audio Control#

Mute or include audio from video elements:

Mute Audio#

JSON
{
  "modifications": {
    "bgVideo": "https://example.com/video-with-audio.mp4",
    "bgVideo.muted": true
  }
}

Useful when you want to use the video as a visual background with separate voiceover or subtitles.

Keep Audio#

JSON
{
  "modifications": {
    "bgVideo": "https://example.com/interview.mp4",
    "bgVideo.muted": false
  }
}

Looping#

Enable looping for short clips that need to fill a longer duration:

JSON
{
  "modifications": {
    "bgVideo": "https://example.com/short-loop.mp4",
    "bgVideo.loop": true
  }
}

The video will repeat until the total render duration is reached.

Multi-Page Video Elements#

For multi-page templates rendered as video, control video elements on each page independently:

JSON
{
  "modifications": {
    "page1@introVideo": "https://example.com/intro.mp4",
    "page1@introVideo.trimEnd": 5,
    "page1@introVideo.muted": true,

    "page2@demoVideo": "https://example.com/demo.mp4",
    "page2@demoVideo.trimStart": 10,
    "page2@demoVideo.trimEnd": 25,
    "page2@demoVideo.muted": false,

    "page3@outroVideo": "https://example.com/outro.mp4",
    "page3@outroVideo.loop": true
  },
  "response": {
    "format": "mp4"
  }
}

Combining Parameters#

Use all video parameters together for full control:

JSON
{
  "templateId": "<YOUR_TEMPLATE_ID>",
  "modifications": {
    "bgVideo": "https://example.com/product-demo.mp4",
    "bgVideo.trimStart": 0,
    "bgVideo.trimEnd": 10,
    "bgVideo.muted": false,
    "bgVideo.loop": false,

    "title": "Product Launch",
    "title.fontSize": "48px",
    "title.color": "#ffffff"
  },
  "response": {
    "format": "mp4",
    "type": "url"
  }
}

Example: Promo Video with Trimmed Clips#

JavaScript
const response = await fetch("https://api.orshot.com/v1/studio/render", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Authorization: "Bearer <YOUR_API_KEY>",
  },
  body: JSON.stringify({
    templateId: "<PROMO_TEMPLATE>",
    modifications: {
      // Background video — trimmed to best 8 seconds
      bgVideo: "https://example.com/raw-footage.mp4",
      "bgVideo.trimStart": 12,
      "bgVideo.trimEnd": 20,
      "bgVideo.muted": true,

      // Overlay content
      headline: "Summer Sale — 50% Off",
      "headline.fontSize": "64px",
      "headline.color": "#ffffff",
      subtext: "Limited time only",
    },
    response: {
      format: "mp4",
      type: "url",
    },
    videoOptions: {
      subtitleSource: "https://example.com/voiceover.mp3",
      subtitleColor: "#ffffff",
      subtitleBackground: "rgba(0,0,0,0.5)",
    },
  }),
});

Credit Costs#

Video credit costs scale with the duration of the output video — 1 credit per second, billed per second or part thereof. Trimming a video reduces its duration and therefore its credit cost — a shorter clip always uses fewer credits than a longer one.

Check your workspace usage dashboard for current credit usage and limits.

Was this page helpful?

Ready to automate?

Start rendering images, PDFs and videos from your templates in under 2 minutes. Free plan, no credit card.

Get your API key
  • Image, PDF and video generation via API
  • Visual editor with AI and smart layouts
  • Zapier, Make, MCP and 50+ integrations
  • White-label embed for your own app
  • 100 free credits a month, no credit card required