Difference between revisions of "iPi Automation Add-on"

From iPi Docs
Jump to: navigation, search
Line 14: Line 14:
 
# Select menu item '''Help > Manage Licenses > Integration Add-on'''.
 
# Select menu item '''Help > Manage Licenses > Integration Add-on'''.
 
# Press '''Start 30-days Free Trial Period''' or '''Enter Integration Add-on License Key''' and follow further on-screen instructions
 
# Press '''Start 30-days Free Trial Period''' or '''Enter Integration Add-on License Key''' and follow further on-screen instructions
#:[[Image:iPi-Integration-2-2.png|600px|]]
+
#:[[Image:iPi-Integration-2-2.png|300px|]]
  
 
{{Note|To use '''iPi Integration Add-on''' with [[iPi Recorder]], you have to install [[iPi Mocap Studio]] on the same computer and activate '''iPi Integration Add-on''' following the instructions above. You do not need to activate any other keys (Main or Biomech Add-on), if you do not plan to perform tracking on this computer. }}
 
{{Note|To use '''iPi Integration Add-on''' with [[iPi Recorder]], you have to install [[iPi Mocap Studio]] on the same computer and activate '''iPi Integration Add-on''' following the instructions above. You do not need to activate any other keys (Main or Biomech Add-on), if you do not plan to perform tracking on this computer. }}

Revision as of 05:26, 7 December 2015

Overview

iPi Integration Add-on allows to control iPi Recorder and iPi Mocap Studio from external application by sending JSON commands via Windows dll. It can be used for:

Note.png
Note: iPi Integration Add-on requires separate license key, which you need to activate in iPi Mocap Studio. 30-days free trial provided.

License and Trial

iPi Integration Add-on requires separate license key, which you need to activate in iPi Mocap Studio. You can order your license here, or activate 30-days free trial. Follow the steps below to start working with iPi Integration Add-on

  1. Select menu item Help > Manage Licenses > Integration Add-on.
  2. Press Start 30-days Free Trial Period or Enter Integration Add-on License Key and follow further on-screen instructions
    iPi-Integration-2-2.png
Note.png
Note: To use iPi Integration Add-on with iPi Recorder, you have to install iPi Mocap Studio on the same computer and activate iPi Integration Add-on following the instructions above. You do not need to activate any other keys (Main or Biomech Add-on), if you do not plan to perform tracking on this computer.

Using iPi Integration Add-on

Communication Library

In order to enable communication with iPi Recorder and/or iPi Mocap Studio, your program should use the library iPiMocapIntegration.dll.

Redistributable Contents

Redistributable of the library has the following structure:

  • bin Binary files to redistribute with your program. The library itself accompanied by PDB file, and C runtime library msvcr120.dll.
    • x86 32-bit version
    • x64 64-bit version
  • include Header files for the library. May be used directly in C/C++ programs, or as reference for making proper binding to DLL for other programming languages.
  • lib Static library files for linking with C/C++ programs.
    • x86 32-bit version
    • x64 64-bit version
  • samples Samples of library usage. Currently only for Visual C++ 2013.

API

This library provides a general way of communication with supported applications. A client program establishes a connection to an application. Then, using this connection, it sends commands to the application. After executing a command, the application synchronously sends a response to that command back to a client program. Also, through the same connection, the application asynchronously notifies a client program about occurring events, such as the end of a long-running operation.

Each application has its own set of commands and events. Specific commands/events are out of scope of this library and should be handled in code using it.

Connecting and Disconnecting

iPi_Result iPi_ConnectToRecorder(LPCWSTR executablePath, iPi_EventCallback fnEventCallback, LPHANDLE phConnection);
iPi_Result iPi_ConnectToMocapStudio(LPCWSTR executablePath, iPi_EventCallback fnEventCallback, LPHANDLE phConnection);
ParameterDescription
executablePathPath to executable file of an application. Optional.
fnEventCallbackPointer to a function which handles events coming from an application. Optional.
phConnectionReceives a connection handle. Required.

Functions iPi_ConnectToRecorder and iPi_ConnectToMocapStudio are used to establish connections to corresponding applications.

