Video Element Parameters
Control video playback, trim settings, and audio dynamically using video parameters
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.
Video parameters only apply when rendering templates with video elements as MP4, WebM, or GIF formats.
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:
Supported Video Parameters
| Parameter | Type | Description |
|---|---|---|
{id} | string | Custom video URL to replace the template video |
{id}.trimStart | number | Start time in seconds |
{id}.trimEnd | number | End time in seconds |
{id}.muted | boolean | true to mute audio, false to include audio |
{id}.loop | boolean | true to loop the video |
Basic Usage
Replace Video URL
Pass a custom video URL using the parameter ID:
Trim Video
Control which portion of the video to use:
This extracts a 10-second clip from 5s to 15s of the source video.
Control Audio
Include or exclude audio from the video:
GIF format does not support audio. The muted parameter is ignored for GIF
outputs.
Enable Looping
Loop a short video to fill the duration:
Complete Example
Combine all video parameters:
Multi-Page Templates
For templates with multiple pages containing videos, prefix with the page number:
Combining with Style Parameters
Video parameters work alongside other dynamic parameters:
API Integration Examples
REST API
Video Duration & Pricing
The output video duration is determined by:
- Template video settings - If no custom trim is passed
- Custom trim settings -
trimEnd - trimStartin seconds - Source video duration - If trim exceeds source length
Video generation is billed at 8 renders per second of output video. For example:
- 10-second video = 80 renders
- 30-second video = 240 renders
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
- URL Access - Video URLs must be publicly accessible (no authentication)
- File Size - Large videos may increase processing time
- Audio in GIF - GIF format does not support audio
- 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:
- Verify the video URL is publicly accessible
- Check the video format is supported (MP4, WebM, MOV)
- Ensure
response.formatis set tomp4,webm, orgif
Audio Not Included
Issue: Output video has no audio
Solutions:
- Set
{videoId}.mutedtofalse - Ensure the source video has an audio track
- Check that
response.formatis notgif
Trim Not Working
Issue: Video doesn't respect trim settings
Solutions:
- Verify
trimStartis less thantrimEnd - Ensure trim values don't exceed source video duration
- Use numbers (not strings) for trim values
Next Steps
- Learn about AI Content Generation
- Explore Interactive Links
- Check Response Formats for output options