Skip to content

Camera SDK API Reference ​

The Camera SDK (sdk-camera) provides connection management, capture control, live preview, file management, and firmware upgrade capabilities for Insta360 cameras. This document lists the interface definitions and parameters of all public APIs.


Contents ​

  1. Device Connection and Management
  2. System and Hardware Information
  3. Capture Control and Parameters
  4. Live Preview
  5. File Management
  6. Firmware Upgrade
  7. GPS Data Injection
  8. Event Listeners
  9. Shared Data Types

1. Device Connection and Management ​

CameraDevice ​

The core interface for a camera device and the entry point to every functional module.

kotlin
interface CameraDevice

Factory method

kotlin
CameraDevice.get(connectType: ConnectType): CameraDevice

Sub-modules

PropertyTypeDescription
systemCameraSystemSystem-level features
captureCameraCaptureCapture control
previewCameraPreviewLive preview stream
fileCameraFileOn-camera file management
firmwareCameraFirmwareFirmware version and upgrade

Connection methods

MethodStyleDescription
isConnected()SynchronousWhether the camera is connected
scan(timeoutMs, bleScanCallback)SynchronousScan for nearby Bluetooth devices
stopScan()SynchronousStop the Bluetooth scan
bleWakeUp(cameraType, deviceName, listener)SynchronousWake the camera over Bluetooth
connect(connectHint, callback)CallbackGeneric connect
connect(connectHint)CoroutineGeneric connect
connectBle(bleDeviceCore, callback)CallbackBluetooth connect (SDK BleDeviceCore)
connectBle(bleDeviceCore)CoroutineBluetooth connect (SDK BleDeviceCore)
connectBle(kmpBleDevice, callback)CallbackBluetooth connect (system BluetoothDevice / CBPeripheral)
connectBle(kmpBleDevice)CoroutineBluetooth connect (system BluetoothDevice / CBPeripheral)
connectWiFi(networkId, callback)CallbackWi-Fi connect
connectWiFi(networkId)CoroutineWi-Fi connect
connectUsb(callback)CallbackUSB connect
connectUsb()CoroutineUSB connect
disconnect(callback) / suspend disconnect()Callback / CoroutineDisconnect; returns Result<Unit>
getSupportCameraType()SynchronousList the camera models supported by the current connection type
release()SynchronousRelease all resources held by the device object

Disconnection monitoring

MethodDescription
registerDisconnectListener(listener)Register a disconnection listener
unregisterDisconnectListener(listener)Unregister a disconnection listener

Camera authorization

After connecting, use the methods below to verify whether the current device has been authorized by the camera. The camera displays a confirmation dialog, and the user's approval or rejection is delivered through AuthorizationListener.

MethodStyleDescription
checkAuthorization(callback) / checkAuthorization()Callback / CoroutineCheck authorization; returns AuthorizationStatus
cancelAuthorization(callback) / cancelAuthorization()Callback / CoroutineCancel the ongoing authorization check
registerAuthorizationListener(listener)SynchronousRegister an authorization result listener
unregisterAuthorizationListener(listener)SynchronousUnregister an authorization result listener

AuthorizationStatus values:

ValueDescription
AUTHORIZEDAuthorized
UNAUTHORIZEDNot authorized (the camera shows a confirmation dialog; the result arrives via AuthorizationListener)
SYSTEM_BUSYCamera is busy

2. System and Hardware Information ​

CameraSystem ​

Provides system-level features such as battery, storage, temperature, Wi-Fi, device information, and power off.

kotlin
interface CameraSystem

Every data item is available in three call styles:

  • getXxx() — read the local cache (synchronous)
  • fetchXxx(callback) — fetch from the camera (callback)
  • suspend fetchXxx() — fetch from the camera (coroutine)

Writable items additionally provide a setXxx(...) method.

Data items

Data itemTypeWritableDescription
BatteryDataBatteryData✗Battery level and charging state
ChargeBoxDataChargeBoxData✗Charge case state
MuteBoolean✓Mute state
SerialNumberString✗Serial number
UuidString✗UUID
OriginOffset / V2 / V3String✗Original lens offset (multiple versions)
ActivateTimeLong✓Activation time
StorageDataStorageData✗Deprecated; use StorageDataList
StorageDataListList<StorageData>✗State of each storage medium (supports multiple storage locations)
MediaOffset / V2 / V3String✗Media offset (multiple versions)
MediaOffsetV6String✗Media offset V6
FirmwareRevisionString✗Firmware version
WifiDataWiFiData✗Wi-Fi information
WifiChannelListWiFiChannel✗Wi-Fi channel list
CameraTypeCameraType✗Camera model
VideoEncodeTypeVideoEncode✓Video encoding type
IsSelfieBoolean✗Whether selfie mode is active
CameraLanguageLanguageType✓Camera language
AssistiveGridEnableBoolean✓Assistive grid
FreeFrameGridEnableBoolean✓Free-aspect grid
SharpnessSharpness✓Global sharpness
MediaTimeLong✗Media time
WindowCropInfoWindowCropInfo✗Window crop information (cached)
HalfWindowCropInfoWindowCropInfo✗Half-window crop information (cached)
OffsetStateInt✗Offset state (cached)
OffsetDetectedTypeInt✗Offset detection type (cached)
RollingShutterTimeDouble✗Rolling shutter time (seconds)

