Skip to main content

Interface: RecordVideoOptions

Properties​

crop?​

optional crop: object

The crop region of the video. All values are in the range 0 to 1, relative to the video dimensions.

height?​

optional height: number

The height of the crop region (0-1)

Default​
1

left?​

optional left: number

The x-coordinate of the top-left corner of the crop region (0-1)

Default​
0

top?​

optional top: number

The y-coordinate of the top-left corner of the crop region (0-1)

Default​
0

width?​

optional width: number

The width of the crop region (0-1)

Default​
1

Default​

{ left: 0, top: 0, width: 1, height: 1 }

Defined in​

types/VideoFile.ts:28


fileType?​

optional fileType: "mov" | "mp4"

Specifies the output file type to record videos into.

Defined in​

types/VideoFile.ts:12


flash?​

optional flash: "off" | "on"

Set the video flash mode. Natively, this just enables the torch while recording.

Defined in​

types/VideoFile.ts:8


height?​

optional height: number

The height of the video in pixels. If not specified, the native sensor resolution is used.

Defined in​

types/VideoFile.ts:22


onRecordingError()​

onRecordingError: (error) => void

Called when there was an unexpected runtime error while recording the video.

Parameters​

• error: CameraCaptureError

Returns​

void

Defined in​

types/VideoFile.ts:62


onRecordingFinished()​

onRecordingFinished: (video) => void

Called when the recording has been successfully saved to file.

Parameters​

• video: VideoFile

Returns​

void

Defined in​

types/VideoFile.ts:66


path?​

optional path: string

A custom path where the video will be saved to.

This must be a directory, as VisionCamera will generate a unique filename itself. If the given directory does not exist, this method will throw an error.

By default, VisionCamera will use the device's temporary directory.

Defined in​

types/VideoFile.ts:58


videoCodec?​

optional videoCodec: "h264" | "h265"

The Video Codec to record in.

  • h264: Widely supported, but might be less efficient, especially with larger sizes or framerates.
  • h265: The HEVC (High-Efficient-Video-Codec) for higher efficient video recordings. Results in up to 50% smaller file-sizes.

Defined in​

types/VideoFile.ts:72


width?​

optional width: number

The width of the video in pixels. If not specified, the native sensor resolution is used.

Defined in​

types/VideoFile.ts:17