# VideoCaptureDsl

Added in 1.7.0-rc02

*** ** * ** ***


```
public final class VideoCaptureDsl
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/video/VideoCapture<@https://developer.android.com/reference/androidx/annotation/NonNull T>` | `<T extends https://developer.android.com/reference/androidx/camera/video/VideoOutput> https://developer.android.com/reference/androidx/camera/video/VideoCaptureDsl#videoCapture(androidx.camera.video.VideoOutput,kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull T videoOutput, @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/video/VideoCaptureScope<@https://developer.android.com/reference/androidx/annotation/NonNull T>, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> block )` Creates a `https://developer.android.com/reference/androidx/camera/video/VideoCapture` using a Kotlin DSL block. |

## Public methods

### videoCapture

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/VideoCaptureDsl.kt+function:videoCapture) Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
public static final @NonNull VideoCapture<@NonNull T> <T extends VideoOutput> videoCapture(
    @NonNull T videoOutput,
    @NonNull Function1<@NonNull VideoCaptureScope<@NonNull T>, Unit> block
)
```

Creates a `https://developer.android.com/reference/androidx/camera/video/VideoCapture` using a Kotlin DSL block.

```kotlin
import androidx.camera.core.DynamicRange
import androidx.camera.core.MirrorMode
import androidx.camera.video.videoCapture

// Using the new Kotlin DSL to configure VideoCapture in a clean and idiomatic way
val videoCaptureUseCase =
    videoCapture(videoOutput) {
        targetName = "video_capture_dsl"
        targetRotation = Surface.ROTATION_90
        dynamicRange = DynamicRange.SDR
        mirrorMode = MirrorMode.MIRROR_MODE_ON
        isVideoStabilizationEnabled = true
        targetFrameRate = Range(30, 30)
    }
```

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull T videoOutput` | The `https://developer.android.com/reference/androidx/camera/video/VideoOutput` to associate with the VideoCapture. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/video/VideoCaptureScope<@https://developer.android.com/reference/androidx/annotation/NonNull T>, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> block` | A receiver lambda on `https://developer.android.com/reference/androidx/camera/video/VideoCaptureScope` to configure the VideoCapture. |