First, they try to connect to already running application instance if any. An application will refuse the connection if it already has other connection with some client.

If there are no running instances of the application, or they all refuse connection, then a new instance of the application is launched. If executablePath parameter is specified, then it is used to run the application. Otherwise, the function looks for path to an application in file associations and standard installation directory.

When connection is fully operational, its handle is returned in phConnection parameter. This handle is used in all subsequent calls for this connection.

Parameter fnEventCallback specifies a function to handle asynchronous application events. See the section about events below.

iPi_Result iPi_Disconnect(HANDLE hConnection);
ParameterDescription
hConnectionConnection handle. Required.

iPi_Disconnect closes previously open connection and frees all associated resources.

The function does not close the application itself. To do this, send an exit command specific to the application.

Sending Commands

iPi_Result iPi_ExecuteCommand(HANDLE hConnection, LPCWSTR jsonCommand, LPWSTR* pJsonResponse);
ParameterDescription
hConnectionConnection handle. Required.
jsonCommandCommand string. Required.
pJsonResponseReceives a response string. Required.

iPi_ExecuteCommand is used to send a command to the application. Parameter jsonCommand contains the command to send.

Response received from the application is placed into pJsonResponse. When not needed anymore, the returned response string should be freed with iPi_Free function.

Consuming Events

To consume asynchronous events coming from the application, client code should specify address of a callback function in fnEventCallback parameter when opening a connection. If callback is not specified, then application events will be discarded. The type of event callback is defined as follows:

typedef void (WINAPI *iPi_EventCallback)(HANDLE hConnection, LPWSTR jsonEvent);
ParameterDescription
hConnectionConnection handle.
jsonEventEvent string.

Every time an event comes from the application, the library calls this callback function. An event string is passed in jsonEvent parameter. When not needed, this string should be freed with iPi_Free function.

A callback is invoked on a thread from the process's thread pool. Each invocation may be on another thread, and multiple invocations may take place in the same time. So pay attention to proper thread synchronization in code.

Error Codes

Most of API functions has return type iPi_Result, which is enumeration representing error codes. The numeric values of the constants can be found in header file iPiTypes.h.

ConstantDescription
IPI_OKOperation succeeded.
IPI_GENERAL_ERRORSome error has occurred, for which there is no more specific error code.
IPI_INVALID_PARAMInvalid parameter value in a call to a function.
IPI_OUT_OF_MEMORYNot enough memory to complete an operation.
IPI_CONNECTION_BROKENConnection to an application has been broken. Should call iPi_Disconnect on this one and establish a new connection if needed.
IPI_CANNOT_START_APPApplication executable file was not found or other problem when starting application.
IPI_CANNOT_CONNECTApplication is not running or does not accept connections. For example, its an old version of the application which does not support connections. Or limit on connections is reached.
IPI_INVALID_DATAInvalid data read from a connection.

Miscellaneous

BOOL iPi_Free(LPVOID ptr);

Function iPi_Free should be used to free memory blocks that are allocated by the library and passed to client code, when they are not needed anymore. This includes response strings when executing commands and event strings when consuming events.

Command Syntax

Commands are strings based on JSON syntax. Commands are submitted via JSON requests that include command name and may optionally include command arguments.

The response is also JSON string. The response include success flag. In case of error the response include error message. In case of success the response may optionally include result that is JSON object.

Long actions (recording, background evaluation, etc.) initiated by commands generate asynchroneous events on action completion. Event is described by JSON string that include event name and may include optional arguments, depending on type of event.

SYNOPSIS

// Request for command without arguments
{
    "command": "<command_name_string>"
}
 
// Request for command with arguments
{
    "command": "<command_name_string>",
    "arguments": 
    {
        <arguments_list_json_string>
    }
}
 
// Simple response in case of success
{
    "success": true
}
 
// Response including command result field in case of success
{
    "success": true,
    "result":
    {
      <result_json_string>
    } 
}
 
// Response in case of error
{
    "success": false,
    "error": "<error_message_string>"
}
 
// Event without arguments
{
    "event": "<event_name_string>"
}
 
