Skip to contentSkip to navigationSkip to topbar
Rate this page:

Specifying a Video Format - Android 6.x


(warning)

Warning

This documentation is for reference only. We are no longer onboarding new customers to Programmable Video. Existing customers can continue to use the product until December 5, 2026(link takes you to an external page).

We recommend migrating your application to the API provided by our preferred video partner, Zoom. We've prepared this migration guide(link takes you to an external page) to assist you in minimizing any service disruption.

You can customize a VideoCapturer by setting a VideoFormat when creating a LocalVideoTrack. You can set the video dimensions and frame rate of your choice and the capturer is responsible for capturing as close as possible to your specified format. The VideoFormat provided to LocalVideoTrack.create(...) takes highest priority over the format returned by VideoCapturer.getCaptureFormat(). The default format for video tracks is 640x480 at 30 FPS. Note that your VideoFormat is used to select a capture format, but the actual video sent to Participants may be cropped and/or downscaled in response to network and device conditions.


_13
// Create camera capturer
_13
CameraCapturer cameraCapturer = new CameraCapturer(context, CameraCapturer.CameraSource.FRONT_CAMERA);
_13
_13
// Setup video format
_13
VideoFormat videoFormat = new VideoFormat(VideoDimensions.HD_720P_VIDEO_DIMENSIONS, 30);
_13
_13
// Add a video track with the format
_13
LocalVideoTrack localVideoTrack = LocalVideoTrack.create(context, true, cameraCapturer, videoFormat);
_13
_13
// If the format is not satisfied a null track will be returned
_13
if (localVideoTrack == null) {
_13
Log.e(TAG, "Unable to satisfy the format");
_13
}


Rate this page: