Documente Academic
Documente Profesional
Documente Cultură
v1.1.2
20/07/2016
SUMMARY
MANUFACTURERGUIDE
Introduction&Feedback
Overview
Discovery
OSCProtocol
a.info
b.state
c.commands
ErrorHandling
APISPECIFICATION
Overview
Commands
I.System&Connection
a.camera.startSession
b.camera.closeSession
c.camera.updateSession
d.camera.wifiMode
II.Recording&Shooting
a.camera.takePicture
b.camera._startRecording
c.camera._stopRecording
d.paramState
III.Navigate&GetInformation
a.camera._getAttributes
b.camera._listDirectory
c.camera._getStreamUrl
IV.Read,Edit&Delete
a.camera._readFile
b.camera._writeFile(unactive)
c.camera.delete
V.MetadataCommands
a.camera.getMetadata
b.camera._setMetadata
c.camera._patchMetadata
VI.ImageCommands
a.camera.getImage
b.camera._getImagePreview
c.camera.listImages
VII.Get&SetOptions
a.camera.getOptions
Giroptic360camOSC1
b.camera.setOptions
c.Options
d.Appendix
RevisionHistory
Giroptic360camOSC2
MANUFACTURERGUIDE
Giroptic360camOSC3
Introduction&Feedback
Welcome to the Giroptic Open Spherical Camera API. Your feedback helps us shape the
development of the API. This preview includes the Manufacturer Guide and API Specification.
DownloadPDFsofthelatestrevisionofbothdocumentsatthelinksbelow:
http://dev.360.tv/
We look forward to hearing your feedback on how we can improve the OSCAPI Specification and
Manufacturer Guide. Whetheryou'veencounteredengineeringpainpoints,confusingdocumentation,
or unexpected behavior, please let us know. Send any questions or comments you may have to
contact@giroptic.com
Overview
This guideprovidessphericalcameraAPIimplementationguidancetomanufacturersofcameraswith
built
inwifi.PleaserefertoOSCAPISpecificationforthefullsetofcommands.
Giroptic360camOSC4
Discovery
SSIDandpasswordSSIDformat:
[Cameraname].OSC
ThewifiSSID shall start with a human
readablename (up to 20 characters),followingbydelimiter.
and OSC (OSC stands for Open Spherical Camera, the protocol used for communications
between clientsandcameras).Thecameranamecontainsmanufacturerselecteduserfriendlyname.
It is HIGHLY RECOMMENDED
to add some entropy to the end of the name to prevent name
collisions. For example, VendorCamera123.OSC, where 123is usedto differentiatebetween the
sametypeofcamerasnearby.
ThewifiMUST
beprotected with WPA2
PSK.The wifi password MUST
be at least 8characterslong
anditcancontainletters,numbers,symbols,butnospaces.Itcanbechangedonlywhenthecamera
is connected to the phone. Once it is changed, the camera will be disconnected and needs to be
reconnectedusingthenewpassword.
ThecameraMUST
provideareset mechanism in case the password isforgotten,e.g.aresetbutton
inthecameratorestorethedefaultpassword.
IPaddressandport:
ThecamerasIPaddress canbeobtained from thewificonnectionontheclientside.Forport,please
usedefaultport80forHTTP(portforupdatecanbeobtainedfromendpointsin/osc/info).
Giroptic360camOSC5
OSCProtocol
Giroptic360camOSC6
a.info
Description
The/osc/infoAPIreturnsbasicinformationaboutthecameraandfunctionalityitsupports.
Input
Noinput.
Output
Name
Type
Description
manufacturer
String
Thecameramanufacturer.
model
String
Thecameramodel.
description
String
Descriptionofthecameramodel.
serialNumber
String
Serialnumber.
firmwareVersion
String
Currentfirmwareversion.
hardwareVersion
String
Currenthardwareversion.
supportUrl
String
URLforthecamerassupportwebpage.
gps
Boolean
TrueifthecamerahasGPS.
gyro
Boolean
Trueifthecamerahasgyroscope.
uptime
Integer
Numberofsecondssincethecameraboot.
api
StringArray ListofsupportedAPIs.
endpoints
Object
_vendorSpecific
[type]
(optional)
Detailsaboutthecamerasendpointsdescribedbelow.
Vendorspecificadditionalinfoaboutthecamera.
endpoints
:
isaJSONobjectcontaininginformationaboutthecamerasendpoints.
Name
Type
Description
httpPort
Integer
PortforHTTPserver.(Default80)
httpUpdatesPort
Integer
PorttoreceiveupdatesoverHTTP.
httpsPort
(Optional)
Integer
PortforHTTPsserver.(Default443)
Giroptic360camOSC7
httpsUpdatesPort
(Optional)
Integer
PorttoreceiveupdatesoverHTTPs.
Errors
Noerrors
Input&OutputExample
RequestInput
OutputResponse
{
"
manufacturer
":"XXXX",
"
model
":"XXXX",
"
description
":"XXXX",
"
serialNumber
":"XXXX",
"
firmwareVersion
":"XXXX",
"
hardwareVersion
":"XXXX",
"
supportUrl
":"XXXX",
"
gps
":XXXX,
"
gyro
":XXXX,
"
uptime
":XX,
"
api
":[
"/osc/info",
"/osc/state",
"/osc/checkForUpdates",
"/osc/commands/execute",
"/osc/commands/status"
],
"
endpoints
":{
"
httpPort
":XX,
"
httpUpdatesPort
":XX,
},
}
cURLExample
curlXGETH"contenttype:application/json"http://192.168.1.168/osc/info
Giroptic360camOSC8
b.state
Description
The /osc/state API returns state ofthecamera.The differencebetween this andtheinfoAPI is that
the state contains mutable parameters that wed like to be notified about the camera, (e.g. battery
level),while the info onlycontains static attributes ofthecamera (e.g. manufacturer orattributesthat
dontchangeoftenlikefirmwareversion).
Input
Noinput.
Output
Name
Type
Description
fingerprint
String
Fingerprint(uniqueidentifier)ofthecurrentcamerastate.
state
Object
state:
isaJSONobjectcontaininginformationaboutthecamerastate.
Name
Type
Description
sessionId
String
IDofthecurrentsession.Onlyavailableifasessionisstart.
sessionTimeout
Integer
Remainingtimeofthecurrentsession.
_cameraState
String
"idle
"
"busy
"
"setting"or
"error
".
batteryLevel
Number
storageChanged
Boolean
TotalSpace
Integer
TotalavailablespaceinbytesonSDcard
remainingSpace
Integer
RemainingspaceinbytesonSDcard
remainingPictures
Integer
Remainingpicturescountavailabletocapturefor
image/burst/timelapsemodes
remainingVideo
Integer
Remainingrecordtimeavailableinsecondsforvideomode
Giroptic360camOSC9
_vendorSpecific
[type]
(optional)
Vendorspecificadditionalstateaboutthecamera.
Errors
Noerrors
Example
InputRequest
OutputResponse
{
"
fingerprint
":"XXXXXX",
"
state
":{
"
sessionId
":"XXXXXX",
"
sessionTimeout
":XX,
"
sessionExclusive
":XXXX,
"
_cameraState
":
"XXXX
",
"
batteryLevel
":XX,
"
totalSpace
":XX,
"
remaining
Space
":XX,
...
}
}
cURLExample
curlXGETH"contenttype:application/json"http://192.168.1.168/osc/state
Giroptic360camOSC10
c.commands
Description
ThecommandsAPIexecutesspecifiedcommandsonthecameraandchecksthestatus(in
progress,
doneetc.)of executed commands.Allcommandsneedtobeimplementedbasedonthespecification
intheOSCAPISpecification.
Note:
Afteracommandreturnsstatedoneandresults,orerrorstate,
thecameramayforgetaboutcommandID.
Responsetocommandcamera.getImage
needstobeContent
Type:
image/jpeg
whenthestateisdone.
Execute
The /osc/commands/execute API executes specified commands on the camera. The output is a
commandobject.
Input
Name
Type
Description
name
String
Nameofthecommandtobeexecuted.
parameters
Object
Name
Type
Description
name
String
Nameofthecommand(sameasininput).
state
String
Stateofthecommand.Couldbeoneofthefollowing:
"
done
"
commandiscomplete,resultshasbeen
returnedinthisresponse
"
inProgress
"
commandexecutionisstillinprogress
"
error
"
commandhasfailed,seeerrorintheresponse
id
(Optional)
String
Output
Giroptic360camOSC11
results
(Optional)
Object
results
:
{
AAA
:BBB,
...
}.
PleaserefertoOSCAPISpecificationforexamples.
error
(Optional)
Object
error
:
{
code
:badSessionId
}
progress
(Optional)
Object
completion
:X.X
}
Errors
ErrorCode
unknownCommand
cameraInExclusiveUse
missingParameter
Description
Commandexecutedisunknown.
Cameraisalreadyinexclusiveuse,newsessioncantbestarted.
Anyrequiredparameterisnotspecified.
invalidParameterName
Anyinputparameteroroptionnameisunrecognizedorsupported.
invalidParameterValue
Giroptic360camOSC12
Input&OutputExample
InputRequest
{
"
parameters
":{
"
sessionId
":
"XXXXXX",
"
timeout
":XX
}
}
OutputResponse
{
"
results
":{
"
sessionId
":"XXXXXX",
"
timeout
":XX
}
}
ErrorOutput
{
"
error
":{
"
code
":
"invalidParameterName",
"
message
":"parameter
sessionIdismissing"
}
}
cURLExample
curl X POST H "contenttype: application/json" http://192.168.1.168/osc/commands/execute d '{"name":
"camera.updateSession","parameters":{"sessionId":"XXXXXXXXXX","timeout":XX}}'
Giroptic360camOSC13
ErrorHandling
Pleaseusethe"200OK"statuscode forallerrorsdefinedinthisspecification.Forallothererrors,the
choice ofstatus code (e.g. 400or500) is atthe discretionofthemanufacturer.Theresponseshould
alwaysincludeaJSONbodyinthefollowingformatfor
ANY
errorcase:
{
"
name
":"camera.info",
"
state
":"error",
"
error
":{
"
code
":"serverError",
"
message
":"cannotgetcamerainfo."
}
}
messageisdefinedbymanufacturersandisnotexpectedtobealocalizedmessage.
Giroptic360camOSC14
APISPECIFICATION
Giroptic360camOSC15
Overview
Commands
Giroptic360camOSC16
I.System&Connection
Giroptic360camOSC17
a.camera.startSession
Description
Startsasession thattimesout after a fixedinterval.Locksthecameratotherequestingclient,
andmakessurethecamerastayawake.
CommandParameters
Parameters
timeout
(optional)
Type
int
Description
PossibleInput
Requestedsessiontimeoutinseconds.
Ifnot omitted, the serverisresponsible
fordeterminingareasonabletimeout.
[0+
Results
Results
Errors
sessionId
:Unique identifierto beusedforthis cameraInExclusiveUse
: camera is alreadyin
session.
exclusiveuse,newsessioncantbestarted.
timeout
:Responded
invalidParameterValue
: any input parameter
Input&Output
CommandInput
{
"
parameters
":{
"
timeout
":XX
}
}
CommandOutput
{
"
results
":{
"
sessionId
":"XXXXX",
"
timeout
":XX
}
}
OutputError
{
"
error
":{
"
code
":
"cameraInExclusiveUse",
"
message
":"camera
alreadyinexclusiveuse"
}
}
cURLExample
curl X POST H "contenttype: application/json" http://192.168.1.168/osc/commands/execute d '{"name":
"camera.startSession","parameters":{"timeout":XX}}'
Giroptic360camOSC18
b.camera.closeSession
Description
Disconnectsfromcamera
.
CommandParameters
Parameters
sessionId
Type
Description
String
PossibleInput
Uniquesession identifierobtainedfrom
thecamera.startSessioncommand.
Composedby10
characters.
Results
Results
Errors
Thiscommandreturnsnoresult.
missingParameter
: any required parameter is
notspecified,e.g.sessionIdisnotspecified.
invalidParameterName
: any input parameter
isunrecognized.
invalidParameterValue
: any input parameter
Input&Output
CommandInput
{
"
parameters
":{
"
sessionId
":"XXXXXX"
}
}
CommandOutput
OutputError
{
"
error
":{
"
code
":
"invalidParameterValue",
"
message
":
"parameter
sessionIdisincorrecttype"
}
}
cURLExample
curl X POST H "contenttype: application/json" http://192.168.1.168/osc/commands/execute d '{"name":
"camera.closeSession","parameters":{"sessionId":"XXXXXXXXXX"}}'
Giroptic360camOSC19
c.camera.updateSession
Description
Refreshesthesessiontimeout.
CommandParameters
Parameters
Type
sessionId
String
timeout
(optional)
int
Description
PossibleInput
Uniquesessionidentifier.
Composedby10
characters.
Requestedsessiontimeoutinseconds.
If it is omitted (HTTP request has no
body), the server is responsible for
determiningareasonabletimeout.
[0+
Results
Results
Errors
sessionId
:Unique identifierto beusedforthis missingParameter
session.
notspecified,e.g.sessionIdisnotspecified.
timeout
:Responded
invalidParameterValue
: any input parameter
Input&Output
CommandInput
{
"
parameters
":{
"
sessionId
":"XXXXXX",
"
timeout
":XX
}
}
CommandOutput
{
"
results
":{
"
sessionId
":"XXXXXX",
"
timeout
":XX
}
}
OutputError
{
"
error
":{
"
code
":
"invalidParameterName",
"
message
":
"parameter
sessionIdismissing"
}
}
Giroptic360camOSC20
cURLExample
curl X POST H "contenttype: application/json" http://192.168.1.168/osc/commands/execute d '{"name":
"camera.updateSession","parameters":{"sessionId":"XXXXXXXXXX","timeout":XX}}'
Giroptic360camOSC21
d.camera.wifiMode
Description
Sets the wifi mode of the camera. Options are APP mode, LAN mode, or OFF. Before
changing the mode, current session is closed. If the requested mode correspond to the wifi mode
configuredonthecamera,nothinghappen.
CommandParameters
Parameters
Type
Description
PossibleInput
sessionId
String
mode
String
Requestedwifimode
Composedby10
characters
LAN:Stationmode
direct:AccessPoint
mode
OFF:wifioff
Results
Results
Errors
Thiscommandreturnnoresult.
invalidParameterName
: any input parameter
isunrecognized.
invalidParameterValue
: any input parameter
invalidOperation
: wifiMode command isnt
availablewhencameraisonPoEmode
Input&Output
CommandInput
{
"
parameters
":{
"
sessionId
":"XXXXX",
"
mode
":XXXXX
}
}
CommandOutput
OutputError
{
"
error
":{
"
code
":
"invalidParameterName",
"
message
":
"parameter
sessionIdismissing"
}
}
Giroptic360camOSC22
cURLExample
curl X POST H "contenttype: application/json" http://192.168.1.168/osc/commands/execute d '{"name":
"camera.wifiMode","parameters":{"sessionId":"XXXXXXXXXX","mode":"LAN"}}'
Giroptic360camOSC23
II.Recording&Shooting
Giroptic360camOSC24
a.camera.takePicture
Description
Captures equirectangular images when the captureMode option is specified as image or
_burst,savinglat/longcoordinatestoEXIF(ifyourcameraGPSisenabled).
CommandParameters
Parameters
sessionId
Type
String
Description
PossibleInput
Uniquesession identifierobtainedfrom
thecamera.startSessioncommand.
Composedby10
characters.
Results
Results
Errors
fileUri:
URLofthepicturetaken.
missingParameter
: any required parameter is
notspecified,e.g.sessionIdisnotspecified.
invalidParameterName
: any input parameter
isunrecognized.
invalidParameterValue
: any input parameter
Input&Output
CommandInput
{
"
parameters
":{
"
sessionId
":"XXXXXX"
}
}
CommandOutput
{
"
results
":{
"
fileUri
":"fileURI"
}
}
OutputError
{
"
error
":{
"
code
":
"invalidParameterValue",
"
message
": "not available
onthiscaptureMode"
}
}
cURLExample
curl X POST H "contenttype: application/json" http://192.168.1.168/osc/commands/execute d '{"name":
"camera.takePicture","parameters":{"sessionId":"XXXXXXXXXX"}}'
Giroptic360camOSC25
b.camera._startRecording
Description
Starts recording video when the captureMode option is specified as _video. When the
cameracaptureModehasbeensetto_timelapse,beginscapturingpictures.
CommandParameters
Parameters
sessionId
Type
Description
String
PossibleInput
Uniquesession identifierobtainedfrom
thecamera.startSessioncommand.
Composedby10
characters.
Results
Results
Errors
Thiscommandreturnsnoresult.
missingParameter
: any required parameter is
notspecified,e.g.sessionIdisnotspecified.
invalidParameterName
: any input parameter
isunrecognized.
invalidParameterValue
: any input parameter
Input&Output
CommandInput
{
"
parameters
":{
"
sessionId
":"XXXXXX"
}
}
CommandOutput
OutputError
{
"
error
":{
"
code
":
"invalidParameterValue",
"
message
": "sessionIdtype
isinvalid"
}
}
Giroptic360camOSC26
cURLExample
curl X POST H "contenttype: application/json" http://192.168.1.168/osc/commands/execute d '{"name":
"camera._startRecording","parameters":{"sessionId":"XXXXXXXXXX"}}'
Giroptic360camOSC27
c.camera._stopRecording
Description
Ends recording video whenthecaptureModeoptionisspecifiedas _video.Whenthecamera
captureModehasbeensetto_timelapse,endscapturingpictures.
CommandParameters
Parameters
sessionId
Type
Description
String
PossibleInput
Uniquesession identifierobtainedfrom
thecamera.startSessioncommand.
Composedby10
characters.
Results
Results
Errors
taken.
notspecified,e.g.sessionIdisnotspecified.
invalidParameterName
: any input parameter
isunrecognized.
invalidParameterValue
: any input parameter
Input&Output
CommandInput
{
"
parameters
":{
"
sessionId
":"XXXXXX"
}
}
CommandOutput
{
"
results
":{
}
}
"
fileUri
":"fileURI"
OutputError
{
"
error
":{
"
code
":
"invalidParameterValue",
"
message
": "Camera is
busy"
}
}
Giroptic360camOSC28
cURLExample
curl X POST H "contenttype: application/json" http://192.168.1.168/osc/commands/execute d '{"name":
"camera._stopRecording","parameters":{"sessionId":"XXXXXXXXXX"}}'
Giroptic360camOSC29
d.paramState
Description
This isthe camera serverpushcommand. Using thistechniquetheconnectionisheldopened
and new pieces of information can be pushed over that existing connection, from server to client,
withoutthe connection being closedand reopened as it iswith HTTP LongPolling. Theclientcan
thenrefreshinformationwheneverthereisachangeontheserver.
Input
Noinput
Output
Name
Type
Description
recordStatus
boolean
Indicatesifthecameraisinrecording/takepicturestate.
timelapseRecorded
Pictures
number
convStatus
boolean
alertBatteryLevel
boolean
Indicatesthatthecameraisinlowbatterylevel(level<10%)
changingMode
object
powerDownStatus
boolean
switchToCaptureMode
: A string representing the
new capturemodeto which the camerachanges.List
of capture mode: [_video, image, _burst,
_timelapse, _setting, _live] . Not available when
changingFlagisfalse.
Indicatesifthecameraisshuttingdown
Errors
Noerrors
Giroptic360camOSC30
Example
InputRequest
OutputResponse
{
"
recordStatus
":false,
"
timelapseRecordedPictures
":0,
"
convStatus
":false
cURLExample
curlXGETH"contenttype:application/json"http://192.168.1.168/osc/paramState
III.Navigate&GetInformation
Giroptic360camOSC31
a.camera._getAttributes
Description
Fetchesattributes/metadataoftheentityinthefilesystem
.
CommandParameters
Parameters
fileUri
Type
String
Description
PossibleInput
Pathofafileentrytogetattributesfor
"
mnt/mmc/DCIM/360C
AM01/
"
Results
Results
Errors
entry
:filesystementryobjectwhichcontentis: missingParameter
: any required parameter is
name
:nameoftheentryobject
notspecified,e.g.sessionIdisnotspecified.
kind
:fileordirectory
isLink
:istheentryobjectasymboliclinkornot
modificationTimeMs :timestampof entrymodification
time
sizeBytes
:sizeinbytes
videoDuration : if entry is a video file, duration in
seconds
videoWidth
:ifentryisavideofile,widthinpixels
videoHeight
:ifentryisavideofile,heightinpixels
invalidParameterName
: any input parameter
isunrecognized.
invalidParameterValue
: any input parameter
Input&Output
CommandInput
{
"
parameters
":{
"
fileUri
":"fileURI"
}
}
CommandOutput
{
"
results
":{
"
entry
":{
"
name
":
"360_XXXX.JPG",
"
kind
":"file",
"
isLink
":false,
"
modificatioTimeMs
"
:XXXXXXX,
"
sizeBytes
":XXX
}
}
}
OutputError
{
"
error
":{
"
code
":
"invalidParameterValue",
"
message
":
"permissionDeniedorbadUri"
}
}
Giroptic360camOSC32
cURLExample
curl X POST H "contenttype: application/json" http://192.168.1.168/osc/commands/execute d '{"name":
"camera._getAttributes","parameters":{"fileUri
":"/mnt/mmc/DCIM/360CAM01/360_XXXX.JPG"}}'
Giroptic360camOSC33
b.camera._listDirectory
Description
Lists content of a single directory. Thecontent are returned in theorder of modificationtime,
newestfirst.
CommandParameters
Parameters
Type
Description
PossibleInput
fileUri
String
Absolutepathofthedirectorytolist.
entryCount
int
Desirednumberofentriestoreturn.
continuationToken
String
"
mnt/mmc/DCIM/360C
AM01/
"
[0+
]
Composedby10
characters.
Results
Results
entries
:listofentrieswhichcontentis:
name
:nameoftheentryobject
kind
:fileordirectory
isLink
:istheentryobjectasymboliclinkornot
modificationTimeMs :timestampof entrymodification
time
sizeBytes
:sizeinbytes
videoDuration : if entry is a video file, duration in
seconds
videoWidth
:ifentryisavideofile,widthinpixels
videoHeight
:ifentryisavideofile,heightinpixels
Errors
missingParameter
: any required parameter is
notspecified,e.g.sessionIdisnotspecified.
invalidParameterName
: any input parameter
isunrecognized.
invalidParameterValue
: any input parameter
totalEntries
:totalnumberofentriestoreturn.
continuationToken
: it is set only if result is
complete. If the clientwishesto fetchremaining
entries, it should do another
"
_listDirectory
"
commandwithtokenset.
Giroptic360camOSC34
Giroptic360camOSC35
Input&Output
CommandInput
CommandOutput
{
{
"
parameters
":{
"
results
":{
"
fileUri
":"fileURI",
"
entries
":[
"
entryCount
":XX,
{
"
continuationToken
":
"
name
":
"XXXXXX"
"360_XXXX.JPG",
}
"
kind
":"file",
}
"
isLink
":false,
"
modificatioTimeMs
":
XXXXXX,
"
sizeBytes
":XXX
},
{
"
name
":"subdir",
"kind":"
directory
",
"
isLink
":true,
"
modificationTimeMs
"
:XXXXXX,
}
]
"
totalEntries
":XX,
"
continuationToken
":
"XXXXXX"
}
}
OutputError31
{
"
error
":{
"
code
":
"invalidParameterName",
"
message
": "entryCount
parameterisunrecognized"
}
}
cURLExample
curl X POST H "contenttype: application/json" http://192.168.1.168/osc/commands/execute d '{"name":
"camera._listDirectory","parameters":{"fileUri":"/mnt/mmc/DCIM/360CAM01","entryCount":XX}}'
Giroptic360camOSC36
c.camera._getStreamUrl
Description
Gets network streaming (rtsp) URL from camera. This stream can be the main or preview
streamifsupported.
CommandParameters
Parameters
Type
Description
PossibleInput
sessionId
String
Uniquesession identifierobtainedfrom
thecamera.startSessioncommand.
type
String
Streamtype.
protocol
String
Streamprotocol
userName
String
UserIDforlivestreamauthentication
password
String
Userpasswordforlivestream
authentication
Composedby10
characters.
"
main
"
or
"
preview
"
"
rtsp
"
or
"
rtmp
"
"360camxxx"
"giroptic"
Note: userName and password options are needed(if defined)onPoEor BulBextension mode.
Theymustbedefinedwiththecommand:
camera.setLiveStreamAuthentication
Formoreinformation,refertothisdoc:
https://docs.google.com/document/d/1ws9hNFCmY9AO59pByQnyFbUevyrl4TrZ9HGgBGElAk/edit
Results
Results
url
:networkstreamURL.
Errors
missingParameter
: any required parameter is
notspecified,e.g.sessionIdisnotspecified.
invalidParameterName
: any input parameter
isunrecognized.
invalidParameterValue
: any input parameter
Giroptic360camOSC37
Input&Output
CommandInput
{
"
parameters
":{
"
sessionId
":"XXXXXX",
"
type
":"streamtype",
"
protocol
":"streamprotocol"
}
}
CommandOutput
{
"
results
":{
"
url
":"streamURL"
}
}
OutputError
{
"
error
":{
"
code
":
"invalidParameterName",
"
message
":
"input
parameterisunrecognized"
}
}
cURLExample
curl X POST H "contenttype: application/json" http://192.168.1.168/osc/commands/execute d '{"name":
"camera._getStreamUrl", "parameters": {"sessionId": "XXXXXXXXXX", "type": "XXXX", "protocol":
"XXXX"}}'
Giroptic360camOSC38
IV.Read,Edit&Delete
Giroptic360camOSC39
a.camera._readFile
Description
Reads content of a file, by default it reads the wholecontent,but user might chooseto read
onlyaparticularrange.
CommandParameters
Parameters
Type
Description
PossibleInput
fileUri
String
Pathofthefiletoread.
"
mnt/mmc/DCIM/360C
AM01/
"
range
(Optional)
Object
range
:{
firstByte
:XX,
lastByte
:XX
}
format
(Optional)
String
"
base64"or"blob
"
Results
Results
Errors
content
:content of thefilereturnedasbase64 missingParameter
: any required parameter is
invalidParameterValue
: any input parameter
Giroptic360camOSC40
Input&Output
CommandInput
{
"
parameters
":{
"
fileUri
":"fileURI",
"
range
":{
"firstByte":XX,
"lastByte":XX
},
"
format
":"XXXX"
}
}
CommandOutput
{
"
results
":{
"
content
":
content"
}
}
OutputError
{
"
error
":{
"format
"
code
":
"invalidParameterValue",
"
message
": "range input
parametersareincorrecttype"
}
}
cURLExample
curl X POST H "contenttype: application/json" http://192.168.1.168/osc/commands/execute d '{"name":
"camera._readFile","parameters":{"fileUri":"/mnt/mmc/DCIM/360CAM01/360_XXXX.JPG"}}'
Giroptic360camOSC41
b.camera._writeFile(unactive)
Description
Writescontentintoafile,italsocancreatethefileifitdoesntexistyet.
CommandParameters
Parameters
Type
Description
PossibleInput
fileUri
String
Absolutepathofthefiletobewritten.
writeMode
String
Writecanhavethefollowingvalue:
"append"or"overwrite"
"append"
: the given content is
appendedtheendofthefile
"overwrite"
: given content
replace the current content of
thefile
mustNotExist
(optional)
content
"
mnt/mmc/DCIM/360C
AM01/
"
'
true
'
or
'
false
'
ContenttobewritteninBase64format.
Note
:
TherequestContentLength(fromrequestheader)
mustnotexceed1500Kbytessize.
Results
Results
Commanddoesnthaveanyresult.
Errors
missingParameter
: any required parameter is
notspecified,e.g.sessionIdisnotspecified.
invalidParameterName
: any input parameter
isunrecognized.
invalidParameterValue
: any input parameter
Giroptic360camOSC42
Input&Output
CommandInput
{
"
parameters
":{
"
fileUri
":
"/mnt/mmc/file.txt",
"
content
":"AABBCC",
"
writeMode
":"overwrite",
"
mustNotExist
":false
}
}
CommandOutput
OutputError
{
"
error
":{
"
code
":
"invalidParameterValue",
"
message
": "internalserver
error"
}
}
cURLExample
curl X POST H "contenttype: application/json" http://192.168.1.168/osc/commands/execute d '{"name":
"camera._writeFile", "parameters": {"fileUri": "/mnt/mmc/DCIM/360CAM01/360_XXXX.JPG", "writeMode":
"overwrite","content":"AABBCCDDEEaabbccdd1234"}}'
Giroptic360camOSC43
c.camera.delete
Description
Deletesasinglefileordirectory.
CommandParameters
Parameters
fileUri
recursive
Type
String
Description
PossibleInput
'
true
'
or
'
false
'
Results
Results
Commanddoesnthaveanyresult.
Errors
missingParameter
: any required parameter is
notspecified,e.g.sessionIdisnotspecified.
invalidParameterName
: any input parameter
isunrecognized.
invalidParameterValue
: any input parameter
unauthorizedCommand
Giroptic360camOSC44
Input&Output
CommandInput
{
"
parameters
":{
"
fileUri
":"fileURI"
}
}
CommandOutput
OutputError
{
"
error
":{
"
code
":
"invalidParameterValue",
"
message
": "needrecursive
flagfordirectory"
}
}
cURLExample
curl X POST H "contenttype: application/json" http://192.168.1.168/osc/commands/execute d '{"name":
"camera.delete", "parameters": {"fileUri": "/mnt/mmc/DCIM/360CAM01/360_XXXX.JPG", "recursive":
XXXX}}'
Giroptic360camOSC45
V.MetadataCommands
Giroptic360camOSC46
a.camera.getMetadata
Description
GetsmetadataofafilegivenitsURI.ThefieldsofExifandXMParelistedinImageheader.
CommandParameters
Parameters
fileUri
Type
String
Description
PossibleInput
Results
Results
Errors
exif
: JSON object containing JPEG exif missingParameter
: any required parameter is
includeimageorthumbnail.
invalidParameterName
: any input parameter
xmp
: JSON object containing Photosphere isunrecognized.
XMP.
invalidParameterValue
: any input parameter
Giroptic360camOSC47
Input&Output
CommandInput
{
"
parameters
":{
"
fileUri
":"fileURI"
}
}
CommandOutput
{
"
results
":{
"
exif
":{
"
ImageWidth
":XX,
"
ImageLength
":XX,
.},
"
xmp
":{
"
ProjectionType
":
"XXXX",
"
UsePanoramaViewer
":
XXXX,
}
}
}
OutputError
{
"
error
":{
"
code
":
"invalidParameterName",
"
message
": "parameter
fileUriismissing"
}
}
cURLExample
curl X POST H "contenttype: application/json" http://192.168.1.168/osc/commands/execute d '{"name":
"camera.getMetadata","parameters":{"fileUri":"/mnt/mmc/DCIM/360CAM01/360_XXXX.JPG"}}'
Giroptic360camOSC48
b.camera._setMetadata
Description
When setting image metadata, the JSONdictionary mustbecomplete,andany tagsmissing
are considered deletionsandshouldbehandled,withamissingmandatorytagcausingthecommand
request toreturn failure.A clientshouldfetch thecurrentmetadataandmodifyitappropriatelybefore
settingit.
CommandParameters
Parameters
Type
Description
PossibleInput
fileUri
String
PathtoorIDofthefiletosetmetadata. "
mnt/mmc/DCIM/360C
AM01/
"
exif
Object
Results
Results
Commandhasnoreturnvalue.
Errors
missingParameter
: any required parameter is
notspecified,e.g.sessionIdisnotspecified.
invalidParameterName
: any input parameter
isunrecognized.
invalidParameterValue
: any input parameter
Giroptic360camOSC49
Input&Output
CommandInput
{
"
parameters
":{
"
fileUri
":"fileURI",
"
exif
":{
"
ImageWidth
":
XX,
"
ImageHeight
":
XX,
"
GPSLatitude
":
XX,
"
GPSLongitude
":
XX
}
}
}
CommandOutput
OutputError
{
"
error
":{
"
code
":
"invalidParameterName",
"
message
": "parameter
exifisunrecognized"
}
}
cURLExample
curl X POST H "contenttype: application/json" http://192.168.1.168/osc/commands/execute d '{"name":
"camera._setMetadata", "parameters": {"fileUri": /mnt/mmc/DCIM/360CAM01/360_XXXX.JPG ", "exif":
{"GPSLatitude":XX,"GPSLongitude":XX}}}'
Giroptic360camOSC50
c.camera._patchMetadata
Description
Whenpatchingimagemetadata,theJSONdictionaryisadeltatoapplyoverthecurrentimage
metadata, withthetag present adding toorreplacingmetadatainformationinthefile.Thisprovidesa
camera client with an easy way of adding or changing the Rating or RatingPercent tags, without
havingtofirstfetchthecurrentimagemetadata.
CommandParameters
Parameters
Type
Description
PossibleInput
fileUri
String
"
mnt/mmc/DCIM/360C
AM01/
"
exif
Object
Results
Results
Commandhasnoreturnvalue.
Errors
missingParameter
: any required parameter is
notspecified,e.g.sessionIdisnotspecified.
invalidParameterName
: any input parameter
isunrecognized.
invalidParameterValue
: any input parameter
Giroptic360camOSC51
Input&Output
CommandInput
{
"
parameters
":{
"
fileUri
":"fileURI",
"
exif
":{
"
GPSLatitude
":
XX,
"
GPSLongitude
":
XX
}
}
}
CommandOutput
OutputError
{
"
error
":{
"
code
":
"invalidParameterName",
"
message
": "parameter
exifisunrecognized"
}
}
cURLExample
curl X POST H "contenttype: application/json" http://192.168.1.168/osc/commands/execute d '{"name":
"camera._patchMetadata", "parameters": {"fileUri": "/mnt/mmc/DCIM/360CAM01/360_XXXX.JPG", "exif":
{"GPSAltitude":XX}}}'
Giroptic360camOSC52
VI.ImageCommands
Giroptic360camOSC53
a.camera.getImage
Description
Returns a full
size or scaled image given its path. Input parameters include resolution. This
commandshouldreturn"Content
Type:image/jpeg"
.
CommandParameters
Parameters
fileUri
Type
String
maxSize
(optional)
Description
PossibleInput
[0+
Results
Results
Errors
content
: image binary data, including missingParameter
header.
invalidParameterName
: any input parameter
isunrecognized.
invalidParameterValue
: any input parameter
Giroptic360camOSC54
Input&Output
CommandInput
{
"
parameters
":{
"
fileUri
":"fileURI",
"
maxSize
":XX
}
}
CommandOutput
OutputError
{
"
error
":{
"
code
":
"invalidParameterValue",
"
message
":
"invalid
maxSizeparameter"
}
}
cURLExample
curl X POST H "contenttype: application/json" http://192.168.1.168/osc/commands/execute d '{"name":
"camera.getImage", "parameters": {"fileUri": "/mnt/mmc/DCIM/360CAM01/360_XXXX.JPG", "maxSize":
XX}}'
Giroptic360camOSC55
b.camera._getImagePreview
Description
Gets the media (video/image) thumbnail. Parameters include width, height andformat ofthe
thumbnail.
CommandParameters
Parameters
Type
Description
PossibleInput
fileUri
String
width
int
Widthoftheboundingbox.
[0+
height
int
Heightoftheboundingbox.
[0+
format
String
"
mnt/mmc/DCIM/360C
AM01/
"
"
base64
"
,
"blob"
Results
Results
content
: Preview image data. Content is
Errors
missingParameter
: any required parameter is
notspecified,e.g.sessionIdisnotspecified.
invalidParameterName
: any input parameter
isunrecognized.
invalidParameterValue
: any input parameter
Giroptic360camOSC56
Input&Output
CommandInput
{
"
parameters
":{
"
fileUri
":"fileURI",
"
width
":XX,
"
height
":XX,
"
format
":"XXXX"
}
}
CommandOutput
{
"
results
":{
"
content
":"formatcontent"
}
}
*exampleonlywithbase64format.
OutputError
{
"
error
":{
"
code
":
"missingParameter",
"
message
": "parameter is
notspecified"
}
}
cURLExample
curl X POST H "contenttype: application/json" http://192.168.1.168/osc/commands/execute d '{"name":
"camera._getImagePreview", "parameters": {"fileUri": "/mnt/mmc/DCIM/360CAM01/360_XXXX.JPG",
"width":XX,"height":XX}}'
Giroptic360camOSC57
c.camera.listImages
Description
Lists all images of the camera.The images are returnedin the orderof capture time, newest
first.
CommandParameters
Parameters
entryCount
Type
int
maxSize
Description
PossibleInput
[0+
Desiresnumberofentriestoreturn.
[1284096]
fileUri
(optinal)
String
continuationToken
(optional)
String
Composedby10
characters.
'
true
'
or
'
false
'
includeThumb
(optional)
Results
Results*
entries
:
Alistofimageproperties.
Errors
missingParameter
: any required parameter is
notspecified,e.g.sessionIdisnotspecified.
totalEntries
:
isunrecognized.
continuationToken
:
:(Optional)Setonlyifthe
result is incomplete. To fetchremaining entries, invalidParameterValue
: any input parameter
Giroptic360camOSC58
Input&Output
CommandInput
{
"
parameters
":{
"
entryCount
":XX,
"
maxSize
":XX,
"
includeThumb
":XXXX
}
}
CommandOutput
OutputError
{
"
results
":{
"
entries
":[{
"
name
":"XXXX",
"
uri
":"imageURI",
"
size
":XX,
"
dateTimeZone
":"XXXX:XX:XX
XX:XX:XX+XX:XX"
"
lat
":XX
"
lng
":
XX
"
width
":XX
"
height
":XX
"
thumbnail
":"ENCODEDSTRING"
}
...
{
...
}
],
"
totalEntries
":XX,
"
continuationToken
":"XXXX"
}
}
{
"
error
":{
"
code
":
"invalidParameterValue",
"
message
":
"parameter
continuationToken is out of
range."
}
}
cURLExample
curl X POST H "contenttype: application/json" http://192.168.1.168/osc/commands/execute d '{"name":
"camera.listImages","parameters":{"entryCount":XX,"maxSize":XX,"includeThumb":XXXX}}'
Giroptic360camOSC59
VII.Get&SetOptions
Giroptic360camOSC60
a.camera.getOptions
Description
Getstheinformationforspecifiedproperties.
CommandParameters
Parameters
Type
Description
PossibleInput
sessionId
String
Uniquesession identifierobtainedfrom
thecamera.startSessioncommand.
Composedby10
characters.
optionNames
String
Array
AlloptionNamesare
setonoptionstable.
Results
Results
Errors
JSON string with options specified in the missingParameter
: any required parameter is
optionNamesparameter
notspecified,e.g.sessionIdisnotspecified.
invalidParameterName
: any input parameter
isunrecognized.
invalidParameterValue
: any input parameter
UnauthorizedCommand
Input&Output
CommandInput
{
"
parameters
":{
"
sessionId
":"XXXXX",
"
optionNames
":[
"
captureMode
","
gps
",
"
_timelapseInterval
"
]
}
}
CommandOutput
{
"
results
":{
"
options
":{
"
captureMode
":"XXXX",
"
gps
":"XXXX",
"
_timelapseInterval
":XX
}
}
}
OutputError
{
"
error
":{
"
code
":
"invalidParameterName",
"
message
": "parameter
optionNamesisunrecognized"
}
}
Giroptic360camOSC61
cURLExample
curl X POST H "contenttype: application/json" http://192.168.1.168/osc/commands/execute d '{"name":
"camera.getOptions", "parameters": {"sessionId": "XXXXXXXXXX", "optionNames": ["_videoFramerate",
"_videoBitrate"]}}'
Giroptic360camOSC62
b.camera.setOptions
Description
Sets the values for specified properties, e.g. GPS
on/off,
date & time, ISO, white balance,
shutterspeed,sleep/poweroffdelayetc.
CommandParameters
Parameters
Type
Description
PossibleInput
sessionId
String
Uniquesession identifierobtainedfrom
thecamera.startSessioncommand.
Composedby10
characters.
options
Object
Alloptionsareseton
optionstable.
Results
Results
Errors
JSON string with options specified in the missingParameter
: any required parameter is
optionNamesparameter
notspecified,e.g.sessionIdisnotspecified.
invalidParameterName
: any input parameter
isunrecognized.
invalidParameterValue
: any input parameter
Input&Output
CommandInput
{
"
parameters
":{
"
sessionId
":"XXXXXX",
"
options
":{
"
captureMode
":"XXXX"
}
}
}
CommandOutput
OutputError
{
"
error
":{
"
code
":
"invalidParameterValue",
"
message
": "No valid
parameters"
}
}
Giroptic360camOSC63
cURLExample
curl X POST H "contenttype: application/json" http://192.168.1.168/osc/commands/execute d '{"name":
"camera.setOptions","parameters":{"sessionId":"XXXXXXXXXX","options":{"_videoBitrate":XX}}}'
Giroptic360camOSC64
c.Options
The following table shows all the options that can be changed and/or obtained by
camera.setOptions and camera.getOptions. An option cannot be changed when its corresponding
support isemptyoronlycontainsoneoption,e.g.when"shutterSpeedSupport"isempty(auto mode),
clients cannot setOptionsfor"shutterSpeed".So,itis cameras responsibility toupdatethe available
optionswheneverneeded.xxxSupportoptionsareNOTallowedtobesetbyclients.
Name
Type
Description
captureMode
String
Currentcapturemode.Defaultto_video.
captureModeSupport
StringArray
exposureMode
Number
exposureModeSupport
Number
Array
shutterSpeed
Number
Currentshutterspeedsettinginmicroseconds.
shutterSpeedSupport
Number
Array
whiteBalance
String
whiteBalanceSupport
StringArray
fileFormat
Object
Currentimagetypeandresolution,e.g.
{
type:jpeg,
width:4096,
height:2048
}
fileFormatSupport
{
type:mp4,
width:2048,
height:1024
},
{
type:jpeg,
width:4096,
height:2048
}
]
exposureDelay
Number
exposureDelaySupport
Object
{
"minDelay":0,
"maxDelay":60
}
hdr
Boolean
_hdrInCam*
Boolean
hdrSupport
Boolean
exposureBracket
Object
Currentexposurebracketsetting,withtwoentries,
"shots", anintegercontainingthenumberofshots
to betaken,and"increment",anumbercontaining
fstop increment between shots. Relevantif"hdr"
optionisenabled.
Forexample,
{
"shots":3,
"increment":[0,4,4]
}
Defaulttoempty"{}"when"hdr"isfalse.
Giroptic360camOSC66
exposureBracketSupport
Object
Exposurebracketsettingscurrentlyavailable,e.g.
{
"shotsSupport":[1,3,5,7],
Defaulttoempty"{}"if"hdr"isfalse.
_timelapseInterval
Number
_timelapseIntervalSupport
Number
Array
_burstDuration
Number
_burstDurationSupport
Number
Array
Listof_burstmodedurationdelaysinseconds.
_videoBitrate
Number
Currentvideoencodingbitrateinbit/s.
minBitrate=500000
maxBitrate=20000000
_videoBitrateSupport
Object
[5,10,15,30]
{
"min":500000,
"max:20000000
}
*Optionavailableonlyonlivemode
_videoFramerate
Number
Currentvideoframeratevalueinfps.
*Optionavailableonlyonlivemode
_videoFramerateSupport
Object
{
"min":5,
"max:30
}
*Optionavailableonlyonrecordmode
Giroptic360camOSC67
_recordFramerateBitrate
Number
videorecordingparameters:
0:30fps/15Mbps
1:25fps/20Mbps
Defautis1.
_sensorMode
String
Currentsensormodeusedin_videomode.
singleMode:asingleopticalsensorisused.
360Mode : the three optical sensors are used
outputtingasphericalvideo.
Defaultis360Mode
_sensorModeSupport
StringArray
Listofsensormodesavailablein_videomode.
[singleMode,360Mode]
_sensorNumber
Number
CurrentsensorusedinsingleMode:1,2or3.
Defaultis1.
Cf:360camsensorindex.
_sensorNumberSupport
Number
Array
List of _sensorNumber
available.
[1,2,3]
gyro
Boolean
gyroSupport
Boolean
_dpcMode
Boolean
Videodefectivepixelcorrectionmode.
false:softDPC(lessstrong)
true:hardDPC
Defaultvalueisfalse.
_rotationFlag
Boolean
gps*
Boolean
*:Optioncurrentlynotavailable.
gpsPosition
Object
parameter
inputs
Giroptic360camOSC68
{
lat:50.631909,
long:3.021227,
alt:19,
dateTime:2016:02:2917:16:55
}
Rangeofvaluecanbe:
Latitude:90&90with0.000001step
Longitude:180&180with0.000001step
Altitude:10000&10000with0.000001step
dateTime:YYYY:MM:DDHH:MM:SS
Timeshownin24hourformatinUTCformat.
String
Currentimagestabilizationoperation,e.g."off"
Alwaysoffwhengyroisfalse
imageStabilizationSupport
StringArray
totalSpace
Number
Numberofbytesoftotalstorage.Cannotbeset.
remainingSpace
Number
Numberofbytesoffreestorage.Cannotbeset.
remainingPictures
Number
remainingVideo
Number
_SDcardState
Number
SDcardcurrentstate.
0:NoSDcard
1:BadFilesystemformatonSDcard
2:SDcardinsertedandmounted
3:SDcardfullmemoryspace
batteryLevel
Number
Expressedasapercentageofthebattery
remaining.
dateTimeZone
String
Giroptic360camOSC70
d.Appendix
360camsensorindex
DirectoryArchitecture
Tofollowthedesign rulesfor camerafile system(DCF2.0standard),theSDcardisorganized
likethefollowingschematic.
Giroptic360camOSC71
Insidea360CAMxxfolder,youcanhave:
2typesoffiles:
360_YYYY.JPG
360_YYYY.MP4
3typesoffolders:
360TYYYYforTimeLapsemode
360BYYYYforBurstmode
360HYYYYforHDRmode
Where YYYY is a number between 0000 and 9999. Like a 360CAMxx folder each file/folder is
composedof 8 characters(withoutextension) 360,letter ofthe mode : _ or TorBorHand
endingwithanumberstartingat0000till9999.
Thesameruleisapplyina360XYYYYfolder,exceptthatitcanthaveanotherfolderinthisone.
Ifafolderisfull(9999files)anewfolderiscreatedandthecounterrestartsfrom0000.
Giroptic360camOSC72
RevisionHistory
Title
Description
v1.0.3
camera._getStreamUrl
Changeofstreamtypedescription
possibleInput
AddedPossibleInputcolumnonCommandParameterstable
camera.listImages
Addedfunctioncamera.listImages
camera.setOptions
Addmultipleoptionscapability
Addoptions:
gyroSupport
Correctbugon:
batteryLevel
ManufacturerGuide
ManufacturerguideaddtotheOSC
v1.0.4
Options
Increasefunctionstability(setandget)
Addoptions:
_sensorMode
_sensorModeSupport
_sensorNumber
_sensorNumberSupport
Addinformation:
batteryIsCharging
Correctbugs:
shutterSpeed
batteryLevel
Updatedescriptions:
shutterSpeed
shutterSpeedSupport
gyroSupport
v1.0.5
DirectoryDescription
AdddirectoryarchitectureanditsoperationfollowingtheDCF2.0standard
v1.0.6
camera.listImages
AddfileUrioption
Changetheorderofimages(newestfirst)
camera._listDirectory
Changetheorderofcontent(newestfirst)
v1.0.7
Giroptic360camOSC73
camera._getStreamUrl
Options
Addprotocoloption
Addoptions:
_SDcardState
_hdrInCam
v1.0.8
Options
v1.0.9
command
Add
paramState
command(camerapushcommand)
AddgpsPositionoptions
state
Addsettingstatein_cameraStatevalue
Options
Add_settingincaptureModeSupportvalue
v1.1.0
camera._getAttributes
camera._listDirectory
camera._getImagePreview
Addvideothumbnailcapability
v1.1.1
command
AddwifiModecommand
camera._getStreamUrl
AdduserNameandpasswordoptions
v1.1.2
NewexposureDelaySupportdefinition
ChangedateTimeZoneformat
Add_rotationFlagoption
Add_dpcModeoption
Add_recordFramerateBitrateoption
paramState
ChangechangingModetype
AddchangingFlagoption
AddswitchToCaptureMode
state
AddstorageChangedoptiontostatecommand.
RemovesessionExclusivefromstatecommand.
Options
AddremainingVideotoOptions
Giroptic360camOSC74
Giroptic360camOSC75