Skip to main content

Capture results

Every successful session returns one continuous video and a set of frames sampled from the same capture interval.

Result properties​

PropertyTypeContents
capturedVideoDataDataComplete silent H.264 MP4.
padData[Data]Sampled image frames; three by default.
faceImageDataMiddle sampled frame used as the representative recognition image.
framesMetadata[MBFaceGeometryModel]Geometry for the sampled frames.
versionIdStringSelected constraint version: v1, v2, or v3.
sessionMetaDataString?Authenticated metadata for the PAD frames.
sessionVideoMetaDataString?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:

  • sessionMetaData with the sampled frame payload
  • sessionVideoMetaData with the unchanged capturedVideoData

Do not re-encode or modify the MP4 before using its video metadata because the metadata authenticates the exact captured bytes.