# MediaStoreOutputOptions

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/MediaStoreOutputOptions.java+class:androidx.camera.video.MediaStoreOutputOptions) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/camera#1.1.0)

*** ** * ** ***


```
public final class MediaStoreOutputOptions extends OutputOptions
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.camera.video.OutputOptions](https://developer.android.com/reference/androidx/camera/video/OutputOptions) ||
|   | ↳ | [androidx.camera.video.MediaStoreOutputOptions](https://developer.android.com/reference/androidx/camera/video/MediaStoreOutputOptions) |

*** ** * ** ***

A class providing options for storing output to MediaStore.

Example:

```
ContentValues contentValues = new ContentValues();
contentValues.put(MediaStore.MediaColumns.DISPLAY_NAME, "NEW_VIDEO");
contentValues.put(MediaStore.MediaColumns.MIME_TYPE, "video/mp4");

MediaStoreOutputOptions options =
        new MediaStoreOutputOptions.Builder(
            contentResolver, MediaStore.Video.Media.EXTERNAL_CONTENT_URI)
        .setContentValues(contentValues)
        .build();
```

The output `https://developer.android.com/reference/android/net/Uri.html` can be obtained via `https://developer.android.com/reference/androidx/camera/video/OutputResults#getOutputUri()` from `https://developer.android.com/reference/androidx/camera/video/VideoRecordEvent.Finalize#getOutputResults()`.

For more information about setting collections `https://developer.android.com/reference/android/net/Uri.html` and `https://developer.android.com/reference/android/content/ContentValues.html`, read the [Access media files from shared storage](https://developer.android.com/training/data-storage/shared/media) and [MediaStore](https://developer.android.com/reference/android/provider/MediaStore) developer guide.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/camera/video/MediaStoreOutputOptions.Builder` The builder of the `https://developer.android.com/reference/androidx/camera/video/MediaStoreOutputOptions` object. |

| ### Constants |
|---|---|
| `static final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/ContentValues.html` | `https://developer.android.com/reference/androidx/camera/video/MediaStoreOutputOptions#EMPTY_CONTENT_VALUES()` An empty `https://developer.android.com/reference/android/content/ContentValues.html`. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/camera/video/MediaStoreOutputOptions#equals(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html o)` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/net/Uri.html` | `https://developer.android.com/reference/androidx/camera/video/MediaStoreOutputOptions#getCollectionUri()()` Gets the URI of the collection to insert into. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/ContentResolver.html` | `https://developer.android.com/reference/androidx/camera/video/MediaStoreOutputOptions#getContentResolver()()` Gets the ContentResolver instance. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/ContentValues.html` | `https://developer.android.com/reference/androidx/camera/video/MediaStoreOutputOptions#getContentValues()()` Gets the content values to be included in the created video row. |
| `int` | `https://developer.android.com/reference/androidx/camera/video/MediaStoreOutputOptions#hashCode()()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/camera/video/MediaStoreOutputOptions#toString()()` |

### Inherited Constants

From [androidx.camera.video.OutputOptions](https://developer.android.com/reference/androidx/camera/video/OutputOptions) `static final int` `https://developer.android.com/reference/androidx/camera/video/OutputOptions#DURATION_UNLIMITED() = 0`

Represents an unlimited duration.
`static final int` `https://developer.android.com/reference/androidx/camera/video/OutputOptions#FILE_SIZE_UNLIMITED() = 0`

Represents an unbound file size.

### Inherited methods

From [androidx.camera.video.OutputOptions](https://developer.android.com/reference/androidx/camera/video/OutputOptions) `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) long` `https://developer.android.com/reference/androidx/camera/video/OutputOptions#getDurationLimitMillis()()`

Gets the limit for the video duration in milliseconds.
`@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) long` `https://developer.android.com/reference/androidx/camera/video/OutputOptions#getFileSizeLimit()()`

Gets the limit for the file size in bytes.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/location/Location.html` `https://developer.android.com/reference/androidx/camera/video/OutputOptions#getLocation()()`

Returns a `https://developer.android.com/reference/android/location/Location.html` object representing the geographic location where the video was recorded.

## Constants

### EMPTY_CONTENT_VALUES

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

```
public static final @NonNull ContentValues EMPTY_CONTENT_VALUES
```

An empty `https://developer.android.com/reference/android/content/ContentValues.html`.

## Public methods

### equals

```
public boolean equals(@Nullable Object o)
```

### getCollectionUri

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

```
public @NonNull Uri getCollectionUri()
```

Gets the URI of the collection to insert into.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/camera/video/MediaStoreOutputOptions.Builder#Builder(android.content.ContentResolver,android.net.Uri)` |   |

### getContentResolver

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

```
public @NonNull ContentResolver getContentResolver()
```

Gets the ContentResolver instance.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/camera/video/MediaStoreOutputOptions.Builder#Builder(android.content.ContentResolver,android.net.Uri)` |   |

### getContentValues

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

```
public @NonNull ContentValues getContentValues()
```

Gets the content values to be included in the created video row.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/camera/video/MediaStoreOutputOptions.Builder#setContentValues(android.content.ContentValues)` |   |

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```