---
"@context": https://schema.org
"@type": TechArticle
"@id": https://www.twilio.com/docs/video/javascript-v1-specifying-video-constraints#article
headline: Specify Video Constraints for JavaScript v1.x
description: Set video constraints on a LocalVideoTrack in the Twilio Video JavaScript 1.x SDK to control capture size, frame rate, and aspect ratio for your video application.
url: https://www.twilio.com/docs/video/javascript-v1-specifying-video-constraints
inLanguage: en
dateModified: 2026-06-25T22:34:50.000Z
author:
  "@type": Organization
  name: Twilio Developer Education Team
publisher:
  "@type": Organization
  name: Twilio
---

# Specify Video Constraints for JavaScript v1.x

> \[!WARNING]
>
> This document refers to the 1.x version of Twilio Video JS. If you are starting with Twilio Video JS, use the [2.x version](/docs/video/specifying-video-constraints). If you're using a 1.x version of Twilio Video JS, we recommend you upgrade to the 2.x version. To learn more about older migrations, see our [documentation retention policy](/docs/video/platform-sdk-support-policy#documentation-retention-policy).

You can customize the video capture by setting [video constraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints#Properties_of_video_tracks) on a LocalVideoTrack. Setting constraints, lets you optimize the video track to network and device conditions. You can set size constraints, frame rate constraints or the aspect ratio constraints of your choice. Note that video constraints are used to resolve the capture format, but the actual video sent to Participant may be downscaled temporally or spatially in response to network and device conditions.

```js
const { connect, createLocalTracks } = require('twilio-video');

// Option 1
createLocalTracks({
  audio: true,
  video: { width: 640 },
}).then(localTracks => {
  return connect('$TOKEN', {
    name: 'my-room-name',
    tracks: localTracks,
  });
}).then(room => {
  console.log(`Connected to Room: ${room.name}`);
});

// Option 2
connect('$TOKEN', {
  audio: true,
  name: 'my-room-name',
  video: { width: 640 },
}).then(room => {
  console.log(`Connected to Room: ${room.name}`);
});
```
