PST SDK
6.0.0.0-272350a
|
Retrieves real time camera images (if enabled) by subscribing to an event stream.
The PST REST server implements a Server-Send Events (SSEs) communication channel. When a new connection is established, if camera images are enabled, frames are served with a text/event-stream Content-Type, that follows the SSE format. Typically, a frame consist of 2 images, each of them contained in a "data:" line. This pair of images is terminated by a second carriage return.
GET /PSTapi/StartRawImageDataStream HTTP/1.1
Host: address:port
http://localhost:7278/PSTapi/StartRawImageDataStream
Open a Server-Send Events (SSEs) stream, with a text/event-stream Content-Type. Each message represents a new capture that follows the SSE format. A message has several "data:" lines representing each camera and is terminated by a carriage return character \n. Each "data:" line represents a base64 encoded JPEG camera image.
Key | Value Type | Description |
---|---|---|
data | base64 string | A base 64 string representing a JPEG image |
data: <a base64 string representing a JPEG image, the left/right camera, 1st frame>
data: <a base64 string representing a JPEG image, the left/right camera, 1st frame>
data: <a base64 string representing a JPEG image, the left/right camera, 2nd frame>
data: <a base64 string representing a JPEG image, the left/right camera, 2nd frame>
data: <a base64 string representing a JPEG image, the left/right camera, 3rd frame>
data: <a base64 string representing a JPEG image, the left/right camera, 3rd frame>
...
Status Code | Content Example | Meaning |
---|---|---|
200 | JSON event stream "data:" | Stream of "data" objects containing the images |
429 | {"message":"TOO_MANY_IMAGES_STREAM_ALREADY_OPENED"} | There are 2 image streams open already. cf. CloseImageStream |
500 | {"message":"TrackerException: <...>"} | An other type of internal error |