// Event including arguments
{
    "event": "<event_name_string>",
    "arguments": 
    {
        <arguments_list_json_string>
    }
}

iPi Recorder Commands

General Commands

get-app-info

get-app-info command returns the name of application and its version.

Parameter NameTypeMandatory /
Optional
Allowed ValuesDescription
Arguments
No arguments
Result
appNamestringmandatoryiPi Recorder 3 Application name.
appVersionstringmandatoryVersion number in the format XX.XXX.XXX.XXX Application version number.

EXAMPLE

// Request
{
    "command": "get-app-info"
}
 
// Response
{
    "success":true,
    "result":
    {
        "appName": "iPi Recorder 3",
        "appVersion": "99.876.543.210"
    }
}

open-studio

open-studio command opens iPi Mocap Studio and creates the project from specified .iPiVideo file.

Parameter NameTypeMandatory /
Optional
Allowed ValuesDescription
Arguments
filePathstringmandatoryValid file path Full path of .iPiVideo file.
Result
Empty result

EXAMPLE

// Request
{
    "command": "open-studio",
    "arguments": 
    {
        "filePath": "D:\\iPiMocap\\test_record.iPiVideo"
    }
}
 
// Response
{
    "success": true
}

exit

exit command closes iPi Recorder.

Parameter NameTypeMandatory /
Optional
Allowed ValuesDescription
Arguments
No arguments
Result
Empty result

EXAMPLE

// Request
{
    "command": "exit"
}
 
// Response
{
    "success": true
}

Recording Commands

open-home-screen

open-home-screen opens HOME screen of iPi Recorder.

Parameter NameTypeMandatory /
Optional
Allowed ValuesDescription
Arguments
No arguments
Result
Empty result

EXAMPLE

// Request
{
    "command": "open-home-screen"
}
 
// Response
{
    "success": true
}

refresh-device-list

refresh-device-list returns the list of available devices.

Parameter NameTypeMandatory /
Optional
Allowed ValuesDescription
Arguments
No arguments
Result
Array of JSON objects, each representing recording device. Fields of array items:
kindstringmandatorycamera
depth-sensor
microphone
Device type.
modelstringmandatorySupported device model Device model.
idstringmandatoryUnique string, format depends on device model Unique string that is used to identify recording devices in open-recorder command.
selectedbooleanmandatorytrue
false
Device selected status.
failedbooleanmandatorytrue
false
Device failed status.
errorstringoptionalError message string Error message if device is in failed status.

EXAMPLE

// Request
{
    "command": "refresh-device-list"
}
 
// Response
{
    "success":true,
    "result":
    [
        {
            "kind": "camera",
            "model": "PlayStation Eye",
            "id": "\\\\?\\usb#vid_1415&pid_2000&mi_00#7&2ed872d7&0&0000#{4cff9941-d72f-4951-9291-03d8fc97fe30}",
            "selected": false,
            "failed": false
        },
        {
            "kind": "depth-sensor",
            "model": "Kinect 2 for Windows",
            "id": "Default Kinect 2",
            "selected": true,
            "failed": true,
            "error": "Is not available"
        },    
        {
            "kind": "microphone",
            "model": "USB Camera-B4.04.27.1",
            "id": "Microphone (USB Camera-B4.04.27 [VID=-1; PID=-1; Driver=256; Channels=2; Supports=WAVE_FORMAT_11M08, ...]",
            "selected": false,
            "failed": false
        }
    ]
}

open-recorder

open-recorder selects devices for recording and switches to SETUP stage.

Parameter NameTypeMandatory /
Optional
Allowed ValuesDescription
Arguments
selectedDevicesstring arraymandatoryList of device id strings Selecting devices for recording. Device ids are returned by refresh-device-list command.
Result
Empty result

EXAMPLE

// Request
{
    "command": "open-recorder"
    "arguments":
    {
        "selectedDevices":
        [
            "\\\\?\\usb#vid_1415&pid_2000&mi_00#7&2ed872d7&0&0000#{4cff9941-d72f-4951-9291-03d8fc97fe30}",
            "\\\\?\\usb#vid_1415&pid_2000&mi_00#7&1c1ec232&0&0000#{4cff9941-d72f-4951-9291-03d8fc97fe30}"
        ]
    }    
 
}
 