Operations

MethodStyleDescription
setLocalTime(localTime, callback) / setLocalTime(localTime)Callback / CoroutineSet the local time
openCameraWiFi(channel, callback) / openCameraWiFi(channel)Callback / CoroutineTurn Wi-Fi on
closeCameraWiFi(callback) / closeCameraWiFi()Callback / CoroutineTurn Wi-Fi off
resetCameraWiFi(channel, callback) / resetCameraWiFi(channel)Callback / CoroutineRestart Wi-Fi
setWiFiCountry(countryCode, callback) / setWiFiCountry(countryCode)Callback / CoroutineSet the Wi-Fi country code
activeCamera(appId, secretKey, callback) / activeCamera(appId, secretKey)Callback / CoroutineActivate the camera
calibrateGyro(callback) / calibrateGyro()Callback / CoroutineCalibrate the gyroscope
setLockScreenState(state, callback) / setLockScreenState(state)Callback / CoroutineSet the screen lock state
formatSdCard(callback) / formatSdCard()Callback / CoroutineDeprecated; use formatStorage (equivalent to formatStorage(FileLocation.CAMERA))
formatStorage(fileLocation, callback) / formatStorage(fileLocation)Callback / CoroutineFormat the given storage location; defaults to FileLocation.CAMERA
setMainStorage(fileLocation, callback) / setMainStorage(fileLocation)Callback / CoroutineSet the primary storage location (X6 only)
shutdown()SynchronousPower off the camera

State monitoring

MethodDescription
registerBatteryListener(listener) / unregisterBatteryListener(listener)Battery state
registerChargeBoxStatusListener(listener) / unregisterChargeBoxStatusListener(listener)Charge case state
registerTemperatureListener(listener) / unregisterTemperatureListener(listener)Temperature state
registerStorageStatusListener(listener) / unregisterStorageStatusListener(listener)Storage card state

3. Capture Control and Parameters ​

CameraCapture ​

Provides start/stop control for photo and video capture, plus read/write access to every capture parameter.

kotlin
interface CameraCapture

CameraParam<T> ​

A uniform wrapper for reading, writing, querying supported values, and observing changes of a single capture parameter.

kotlin
interface CameraParam<T>
MethodDescription
suspend getValue(): Result<T>Read the currently cached value
suspend fetchValue(): Result<T>Read the latest value from the camera
suspend setValue(value: T): Result<Unit>Write a new value (notifies listeners automatically)
suspend getSupported(): Result<List<T>>Get the values available in the current mode
getName(): StringGet the parameter's name identifier
addListener(listener: (T) -> Unit)Subscribe to value-change callbacks
removeListener(listener: (T) -> Unit)Unsubscribe from value-change callbacks

Capture parameters

All parameters are exposed as CameraParam<T> properties on CameraCapture:

