# Video Element Parameters

> Control video playback, trim settings, and audio dynamically using video parameters

- **URL**: https://orshot.com/docs/dynamic-parameters/video

---

## 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:```
parameterID.property
```## Supported Video Parameters

| Parameter        | Type    | Description                                    |
| ---------------- | ------- | ---------------------------------------------- |
| ``           | string  | Custom video URL to replace the template video |
| `.trimStart` | number  | Start time in seconds                          |
| `.trimEnd`   | number  | End time in seconds                            |
| `.muted`     | boolean | `true` to mute audio, `false` to include audio |
| `.loop`      | boolean | `true` to loop the 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"
  }
}
```### 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"
  }
}
```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"
  }
}
```### 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"
  }
}
```## 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"
  }
}
```## 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"
  }
}
```## API Integration Examples

### REST API```bash
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. **Template video settings** - If no custom trim is passed
2. **Custom trim settings** - `trimEnd - trimStart` in seconds
3. **Source video duration** - If trim exceeds source length

Video generation uses more renders than images or PDFs since each second of video requires additional processing. Longer videos consume proportionally more renders — trimming clips to shorter durations helps reduce render costs.

## 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. **Single Audio Source** - Only one unmuted video element's audio is included in the output

## 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`, or `gif`

### Audio Not Included

**Issue:** Output video has no audio

**Solutions:**

1. Set `.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. Use numbers (not strings) for trim values

## Next Steps

- Learn about [AI Content Generation](https://orshot.com/docs/dynamic-parameters/prompt)
- Explore [Interactive Links](https://orshot.com/docs/dynamic-parameters/link)
- Check [Response Formats](https://orshot.com/docs/definitions/response-format) for output options