// Response
{
    "success":true
}

evaluate-background

evaluate-background runs background evaluation.

Tip.png
Tip: If parameter is not specified in command arguments, current value in user interface will be used.
Parameter NameTypeMandatory /
Optional
Allowed ValuesDescription
Arguments
durationnumberoptionalInteger number of seconds from 2 to 10

Setting duration of background evaluation.

startDelaynumberoptionalInteger number of seconds from 0 to 30

Setting start delay for background evaluation.

Result
Empty result
Events
background-evaluation-stopped event is generated when background evaluation is competed or cancelled
successbooleanmandatorytrue
false
Success flag. Set to true if background evaluation was completed successfully.
cancelledbooleanmandatorytrue
false
Cancellation flag. Set to true if background evaluation was cancelled by user or due to error.

EXAMPLE

// Request
{
    "command": "evaluate-backgorund",
    "arguments": 
    {
        "duration": 3,
        "startDelay": 1
    }
}
 
// Response
{
    "success": true
}
 
// Event 
{
    "event": "background-evaluation-stopped",
    "arguments":
    {
        "success": true,
        "cancelled": false
    }
}

start-recording

start-recording starts recording.

Tip.png
Tip: If parameter is not specified in command arguments, current value in user interface will be used.
Parameter NameTypeMandatory /
Optional
Allowed ValuesDescription
Arguments
filePathstringoptionalValid file path

Full path to destination file for recording.

startDelaynumberoptionalInteger number of seconds from 0 to 60

Setting start delay for recording.

Result
Empty result
Events
recording-stopped event is generated when recording is stopped
successbooleanmandatorytrue
false
Success flag. Set to true if background evaluation was completed successfully.
cancelledbooleanmandatorytrue
false
Cancellation flag. Set to true if background evaluation was cancelled by user or due to error.
filePathstringmandatoryValid file path

Full path to destination file.

fileSizenumbermandatoryNon-negative integer Size of the recorded file in bytes.
durationstringmandatoryTimespan value in format
hh:mm:ss.sssssss

Duration of the recording.

frameCountnumbermandatoryNon-negative integer Number of the recorded frames.

EXAMPLE

// Request
{
    "command": "start-recording",
    "arguments": 
    {
        "filePath": "D:\\iPiMocap\\test_record.iPiVideo",
        "startDelay": 1
    }
}
 
// Response
{
    "success": true
}
 
// Event 
{
    "event": "recording-stopped",
    "arguments":
    {
        "success": true,
        "cancelled": false,
        "filePath": "D:\\iPiMocap\\test_record.iPiVideo",
        "fileSize": 39975560,
        "duration": "00:00:04.0155425",
        "frameCount": 197
    }
}

stop-recording

stop-recording command stops recording.

Parameter NameTypeMandatory /
Optional
Allowed ValuesDescription
Arguments
No arguments
Result
Empty result
Events
recording-stopped event is generated when recording is stopped
successbooleanmandatorytrue
false
Success flag. Set to true if background evaluation was completed successfully.
cancelledbooleanmandatorytrue
false
Cancellation flag. Set to true if background evaluation was cancelled by user or due to error.
filePathstringmandatoryValid file path

Full path to destination file.

fileSizenumbermandatoryNon-negative integer Size of the recorded file in bytes.
durationstringmandatoryTimespan value in format
hh:mm:ss.sssssss

Duration of the recording.

frameCountnumbermandatoryNon-negative integer Number of the recorded frames.

EXAMPLE

// Request
{
    "command": "stop-recording"
}
 
// Response
{
    "success": true
}
 
// Event 
{
    "event": "recording-stopped",
    "arguments":
    {
        "success": true,
        "cancelled": false,
        "filePath": "D:\\iPiMocap\\test_record.iPiVideo",
        "fileSize": 39975560,
        "duration": "00:00:04.0155425",
        "frameCount": 197
    }
}

get-devices-state

get-devices-state returns the state and statistics for all selected devices.

