Rate this page:

Specify Video Constraints for Android v1.x

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 by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

Loading Code Sample...

        Thank you for your feedback!

        Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

        Sending your feedback...
        🎉 Thank you for your feedback!
        Something went wrong. Please try again.

        Thanks for your feedback!