PropertyType TDescription
lensTypeSensorModeLens type (single lens, dual lens, and so on)
functionModeFunctionModeCapture function mode (video, photo, timelapse, and so on)
photoResolutionPhotoResolutionPhoto resolution
videoResolutionRecordResolutionVideo resolution
hdrPhotoModePhotoHdrTypePhoto HDR mode
hdrSwitchBooleanVideo HDR toggle
aebIntAuto exposure bracketing (AEB)
rawTypeRawTypeRAW format type
exposureProgramExposureProgramExposure program
exposureISOIntISO
exposureShutterSpeedPair<Double, Double>Shutter speed
videoISOTopLimitIntVideo ISO upper limit
exposureBiasDoubleExposure compensation (EV)
whiteBalanceIntWhite balance
fovTypeFovTypeField-of-view type
flowStateLevelFlowStateLevelStabilization level
photographySelfTimerIntPhoto self-timer
splicingBaseEnableBooleanBase stitching toggle
videoSelfieModeVideoSelfieModeVideo selfie mode
exportTypeExportTypeExport type
photoSizeIdPhotoSizePhoto size / aspect ratio
colorModeVideoGammaModeColor mode
filterModeVideoGammaModeFilter mode
accelerateFrequencyIntSpeed-up factor (timelapse)
recordDurationIntRecording duration
exposureIndividualPanoExposureModeIndependent exposure mode
livingBitrateIntLive streaming bitrate
burstCaptureParamsPair<Int, Int>Burst parameters (shot count, interval)
p3SwitchBooleanDisplay P3 color gamut toggle
iLogSwitchBooleani-Log color mode toggle
pureVideoEnhanceSwitchBooleanPureVideo night enhancement toggle
doubleZoomEnableBoolean2x zoom toggle
lapseTimeDoubleInterval shooting interval
livePhotoModeBooleanLive Photo
lensAccessoryLensAccessoryTypeLens accessory type
iq3AModeIq3AMode3A pro mode (NORMAL ↔ PRO). Which values remain available for exposureISO, exposureShutterSpeed, whiteBalance, videoISOTopLimit, and similar parameters in each mode is driven by the camera's own declaration; the SDK does not switch modes automatically

Parameter management

MethodDescription
getSupportParam(): List<CameraParam<*>>List the parameters supported by the connected camera
suspend syncAllParams()Force a full parameter sync from the camera
suspend loadJson(): Result<Unit>Load the camera's parameter configuration JSON (call after connecting)

getSupportParamNames() and getAllParams() are deprecated; use getSupportParam() instead.

Capture control

MethodDescription
suspend startCapture(gpsInfo: GpsInfo? = null)Start capturing, optionally writing GPS data into the media file
suspend stopCapture(gpsInfo: GpsInfo? = null)Stop capturing, optionally writing GPS data into the media file
suspend setGpsInfo(gpsInfo: GpsInfo)Update GPS data while capturing
suspend isWorking(): BooleanWhether a capture is in progress
isPreRecording(): BooleanWhether pre-recording is active
cancelPreRecord()Cancel pre-recording
suspend getBurstTime(): Result<Unit>Get the burst time
suspend getRemaining(): Result<Int>Remaining recording time (seconds) or shot count for the current mode
getRemaining(functionMode): Result<Int>Remaining capacity for a given mode (cached)
suspend fetchRemaining(functionMode): Result<Int>Fetch the remaining capacity for a given mode from the camera
registerCaptureStatusListener(listener)Register a capture status listener
unregisterCaptureStatusListener(listener)Unregister a capture status listener

4. Live Preview ​

CameraPreview ​

Controls starting and stopping the camera's live preview stream, retrieves stream parameters, and monitors camera posture.

kotlin
interface CameraPreview
MethodDescription
startStream()Start the preview stream (decoder configuration is synced automatically)
stopStream()Stop the preview stream
requestStreamIframe()Request an immediate key frame to recover from a corrupted image
getPreviewParams(): Result<PreviewParams>Get a snapshot of the current preview stream parameters (for use by the media side)
getCurrentFunctionMode(): Result<FunctionMode>Get the function mode of the current preview session
getVideoBitrate(): Result<Int>Get the cached video bitrate (bps)
suspend fetchVideoBitrate(): Result<Int>Fetch the latest video bitrate from the camera
suspend setVideoBitrate(bitrate: Int): Result<Unit>Set the video bitrate
setStreamEncode(isH265: Boolean)Manually override the preview stream decoder configuration (rarely needed)
setPipeline(pipeline: KMPCameraPreviewPipeline?)Set the preview rendering pipeline
registerPostureListener(listener)Register a camera posture update listener
unregisterPostureListener(listener)Unregister a camera posture update listener
registerCameraStreamListener(listener)Register a preview stream state listener
unregisterCameraStreamListener(listener)Unregister a preview stream state listener
suspend startLive(params: CameraLiveParams): Result<Unit>Start an RTMP live stream (switch to live mode and start the preview stream first)
startLive(params: CameraLiveParams, callback: Callback<Unit>)Start a live stream (callback flavor)
suspend stopLive(): Result<Unit>Stop the live stream
stopLive(callback: Callback<Unit>)Stop the live stream (callback flavor)
registerCameraLiveListener(listener)Register a live streaming state listener
unregisterCameraLiveListener(listener)Unregister a live streaming state listener

A successful return from startLive only means the streaming request was accepted. The actual streaming state is delivered asynchronously through CameraLiveListener.

CameraStreamListener ​

