Capture results
Every successful session returns one continuous video and a set of frames sampled from the same capture interval.
Result properties
| Property | Type | Contents |
|---|---|---|
capturedVideoData | ByteArray? | Complete captured MP4. The device selects a supported codec. |
frames | List<ByteArray?> | Sampled JPEG frames; three by default. |
faceImage | ByteArray? | Representative JPEG selected from the sampled frames. |
faceGeometry | List<MBFaceGeometryModel> | Geometry for the sampled frames. |
versionId | String? | Selected constraint version: v1, v2, or v3. |
sessionMetadata | String? | Authenticated metadata for the sampled frames. |
sessionVideoMetadata | String? | Authenticated metadata for the exact MP4 bytes. |
The front-camera preview is mirrored for the user. Captured images and video are stored unmirrored.
Read the result
override fun onSuccess(result: MBCaptureSessionResult?) {
result ?: return
val videoBytes = result.capturedVideoData
val sampledFrames = result.frames
val recognitionImage = result.faceImage
val frameGeometry = result.faceGeometry
val constraintVersion = result.versionId
}
Serialize the biometric request
val biometricRequest = result.serializedData()
// Send biometricRequest to the matching backend endpoint.
serializedData() contains faceImage, frames, and the selected constraint version. The video is exposed separately through capturedVideoData.
Use authenticated session metadata
Set sessionId before adding the predefined fragment, or pass it when starting the custom service:
captureFragment.sessionId = sessionId
// Custom UI:
captureService.startCamera(sessionId)
After capture, send each metadata value with the media it authenticates:
sessionMetadatawith the sampled frame payloadsessionVideoMetadatawith the unchangedcapturedVideoData
Do not re-encode or modify the MP4 before using its video metadata because the metadata authenticates the exact captured bytes.