LONET2 Developer Guide

LONET 2 JSON PROTOCOL

LONET 2 is sent by default to multicast group 236.12.12.12 on port 60608, however unicast or broadcast is also supported. There is no handshake or connection procedure, simply subscribe to the multicast group to start getting data.

The data in each packet is tied to one camera, defined as the cameraName string.

Each UDP packet should contain a JSON object that may include any combination of the following top-level fields:

"encoder_data"
"distortion_data"
"camera_transform_data"
"controller_data"

1. Encoder Data ("encoder_data")

The "encoder_data" field carries information related to camera encoders, such as focal length, iris (aperture), and focus distance values.

{
  "encoder_data": {
    "cameraName": "Camera1",
    "focalLengthRaw": 50.0,
    "focalLengthMapped": 35.0,
    "irisRaw": 2.8,
    "irisMapped": 2.8,
    "focusRaw": 1000.0,
    "focusMapped": 5.0,
    "frameRate": 24.0,
    "timecode": "01:23:45:12"
  }
}

Field Definitions

  • cameraName (string): The unique identifier for the camera associated with this encoder data.
  • focalLengthRaw (number): The raw focal length value received from the encoder hardware.
  • focalLengthMapped (number): The mapped or calibrated focal length value used within the application.
  • irisRaw (number): The raw iris (aperture) value from the encoder.
  • irisMapped (number): The mapped iris value suitable for application use.
  • focusRaw (number): The raw focus distance value from the encoder.
  • focusMapped (number): The mapped focus distance value.
  • frameRate (number): The frame rate at which the data is being transmitted, in frames per second (fps).
  • timecode (string): The timecode associated with this data sample, formatted as "HH:MM:SS:FF".

2. Distortion Data ("distortion_data")

The "distortion_data" field provides lens distortion parameters and intrinsic camera properties.

{
  "distortion_data": {
    "cameraName": "Camera1",
    "focalLengthRaw": 50.0,
    "focalLengthMapped": 35.0,
    "irisRaw": 2.8,
    "irisMapped": 2.8,
    "focusRaw": 1000.0,
    "focusMapped": 5.0,
    "frameRate": 24.0,
    "timecode": "01:23:45:12",
    "fXfY": [1000.0, 1000.0],
    "principalPoint": [960.0, 540.0],
    "distortionParameters": [0.1, -0.05, 0.0]
  }
}

Field Definitions

  • cameraName (string): The unique identifier for the camera.
  • focalLengthRaw, focalLengthMapped, irisRaw, irisMapped, focusRaw, focusMapped, frameRate, timecode: Same definitions as in the Encoder Data section.
  • fXfY (array of numbers): An array containing the focal lengths in pixels along the X and Y axes, respectively. Example: [fx, fy].
  • principalPoint (array of numbers): The principal point coordinates in pixels, typically the center of the image sensor. Example: [cx, cy].
  • distortionParameters (array of numbers): Coefficients for the lens distortion model. The number and meaning of these coefficients depend on the distortion model used (e.g., radial, tangential).

3. Camera Transform Data ("camera_transform_data")

The "camera_transform_data" field contains the spatial transform (position and orientation) of the camera and additional camera settings like white balance and ISO.

{
  "camera_transform_data": {
    "cameraName": "Camera1",
    "whiteBalance": 6500.0,
    "tint": 0.0,
    "ISO": 800.0,
    "shutter": 0.0167,
    "focalLengthRaw": 50.0,
    "irisRaw": 2.8,
    "focusRaw": 1000.0,
    "frameRate": 24.0,
    "dropFrame": false,
    "timecode": "01:23:45:12",
    "position": [0.0, 100.0, 200.0],
    "orientation": [0.0, 0.0, 0.0, 1.0],
    "sensorSize": [36.0, 24.0]
  }
}

Field Definitions

  • cameraName (string): The unique identifier for the camera.
  • whiteBalance (number): The white balance setting in Kelvin.
  • tint (number): The tint adjustment value.
  • ISO (number): The camera's ISO sensitivity setting.
  • shutter (number): The shutter speed in seconds (e.g., 1/60 becomes 0.0167).
  • focalLengthRaw, irisRaw, focusRaw, frameRate, timecode: Same as previously defined.
  • dropFrame (boolean): Indicates whether drop-frame timecode is used.
  • position (array of numbers): The 3D position of the camera in world coordinates, formatted as [x, y, z].
  • orientation (array of numbers): The orientation of the camera represented as a quaternion [x, y, z, w].
  • sensorSize (array of numbers): The physical dimensions of the camera sensor in millimeters [width, height].

4. Controller Data ("controller_data")

The "controller_data" field carries input states from a controller device, such as buttons and touchpad values.

{
  "controller_data": {
    "controllerName": "Controller1",
    "button1": 1.0,
    "button2": 0.0,
    "button3": 0.0,
    "trigger": 0.5,
    "touchpadPressed": 1.0,
    "touchpadX": 0.25,
    "touchpadY": -0.75,
    "frameRate": 24.0,
    "timecode": "01:23:45:12"
  }
}

Field Definitions

  • controllerName (string): The unique identifier for the controller.
  • button1, button2, button3 (number): The state of buttons on the controller (1.0 for pressed, 0.0 for released).
  • trigger (number): The analog value of the trigger input, ranging from 0.0 (unpressed) to 1.0 (fully pressed).
  • touchpadPressed (number): The state of the touchpad press (1.0 for pressed, 0.0 for released).
  • touchpadX, touchpadY (number): The position on the touchpad, typically ranging from -1.0 to 1.0 along each axis.
  • frameRate, timecode: As previously defined.

Example

An example of a UDP packet containing multiple data types:

{
  "encoder_data": {
    "cameraName": "Camera1",
    "focalLengthRaw": 50.0,
    "focalLengthMapped": 35.0,
    "irisRaw": 2.8,
    "irisMapped": 2.8,
    "focusRaw": 1000.0,
    "focusMapped": 5.0,
    "frameRate": 24.0,
    "timecode": "01:23:45:12"
  },
  "distortion_data": {
    "cameraName": "Camera1",
    "fXfY": [1000.0, 1000.0],
    "principalPoint": [960.0, 540.0],
    "distortionParameters": [0.1, -0.05, 0.0],
    "focalLengthRaw": 50.0,
    "focalLengthMapped": 35.0,
    "irisRaw": 2.8,
    "irisMapped": 2.8,
    "focusRaw": 1000.0,
    "focusMapped": 5.0,
    "frameRate": 24.0,
    "timecode": "01:23:45:12"
  },
  "camera_transform_data": {
    "cameraName": "Camera1",
    "whiteBalance": 6500.0,
    "tint": 0.0,
    "ISO": 800.0,
    "shutter": 0.0167,
    "focalLengthRaw": 50.0,
    "irisRaw": 2.8,
    "focusRaw": 1000.0,
    "frameRate": 24.0,
    "dropFrame": false,
    "timecode": "01:23:45:12",
    "position": [0.0, 100.0, 200.0],
    "orientation": [0.0, 0.0, 0.0, 1.0],
    "sensorSize": [36.0, 24.0]
  },
  "controller_data": {
    "controllerName": "Controller1",
    "button1": 1.0,
    "button2": 0.0,
    "button3": 0.0,
    "trigger": 0.5,
    "touchpadPressed": 1.0,
    "touchpadX": 0.25,
    "touchpadY": -0.75,
    "frameRate": 24.0,
    "timecode": "01:23:45:12"
  }
}

https://github.com/MadlyFX/LONET-2-LiveLink-Plugin/blob/master/Source/LONET2LiveLink/Private/LONET2LiveLinkSource.cpp