Recording Video
Capture video with CameraX.
Recording Video with CameraX
CameRX records video through the VideoCapture use case, backed by a Recorder. In this lesson you'll set up video capture, start and stop a recording, and save it to the gallery — including audio.
The flow mirrors photos but adds a long-running Recording session you start and later stop.
Recorder and Quality
You first build a Recorder, which defines the encoding and quality. QualitySelector lets you request a target quality (e.g. HD, FHD) with a fallback if the device can't provide it.
val recorder = Recorder.Builder()
.setQualitySelector(
QualitySelector.from(
Quality.FHD,
FallbackStrategy.lowerQualityOrHigherThan(Quality.SD)
)
)
.build()All lessons in this course
- CameraX Overview
- Showing a Camera Preview
- Taking Photos
- Recording Video