kotlin
interface CameraStreamListener
CallbackDescription
onOpening()The preview stream is opening
onOpened()The preview stream opened successfully
onIdle()The preview stream is closed
onParamsChanged(paramsUpdate: PreviewStreamParamsUpdate)Preview stream parameters changed (resolution, frame rate, crop information, and so on)
onStreamDataNotify(streamData: PreviewStreamFrame)A preview stream data frame was received (empty default implementation)

CameraLiveParams ​

Live streaming parameters passed to CameraPreview.startLive().

kotlin
data class CameraLiveParams(
    val rtmpUrl: String,
    val width: Int,
    val height: Int,
    val fps: Int,
    val bitrate: Int,
    val netId: Long = -1L
)
PropertyDescription
rtmpUrlRTMP streaming URL
width / heightStream resolution (pixels)
fpsStream frame rate
bitrateStream bitrate (in Mbps; converted to bps internally)
netIdNetwork ID used for streaming; defaults to -1 (the underlying default network). The SDK does not manage networks — to bind a specific network such as cellular, pass the corresponding network ID

CameraLiveListener ​

Live streaming state callbacks, registered via CameraPreview.registerCameraLiveListener(). All callbacks are dispatched off the main thread; switch to the main thread yourself before updating the UI.

kotlin
interface CameraLiveListener
CallbackDescription
onStarted()Streaming started successfully
onFps(fps: Int)Frame rate update; fps is the current real-time frame rate
onStopped()Streaming stopped normally
onFailed(errorCode: Int, message: String?)A streaming error occurred; errorCode is the underlying error code

PreviewStreamFrame ​

kotlin
data class PreviewStreamFrame(
    val data: ByteArray,
    val timestamp: Long,
    val type: PreviewStreamType = PreviewStreamType.UNKNOWN
)
PropertyDescription
dataRaw frame bytes
timestampFrame timestamp (usually needs converting to microseconds before feeding MediaCodec)
typeFrame type; see the table below

PreviewStreamType ​

ValueDescription
VIDEORegular video frame
VIDEO_LLeft-eye / left-side video frame
VIDEO_RRight-eye / right-side video frame
AUDIOAudio frame
GYROGyroscope / posture data frame
OTHEROther type
UNKNOWNUnknown type

val isVideo: Boolean — whether this is a video frame (VIDEO / VIDEO_L / VIDEO_R).

PreviewStreamParamsUpdate ​

kotlin
data class PreviewStreamParamsUpdate(
    val windowCropInfo: WindowCropInfo?,
    val offsetData: CameraPreviewOffsetData?,
    val stabOffset: String?,
    val previewWidth: Int,
    val previewHeight: Int,
    val previewFps: Int,
)
PropertyDescription
windowCropInfoWindow crop information, used for panoramic stitching
offsetDataLens offset / calibration parameters
stabOffsetStabilization offset string
previewWidth / previewHeightCurrent preview resolution (pixels)
previewFpsCurrent preview frame rate

5. File Management ​

CameraFile ​

Provides listing, downloading, and deletion of media files stored on the camera.

kotlin
interface CameraFile

Server information

