Specifying a Video Format
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 Frames Per Second (FPS). Note that your VideoFormat is used to select a capture format, but the actual video sent to Participants may be cropped or downscaled in response to network and device conditions.
You can use CameraCapturer or Camera2Capturer to select a specific video input for your LocalVideoTrack. For more information, see Configuring Audio, Video Input and Output devices.
1```bash2// Create camera capturer3CameraCapturer cameraCapturer = new CameraCapturer(context, CameraCapturer.CameraSource.FRONT_CAMERA);45// Setup video format6VideoFormat videoFormat = new VideoFormat(VideoDimensions.HD_720P_VIDEO_DIMENSIONS, 30);78// Add a video track with the format9LocalVideoTrack localVideoTrack = LocalVideoTrack.create(context, true, cameraCapturer, videoFormat);1011// If the format isn't satisfied a null track will be returned12if (localVideoTrack == null) {13Log.e(TAG, "Unable to satisfy the format");14}