---
title: "Add Video Clips to the Timeline | Rendley SDK Docs"
description: "Load, trim, loop and render video files on the canvas. VideoClip supports trimming, freeze frames, playback speed, volume control and audio extraction."
url: https://docs.rendley.com/sdk/getting-started/clips/video/
---

# Video clips

The [VideoClip](https://docs.rendley.com/sdk/api-reference/classes/VideoClip.html) loads a video file and renders it on the canvas. It supports trimming, freeze frames, playback speed, and audio extraction.

## Create a video clip

The duration is inferred from the media data, so you only need to specify the start time.

```
const mediaId = await Engine.getInstance()
  .getLibrary()
  .addMedia("https://example.com/clip.mp4");

await layer.addClip({
  mediaDataId: mediaId,
  startTime: 0,
});
```

List of Supported Formats

| Format | Support |
| --- | --- |
| MP4 | ✅ |
| MOV | ✅ |
| AVI | ✅ |
| WEBM | ✅ |
| MKV | ✅ |
| M3U8 | ✅ |

## Freeze a frame

Pause the video on a specific frame for the rest of the clip duration with [`setFreezeTime`](https://docs.rendley.com/sdk/api-reference/classes/VideoClip.html#setfreezetime). Useful for a poster frame or a hold at the end of a segment.

```
videoClip.setFreezeTime(2.0); // freeze at second 2
videoClip.setFreezeTime(); // unfreeze
```

## Extract a frame

Export the current frame of the video as a base64 image. `extractFrameAsBase64Image` takes an options object with `mimeType` and `quality`:

```
const image = await videoClip.extractFrameAsBase64Image({
  mimeType: "image/jpeg",
  quality: 0.9,
});
```

To capture a specific time rather than the current frame, seek first: `Engine.getInstance().seek(1.5)` then call `extractFrameAsBase64Image`. Or use [`Engine.getInstance().getFrameAsBase64Image(time, mimeType, quality)`](https://docs.rendley.com/sdk/getting-started/engine/#capturing-a-frame) which accepts a time and works across the whole composition.

## Extract the audio track

Split the audio onto a separate audio clip on another layer. The original video stays silent.

```
const audioClip = videoClip.extractAudioClip();
```

If you want a brand-new independent media entry (for example to reuse the audio without re-downloading), call [`Library.extractAudioFromMedia`](https://docs.rendley.com/sdk/getting-started/library/#extract-audio-from-a-video) instead.

## Playback speed and audio fade

Speed, pitch preservation, volume, and volume fades are covered on the dedicated [Playback Speed & Fades](https://docs.rendley.com/sdk/getting-started/playback-speed/) page.

## What to read next

- **[Audio clips](https://docs.rendley.com/sdk/getting-started/clips/audio/)** add music, voiceover and sound effects.
- **[Playback speed](https://docs.rendley.com/sdk/getting-started/playback-speed/)** retimes a clip and fades its audio.
- API reference: [`VideoClip`](https://docs.rendley.com/sdk/api-reference/classes/VideoClip.html).

[Previous pageEvents and state](https://docs.rendley.com/sdk/user-interface/listening-to-events/) [Next pageAudio clips](https://docs.rendley.com/sdk/getting-started/clips/audio/)
