Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Specifying Video Constraints

You can customize the video capture by setting video constraints on a local video track. 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.

// Create camera capturer
CameraCapturer cameraCapturer = new CameraCapturer(context, 

// Setup video constraints
VideoConstraints videoConstraints = new VideoConstraints.Builder()

// Add a video track with constraints
LocalVideoTrack localVideoTrack = LocalVideoTrack.create(context, true, cameraCapturer, videoConstraints);

// If the constraints are not satisfied a null track will be returned
if (localVideoTrack == null) {
    Log.e(TAG, "Unable to satisfy constraints);
Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.