CameraVideoOutput

A CameraOutput recording videos (possibly with audio) to files, through Recorders.

val videoOutput = VisionCamera.createVideoOutput(VideoOutputOptions(enableAudio = true))
// ... connect it to a CameraSession, then:
val recorder = videoOutput.createRecorder()
recorder.startRecording(
onRecordingFinished = { filePath, reason -> println("Saved to $filePath ($reason)") },
onRecordingError = { error -> println("Recording failed: $error") },
)
// ... later:
recorder.stopRecording()

Properties

Link copied to clipboard
abstract val currentResolution: Size?

The resolution this output is currently streaming at, or null if it is not connected yet.

Link copied to clipboard
abstract val mediaType: MediaType

The MediaType of this output.

Link copied to clipboard

The orientation of the content produced by this output.

Functions

Link copied to clipboard
open override fun close()

Same as dispose, to use a CameraOutput with use { }.

Link copied to clipboard
abstract suspend fun createRecorder(settings: RecorderSettings = RecorderSettings()): Recorder

Creates and prepares a new Recorder with the given settings. A Recorder records once: create a new one for every recording.

Link copied to clipboard
abstract fun dispose()

Eagerly disposes the native resources this output holds (its threads, analyzers, delegates, sounds...), like VisionCamera's HybridObject.dispose().

Link copied to clipboard

Gets the VideoCodecs this output can currently record in. Only supported on iOS.

Link copied to clipboard
abstract suspend fun setOutputSettings(settings: VideoOutputSettings)

Sets the output settings of this output, after it is connected to a CameraSession and before createRecorder. Only supported on iOS.