Tip.png
Tip: This command is used to make sure recording process is ok. You can use it before and after recording.
Parameter NameTypeMandatory /
Optional
Allowed ValuesDescription
Arguments
No arguments
Result
Array of JSON objects, each representing selected device. Fields of array items:
kindstringmandatorycamera
depth-sensor
microphone
Device type.
modelstringmandatorySupported device model Device model.
idstringmandatoryUnique string, format depends on device model Unique string that is used to identify recording devices in open-recorder command.
selectedbooleanmandatorytrue
false
Device selected status.
failedbooleanmandatorytrue
false
Device failed status.
errorstringoptionalError message string Error message if device is in failed status.
statisticsJSON object
optional

Camera statistics.

frameRatenumbermandatory DoubleAverage frame rate.
frameDropsPerSecondnumbermandatory DoubleAverage frame drops per second.
badFramesPerSecondnumbermandatory DoubleAverage bad frames per second.
totalFrameDropsnumbermandatory IntegerTotal frame drops.
totalBadFramesnumbermandatory IntegerTotal bad frames.

EXAMPLE

// Request
{
    "command": "refresh-device-list"
}
 
// Response
{
    "success":true,
    "result":
    [
        {
            "kind": "camera",
            "model": "PlayStation Eye",
            "id": "\\\\?\\usb#vid_1415&pid_2000&mi_00#7&2ed872d7&0&0000#{4cff9941-d72f-4951-9291-03d8fc97fe30}",
            "selected": true,
            "failed": false,
            "statistics":
            {
                "frameRate": 50.0,
                "frameDropsPerSecond": 0.0,
                "badFramesPerSecond": 0.0,
                "totalFrameDrops": 0,
                "totalBadFrames": 0
            }        
        },
        {
            "kind": "microphone",
            "model": "USB Camera-B4.04.27.1",
            "id": "\\\\?\\usb#vid_1415&pid_2000&mi_00#7&1c1ec232&0&0000#{4cff9941-d72f-4951-9291-03d8fc97fe30}",
            "selected": true,
            "failed": false,
            "statistics":
            {
                "frameRate": 50.0,
                "frameDropsPerSecond": 0.0,
                "badFramesPerSecond": 0.0,
                "totalFrameDrops": 0,
                "totalBadFrames": 0
            }        
        }
    ]
}

get-recorder-props

get-recorder-props command gets current properties for setup, background and recording stages specified in user interface.

Parameter NameTypeMandatory /
Optional
Allowed ValuesDescription
Arguments
No arguments
Result
Properties for SETUP Stage:
videoModestringmandatory

Available modes depend on camera model.

Selected RGB video mode.

videoModeListstring arraymandatory

List of available modes depend on camera model.

Possible videoMode values.

audioModestringoptional

Available modes depend on microphone model.

Selected audio mode. This field is included into the response, if microphone is selected.

audeoModeListstring arrayoptional

List of available modes depend on microphone model.

Possible audioMode values. This field is included into the response, if microphone selected.

globalDevicePropsJSON object
optional

Device-specific list of properties visible in “SHARED SETTINGS” section of SETUP stage.

PlayStation Eye: Darkening for Calibrationstringoptional "None"
"Darkening"
"Extra Darkening"

Selected darkening mode for Sony PS3 Eye cameras. This field is included into the response, if Sony PS3 Eye camera is selected.

PlayStation Eye: Darkening for Calibration/Liststring arrayoptional List of available modes

Available darkening modes for Sony PS3 Eye cameras. This field is included into the response, if Sony PS3 Eye camera is selected.

screensInRownumbermandatoryInteger from 1 to number of cameras

Selected number of screens in a row for multiple camera video view.

screenLayoutstringmandatory

For RGB cameras:
"Color"

For depth sensors:
"Depth"
"Picture in picture"
"Side by side"

Selected screen layout.

screenLayoutListstring arraymandatory Available screenLayout modes.Available screen layout modes. Depend on type of selected cameras.
Properties for BACKGROUND Stage:
backgroundEvaluationDurationnumbermandatoryInteger number of seconds from 2 to 10

Selected duration of background evaluation.