MethodDescription
getEndpoint(): StringFull file server URL (for example http://192.168.42.1:80/)
getHost(): StringHost address
getProt(): IntPort number

File listing

MethodStyleDescription
listMediaFiles(mediaFileType, includeRecording, callback)CallbackGet the complete file list as a list of URIs
listMediaFiles(mediaFileType, includeRecording)CoroutineSame as above
listMediaFiles(mediaFileType, start, limit, includeRecording, callback)CallbackPaged listing; returns Pair<List<String>, Int> (page items, total count)
listMediaFiles(mediaFileType, start, limit, includeRecording)CoroutineSame as above
getFileInfoList(callback)CallbackGet the detailed file information list
getFileInfoList()CoroutineSame as above

File operations

MethodStyleDescription
deleteMediaFiles(vararg uris, callback)CallbackDelete the given files
deleteMediaFiles(vararg uris)CoroutineDelete the given files
downloadMediaFile(url, targetDir, progressCallback?)CoroutineDownload a media file; returns the local path
downloadMediaFile(url, targetDir, progressCallback)Progress callbackDownload a media file
downloadCameraLogFile(targetDir, progressCallback?)CoroutineDownload the camera log file; returns the local path
downloadCameraLogFile(targetDir, progressCallback)Progress callbackDownload the camera log file

6. Firmware Upgrade ​

CameraFirmware ​

kotlin
interface CameraFirmware
MethodStyleDescription
getVersion(): Result<String>SynchronousGet the current firmware version
upgradeFirmware(filePath, callback)Progress callbackUpgrade the firmware; progress ranges from 0.0 to 1.0
upgradeFirmware(filePath, progress?)CoroutineUpgrade the firmware with an optional progress callback

7. GPS Data Injection ​

To embed GPS data in media files during capture, hold and manage your own location data source and pass the GPS data for the start and stop moments to CameraCapture.startCapture(gpsInfo) / stopCapture(gpsInfo). To update it while recording, call CameraCapture.setGpsInfo(gpsInfo).

GpsInfo ​

kotlin
data class GpsInfo(
    val latitude: Double,
    val longitude: Double,
    val altitude: Double,
    val timestampMs: Long
)
PropertyDescription
latitudeLatitude (degrees)
longitudeLongitude (degrees)
altitudeAltitude (meters)
timestampMsTimestamp (milliseconds)
toByteArray()Serialize to a little-endian byte array

8. Event Listeners ​

DisconnectListener ​

Fires when the device loses its connection to the camera. Registered via CameraDevice.registerDisconnectListener().

CallbackParametersDescription
onDisconnect(throwable: Throwable?)throwable: the disconnection cause (null for a normal disconnect)The connection was closed

BleWakeUpListener ​

Bluetooth wake-up result callback, passed to CameraDevice.bleWakeUp().

CallbackParametersDescription
onWakeUpSuccess()—Bluetooth wake-up succeeded
onWakeUpError(errCode: Int)errCode: error codeBluetooth wake-up failed

BatteryListener ​

Registered via CameraSystem.registerBatteryListener().

CallbackParametersDescription
onBatteryLevelChange(batteryData: BatteryData)batteryData: battery level and charging stateBattery level changed
onLowBatteryWarning()—Low battery warning

ChargeBoxStatusListener ​

Registered via CameraSystem.registerChargeBoxStatusListener().

CallbackParametersDescription
onChargeBoxStatusChange(chargeBoxData: ChargeBoxData)chargeBoxData: charge case stateCharge case state changed

TemperatureListener ​

Registered via CameraSystem.registerTemperatureListener().

CallbackParametersDescription
onTemperatureUpdate(tempState: TempState)tempState: temperature levelCamera temperature state changed

StorageStateListener ​

Registered via CameraSystem.registerStorageStatusListener().

CallbackParametersDescription
onStorageStateListChanged(storageDataList: List<StorageData>)storageDataList: state of every storage mediumStorage state changed

CaptureStatusListener ​

Registered via CameraCapture.registerCaptureStatusListener().

CallbackParametersDescription
onCaptureStarting(functionMode)Current capture modeCapture is about to start
onCaptureWorking(functionMode)Current capture modeCapture has entered the working state
onCaptureStopping(functionMode)Current capture modeCapture is about to stop
onCaptureFinish(functionMode, filePaths)filePaths: paths of the generated filesCapture finished and files were generated
onCaptureError(functionMode, throwable)throwable: error causeA capture error occurred
onCaptureTimeChanged(functionMode, captureTime)captureTime: elapsed recording timeRecording duration changed (video modes)
onCaptureCountChanged(functionMode, captureCount)captureCount: shots taken so farShot count changed (burst / interval)
onCaptureSubStatusChanged(functionMode, subStatus)subStatus: sub-statusCapture sub-status changed (for example HDR processing)

CameraPostureUpdate ​

Registered via CameraPreview.registerPostureListener() to receive the camera's spatial posture data in real time.

CallbackParametersDescription
updatePosture(cameraPosture: CameraPosture)cameraPosture: posture dataPosture data updated (gyroscope / accelerometer)

AuthorizationListener ​

Registered via CameraDevice.registerAuthorizationListener() to receive the result of authorization actions taken on the camera.

CallbackParametersDescription
onAuthorizationResult(operationType, result)operationType: the operation that triggered this authorization; result: the authorization resultFires after the user approves or rejects authorization on the camera

9. Shared Data Types ​

The types below are shared between the Camera and Media modules and are listed here for reference.

KMPCameraPreviewPipeline ​

Defined in verticalCommon and used on both the Camera and Media sides:

  • Camera side: CameraPreview.setPipeline(pipeline) — inject the pipeline into the camera preview
  • Media side: PreviewPlayer.getPipeline() — get the current rendering pipeline

The pipeline object is created on the media side and passed to the camera side, where it serves as the transport channel for preview data.


PreviewStreamParamsUpdate (Camera → Media) ​

When the camera's preview stream parameters change, this object is delivered through CameraStreamListener.onParamsChanged(). On the media side, PreviewPlayer.setOffset() and setWindowCropInfo() are typically updated from the data it carries.

See §4 Live Preview – PreviewStreamParamsUpdate.