Video element parameters

Trim, loop, mute and control audio on video layers dynamically per render.

Updated

Overview#

Video element parameters allow you to dynamically control video content, playback settings, and trim points when rendering templates as video. You can pass custom video URLs and configure playback behavior at render time.

How It Works#

When you add a video element to your template and set a parameter ID (e.g., bgVideo), you can override its properties using the format:

JavaScript
parameterID.property

Supported Video Parameters#

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

Video layers are muted by default unless you unmute them in Studio. Pass .muted: false to include their audio in one render.

To generate a clip with AI instead of passing a URL, use .prompt on the video element. See AI video.

Basic Usage#

Replace Video URL#

Pass a custom video URL using the parameter ID:

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

Trim Video#

Control which portion of the video to use:

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

This extracts a 10-second clip from 5s to 15s of the source video.

Control Audio#

Include or exclude audio from the video:

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

Enable Looping#

Loop a short video to fill the duration:

JSON
{
  "modifications": {
    "bgVideo": "https://example.com/short-clip.mp4",
    "bgVideo.loop": true
  },
  "response": {
    "format": "mp4",
    "type": "url"
  }
}

Complete Example#

Combine all video parameters:

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"
  },
  "response": {
    "type": "url",
    "format": "mp4"
  }
}

Multi-Page Templates#

For templates with multiple pages containing videos, prefix with the page number:

JSON
{
  "modifications": {
    "page1@introVideo": "https://example.com/intro.mp4",
    "page1@introVideo.trimEnd": 5,
    "page2@demoVideo": "https://example.com/demo.mp4",
    "page2@demoVideo.muted": true
  },
  "response": {
    "format": "mp4",
    "type": "url"
  }
}

Combining with Style Parameters#

Video parameters work alongside other dynamic parameters:

JSON
{
  "modifications": {
    "bgVideo": "https://example.com/video.mp4",
    "bgVideo.trimStart": 2,
    "bgVideo.trimEnd": 12,
    "overlayText": "Summer Collection",
    "overlayText.fontSize": "64px",
    "overlayText.color": "#ffffff",
    "logo": "https://example.com/logo.png"
  },
  "response": {
    "format": "mp4",
    "type": "url"
  }
}

API Integration Examples#

REST API#

Shell
curl -X POST https://api.orshot.com/v1/studio/render \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "templateId": "video-template-id",
    "modifications": {
      "productVideo": "https://example.com/product.mp4",
      "productVideo.trimStart": 0,
      "productVideo.trimEnd": 15,
      "productVideo.muted": false,
      "headline": "New Arrival",
      "headline.fontSize": "56px"
    },
    "response": {
      "type": "url",
      "format": "mp4"
    }
  }'

Video Duration & Pricing#

The output video duration is determined by:

  1. Longest video layer - Each page is as long as its longest video layer, after trims. A custom trim (trimEnd - trimStart) replaces the trim saved in the template
  2. Page duration - A total duration set on the page in Studio replaces the length from the video layers
  3. Request options - videoOptions trim or duration in the request replaces both
  4. Multi-page videos - Page lengths are added together

If a custom video URL cannot be read, the render fails with an error saying the URL is not valid or publicly accessible.

Video generation costs 1 credit per second of output video, rounded up to the next whole second. Seconds rendered on overage cost 8 credits each. Images cost 1 credit each and PDFs 1 credit per page. Trimming clips to shorter durations reduces credit costs. See Credits.

Supported Video Formats#

Orshot accepts the following video URL formats:

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

Ensure your video URLs are publicly accessible for Orshot to fetch and process them.

Limitations#

  1. URL Access - Video URLs must be publicly accessible (no authentication)
  2. File Size - Large videos may increase processing time
  3. Audio in GIF - GIF format does not support audio
  4. Mixed Audio - Audio from every unmuted video layer is mixed into the output, together with any page audio tracks

Troubleshooting#

Video Not Playing#

Issue: Output video shows static image instead of video

Solutions:

  1. Verify the video URL is publicly accessible
  2. Check the video format is supported (MP4, WebM, MOV)
  3. Ensure response.format is set to mp4, webm, mov, mkv, or gif

Audio Not Included#

Issue: Output video has no audio

Solutions:

  1. Set {videoId}.muted to false
  2. Ensure the source video has an audio track
  3. Check that response.format is not gif

Trim Not Working#

Issue: Video doesn't respect trim settings

Solutions:

  1. Verify trimStart is less than trimEnd
  2. Ensure trim values don't exceed source video duration
  3. Check that trim values are numbers of seconds, such as 5 or "5"

Next Steps#

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 40+ integrations
  • White-label embed for your own app
  • 100 free credits a month, no credit card required