backgroundEvaluationStartDelaynumbermandatoryInteger number of seconds from 0 to 30

Selected start delay for background evaluation.

showEvaluatedBackgroundbooleanmandatorytrue
false

Selected show background mode.

Properties for RECORD Stage:
recordingStartDelaynumbermandatoryInteger number of seconds from 0 to 60

Selected start delay for recording.

hideBackgroundWhenRecordingbooleanmandatorytrue
false

Selected hide background mode.

destinationFilePathstringmandatory

Valid file path

Selected full path to destination file for recording.

colorCompressionstringmandatory

"None"
"Background subtraction"
"JPEG"

Selected RGB video compression mode.

jpegQualitynumbermandatoryinteger from 0 to 100

Selected JPEG quality for JPEG compression.

depthCompressionstringmandatory"None"
"Background subtraction"

Selected depth compression mode.

Result
Empty result

EXAMPLE

// Request
{
    "command": "get-recorder-props"
}
 
// Response
{
    "success": true,
    "result":
    {
        "videoMode": "640x480 color @ 50Hz",
        "videoModeList":
        [
            "640x480 color @ 60Hz",
            "640x480 color @ 50Hz",
            "640x480 color @ 40Hz",
            "640x480 color @ 30Hz",
            "640x480 color @ 25Hz",
            "320x240 color @ 60Hz",
            "320x240 color @ 50Hz",
            "320x240 color @ 37Hz",
            "320x240 color @ 30Hz"
        ],
        "screensInRow": 1,
        "screenLayout": "Color",
        "screenLayoutList":
        [
            "Color"
        ],
        "globalDeviceProps":
        {
            "PlayStation Eye: Darkening for Calibration": "None",
            "PlayStation Eye: Darkening for Calibration/List":
            [
                "None",
                "Darkening",
                "Extra Darkening"
            ]
        },
        "backgroundEvaluationStartDelay": 5,
        "backgroundEvaluationDuration": 2,
        "showEvaluatedBackground": false,
        "recordingStartDelay": 1,
        "hideBackgroundWhenRecording": true,
        "destinationFilePath": "D:\\iPiMocap\\<time stamp>.iPiVideo",
        "colorCompression": "Jpeg",
        "jpegQuality": 100,
        "depthCompression": "BackgroundSubtraction"
    }
 
}

set-recorder-props

set-recorder-props command sets properties for setup, background and recording stages.

Tip.png
Tip: If property is not specified in command arguments, current value in user interface will be used.
Parameter NameTypeMandatory /
Optional
Allowed ValuesDescription
Arguments
Properties for SETUP Stage:
videoModestringoptional

Available modes depend on camera model.

Setting RGB video mode. You can see available modes in "Video Mode" combobox at SETUP stage, or get it in the result of get-recorder-props command.

audioModestringoptional

Available modes depend on microphone model.

Setting audio mode. You can see available modes in "Audio Mode" combobox at SETUP stage, or get it in the result of get-recorder-props command.

globalDevicePropsJSON object
optional

Device-specific list of properties visible in “SHARED SETTINGS” section of SETUP stage.

PlayStation Eye: Darkening for Calibrationstringoptional "None"
"Darkening"
"Extra Darkening"

Darkening mode for Sony PS3 Eye cameras

screensInRownumberoptionalInteger from 1 to number of cameras

Setting number of screens in a row for multiple camera video view.

screenLayoutstringoptional

For RGB cameras:
"Color"

For depth sensors:
"Depth"
"Picture in picture"
"Side by side"

Setting screen layout.

Properties for BACKGROUND Stage:
backgroundEvaluationDurationnumberoptionalInteger number of seconds from 2 to 10

Setting duration of background evaluation.

backgroundEvaluationStartDelaynumberoptionalInteger number of seconds from 0 to 30

Setting start delay for background evaluation.

showEvaluatedBackgroundbooleanoptionaltrue
false

Show background mode on / off.

Properties for RECORD Stage:
recordingStartDelaynumberoptionalInteger number of seconds from 0 to 60

Setting start delay for recording.

hideBackgroundWhenRecordingbooleanoptionaltrue
false

