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 | Data | Complete silent H.264 MP4. |
padData | [Data] | Sampled image frames; three by default. |
faceImage | Data | Middle sampled frame used as the representative recognition image. |
framesMetadata | [MBFaceGeometryModel] | Geometry for the sampled frames. |
versionId | String | Selected constraint version: v1, v2, or v3. |
sessionMetaData | String? | Authenticated metadata for the PAD 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
func onSuccess(result: MBCaptureSessionResult) {
let videoData = result.capturedVideoData
let sampledFrames = result.padData
let recognitionImage = result.faceImage
let frameGeometry = result.framesMetadata
let constraintVersion = result.versionId
}
Serialize the biometric request
do {
let biometricRequest = try result.serializedData()
// Send biometricRequest to the matching backend endpoint.
} catch {
// Handle local serialization failure.
}
serializedData() contains faceImage, padData, and the selected constraint version. The video is exposed separately through capturedVideoData.
Use authenticated session metadata
Pass a sessionId when creating or starting the capture to generate session metadata:
let controller = MBCaptureSessionViewController(
with: options,
style: style,
sessionId: 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.