Skip to content

Video stream settings#

In LUNA ID, you can configure the following parameters for video stream recording:

Video stream quality#

Applies to LUNA ID for Android only.

To set video stream quality, pass the videoQuality parameter to the LunaID.ShowCameraParams() method. The parameter has the following values:

  • VideoQuality.LOW (default)
  • VideoQuality.HIGH

Video stream quality is determined by the following parameters:

Parameter SD (Low quality) SD (High quality) HD 720p HD 1080p
Video resolution 320×240 px 720×480 px 1280×720 px 1920×1080 px
Video frame rate 20 fps 30 fps 30 fps 30 fps
Video bitrate 384 Kbps 2 Mbps 4 Mbps 20 Mbps

Timeout before starting a recording#

Applies to LUNA ID for iOS only.

To set a timeout before starting video recording, use the LCLunaConfiguration.startDelay parameter.

By default, the parameter value is set to 0.

Video stream duration#

In LUNA ID for Android#

To limit a video stream's duration, specify the recordingTimeMillis parameter in LunaID.ShowCameraParams. This will define the video stream's duration in milliseconds. The default value is not set.

LunaID.showCamera(
    activity,
    LunaID.ShowCameraParams(
        recordVideo = true,
        recordingTimeMillis = 10000
    )
)

Note that the recordingTimeMillis parameter is required if the recordVideo parameter is set to true. Otherwise, the following exception will be thrown:

IllegalStateException, when param recordVideo is true -> param recordingTimeMillis must be positive

In LUNA ID for iOS#

To limit a video stream's duration:

  1. Enable face identity tracking by setting the LCLunaConfiguration.trackFaceIdentity property to true.
  2. Specify a video stream length in LCLunaConfiguration::videoRecordLength, in seconds.
  3. Call LMCameraCaptureManager::createVideoRecordWatchDog(LunaCore::LCBestShotDetectorProtocol) in your ViewController.
    This call enables a watchdog object which tracks a primary face search and starts video stream recording. After the time defined in LCLunaConfiguration::videoRecordLength expires, the recording will stop.
    The watchdog object lives inside the capture manager and is not available for public usage.