Show hide background mode on / off.

destinationFilePathstringoptional

Valid file path

Full path to destination file for recording.

colorCompressionstringoptional

"None"
"Background subtraction"
"JPEG"

Setting RGB video compression mode.

jpegQualitynumberoptionalinteger from 0 to 100

JPEG quality for JPEG compression.

depthCompressionstringoptional"None"
"Background subtraction"

Setting depth compression mode.

Result
Empty result

EXAMPLE

// Request
{
    "command": "set-recorder-props",
    "arguments":
    {
        "colorCompression": "jpeg",
	"globalDeviceProps":
        {
	    "PlayStation Eye: Darkening for calibration":"None"
        },
    "hideBackgroundWhenRecording": true,
    "recordingStartDelay": 0,
    "videoMode": "640x480 color @ 50Hz"
    }
}
 
// Response
{
    "success": true
}

Player Commands

set-player-props

set-player-props command sets properties for player.

Tip.png
Tip: If property is not specified in command arguments, current value in user interface will be used.
Parameter NameTypeMandatory /
Optional
Allowed ValuesDescription
Arguments
screensInRownumberoptionalInteger from 1 to number of cameras

Setting number of screens in a row for multiple camera video view.

hideBackgroundbooleanoptionaltrue
false

Turn hide background mode on / off.

Result
Empty result

EXAMPLE

// Request
{
    "command": "set-player-props",
    "arguments":
    {
        "screensInRow": 2,
	"hideBackground": true
    }
}
 
// Response
{
    "success": true
}

open-player

open-player command opens .iPiVideo file in player.

Parameter NameTypeMandatory /
Optional
Allowed ValuesDescription
Arguments
filePathstringmandatoryValid file path

Full path to file to be opened in player.

Result
Empty result

EXAMPLE

// Request
{
    "command": "open-player",
    "arguments": 
    {
        "filePath": "D:\\iPiMocap\\test_record.iPiVideo"
    }
}
 
// Response
{
    "success": true
}

play-forward

play-forward starts playing video forward starting from the current frame. If current frame is the last frame playing starts from the first frame.

Parameter NameTypeMandatory /
Optional
Allowed ValuesDescription
Arguments
No arguments
Result
Empty result
playing-stopped event is generated when playing is competed (reached the last frame) or stopped by user
No event arguments

EXAMPLE

// Request
{
    "command": "play-forward"
}
 
// Response
{
    "success": true
}

play-backward

play-backward starts playing video backward starting from the current frame. If current frame is the first frame playing starts from the last frame.

Parameter NameTypeMandatory /
Optional
Allowed ValuesDescription
Arguments
No arguments
Result
Empty result
playing-stopped event is generated when playing is competed (reached the first frame) or stopped by user
No event arguments

EXAMPLE

// Request
{
    "command": "play-backward"
}
 
// Response
{
    "success": true
}

frame-forward

frame-forward steps one frame forward. If current frame is the last frame error message returned.

Parameter NameTypeMandatory /
Optional
Allowed ValuesDescription
Arguments
No arguments
Result
Empty result

EXAMPLE

// Request
{
    "command": "frame-forward"
}
 
// Response
{
    "success": true,
    "error": "Last frame reached"
}

frame-backward

frame-backward steps one frame backward. If current frame is the first frame error message returned.

Parameter NameTypeMandatory /
Optional
Allowed ValuesDescription
Arguments
No arguments
Result
Empty result

EXAMPLE

// Request
{
    "command": "frame-backward"
}
 
// Response
{
    "success": true,
    "error": "First frame reached"
}

go-to-frame

go-to-frame command selects current frame. If case of invalid frame index error message returned.

Parameter NameTypeMandatory /
Optional
Allowed ValuesDescription
Arguments
frameIndexnumbermandatoryNon-negative integer

Frame index. The first frame index is 0, the last frame index is <total_number_of_frames> - 1.

Result
Empty result

EXAMPLE

// Request
{
    "command": "go-to-frame",
    "arguments": 
    {
        "frameIndex": 27
    }
}
 
// Response
{
    "success": true
}