# VideoCapabilities

Artifact: [androidx.camera:camera-video](https://developer.android.com/jetpack/androidx/releases/camera) [View Source](https://cs.android.com/search?q=file:androidx/camera/video/VideoCapabilities.java+class:androidx.camera.video.VideoCapabilities) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/camera#1.3.0)

*** ** * ** ***


```
public interface VideoCapabilities
```

<br />

*** ** * ** ***

VideoCapabilities is used to query video recording capabilities on the device.

Take `https://developer.android.com/reference/androidx/camera/video/Recorder` as an example, the supported `https://developer.android.com/reference/androidx/camera/core/DynamicRange`s can be queried with the following code:

```
  VideoCapabilities videoCapabilities = Recorder.getVideoCapabilities(cameraInfo);
  Set<DynamicRange> supportedDynamicRanges = videoCapabilities.getSupportedDynamicRanges();
```

The query result can be used to check if high dynamic range (HDR) recording is supported, and to get the supported qualities of the target `https://developer.android.com/reference/androidx/camera/core/DynamicRange`:

```
  List<Quality> supportedQualities = videoCapabilities.getSupportedQualities(dynamicRange);
```

## Summary

| ### Public methods |
|---|---|
| `abstract @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/Set.html<https://developer.android.com/reference/androidx/camera/core/DynamicRange>` | `https://developer.android.com/reference/androidx/camera/video/VideoCapabilities#getSupportedDynamicRanges()()` Gets all dynamic ranges supported by both the camera and video output. |
| `abstract @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/camera/video/Quality>` | `https://developer.android.com/reference/androidx/camera/video/VideoCapabilities#getSupportedQualities(androidx.camera.core.DynamicRange)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/camera/core/DynamicRange dynamicRange)` Gets all supported qualities for the input dynamic range. |
| `abstract boolean` | `https://developer.android.com/reference/androidx/camera/video/VideoCapabilities#isQualitySupported(androidx.camera.video.Quality,androidx.camera.core.DynamicRange)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/camera/video/Quality quality, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/camera/core/DynamicRange dynamicRange )` Checks if the quality is supported for the input dynamic range. |
| `default boolean` | `https://developer.android.com/reference/androidx/camera/video/VideoCapabilities#isStabilizationSupported()()` Returns if video stabilization is supported on the device. |

## Public methods

### getSupportedDynamicRanges

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/camera#1.3.0)

```
abstract @NonNull Set<DynamicRange> getSupportedDynamicRanges()
```

Gets all dynamic ranges supported by both the camera and video output.

Only `https://developer.android.com/reference/androidx/camera/core/DynamicRange`s with specified values both in `https://developer.android.com/reference/androidx/camera/core/DynamicRange.BitDepth` and `https://developer.android.com/reference/androidx/camera/core/DynamicRange.DynamicRangeEncoding` will be present in the returned set. `https://developer.android.com/reference/androidx/camera/core/DynamicRange`s such as `https://developer.android.com/reference/androidx/camera/core/DynamicRange#HDR_UNSPECIFIED_10_BIT()` will not be included, but they can be used in other methods, such as checking for quality support with `https://developer.android.com/reference/androidx/camera/video/VideoCapabilities#isQualitySupported(androidx.camera.video.Quality,androidx.camera.core.DynamicRange)`.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/Set.html<https://developer.android.com/reference/androidx/camera/core/DynamicRange>` | a set of supported dynamic ranges. |

### getSupportedQualities

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/camera#1.3.0)

```
abstract @NonNull List<Quality> getSupportedQualities(@NonNull DynamicRange dynamicRange)
```

Gets all supported qualities for the input dynamic range.

The returned list is sorted by quality size from largest to smallest. For the qualities in the returned list, with the same input dynamicRange, `https://developer.android.com/reference/androidx/camera/video/VideoCapabilities#isQualitySupported(androidx.camera.video.Quality,androidx.camera.core.DynamicRange)` will return `true`.

When the `dynamicRange` is not fully specified, e.g. `https://developer.android.com/reference/androidx/camera/core/DynamicRange#HDR_UNSPECIFIED_10_BIT()`, the returned list is the union of the qualities supported by the matching fully specified dynamic ranges. This does not mean that all returned qualities are available for every matching dynamic range. Therefore, it is not recommended to rely on any one particular quality to work if mixing use cases with other dynamic ranges.

Note: Constants `https://developer.android.com/reference/androidx/camera/video/Quality#HIGHEST()` and `https://developer.android.com/reference/androidx/camera/video/Quality#LOWEST()` are not included in the returned list, but their corresponding qualities are included. For example: when the returned list consists of `https://developer.android.com/reference/androidx/camera/video/Quality#UHD()`, `https://developer.android.com/reference/androidx/camera/video/Quality#FHD()` and `https://developer.android.com/reference/androidx/camera/video/Quality#HD()`, `https://developer.android.com/reference/androidx/camera/video/Quality#HIGHEST()` corresponds to `https://developer.android.com/reference/androidx/camera/video/Quality#UHD()`, which is the highest quality, and `https://developer.android.com/reference/androidx/camera/video/Quality#LOWEST()` corresponds to `https://developer.android.com/reference/androidx/camera/video/Quality#HD()`.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/camera/core/DynamicRange dynamicRange` | the dynamicRange. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/camera/video/Quality>` | a list of supported qualities sorted by size from large to small. |

### isQualitySupported

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/camera#1.3.0)

```
abstract boolean isQualitySupported(
    @NonNull Quality quality,
    @NonNull DynamicRange dynamicRange
)
```

Checks if the quality is supported for the input dynamic range.

Calling this method with one of the qualities contained in the returned list of `https://developer.android.com/reference/androidx/camera/video/VideoCapabilities#getSupportedQualities(androidx.camera.core.DynamicRange)` will return `true`.

Possible values for `quality` include `https://developer.android.com/reference/androidx/camera/video/Quality#LOWEST()`, `https://developer.android.com/reference/androidx/camera/video/Quality#HIGHEST()`, `https://developer.android.com/reference/androidx/camera/video/Quality#SD()`, `https://developer.android.com/reference/androidx/camera/video/Quality#HD()`, `https://developer.android.com/reference/androidx/camera/video/Quality#FHD()`, `https://developer.android.com/reference/androidx/camera/video/Quality#QHD()` and `https://developer.android.com/reference/androidx/camera/video/Quality#UHD()`.

If this method is called with `https://developer.android.com/reference/androidx/camera/video/Quality#LOWEST()` or `https://developer.android.com/reference/androidx/camera/video/Quality#HIGHEST()`, it will return `true` except the case that none of the qualities can be supported.

When the `dynamicRange` is not fully specified, e.g. `https://developer.android.com/reference/androidx/camera/core/DynamicRange#HDR_UNSPECIFIED_10_BIT()`, `true` will be returned if there is any matching fully specified dynamic range supporting the `quality`, otherwise `
false` will be returned.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/camera/video/Quality quality` | one of the quality constants. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/camera/core/DynamicRange dynamicRange` | the dynamicRange. |

| Returns |
|---|---|
| `boolean` | `true` if the quality is supported; `false` otherwise. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/camera/video/VideoCapabilities#getSupportedQualities(androidx.camera.core.DynamicRange)` |   |

### isStabilizationSupported

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/camera#1.4.0)

```
default boolean isStabilizationSupported()
```

Returns if video stabilization is supported on the device. Video stabilization can be turned on via `https://developer.android.com/reference/androidx/camera/video/VideoCapture.Builder#setVideoStabilizationEnabled(boolean)`.

Not all recording sizes or frame rates may be supported for stabilization by a device that reports stabilization support. It is guaranteed that an output targeting a MediaRecorder or MediaCodec will be stabilized if the recording resolution is less than or equal to 1920 x 1080 (width less than or equal to 1920, height less than or equal to 1080), and the recording frame rate is less than or equal to 30fps. At other sizes, the video stabilization will not take effect.

| Returns |
|---|---|
| `boolean` | true if `https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#CONTROL_VIDEO_STABILIZATION_MODE_ON` is supported, otherwise false. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/camera/video/VideoCapture.Builder#setVideoStabilizationEnabled(boolean)` |   |
| `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.html#CONTROL_VIDEO_STABILIZATION_MODE` |   |