PST SDK
5.0.1.0-acae3ae
|
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 an new connection is established, if camera images are enabled, frames are served with a text/event-stream Content-Type, that follows the SSE format. Each images is contained in a new "data:" line. Typically, a frame consist of 2 images, each of them contained in a "data:" line. This pair of images is terminated by a second cariage 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 represent 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 represent 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"} | Their is already 2 image stream open. cf. CloseImageStream |
500 | {"message":"TrackerException: <...>"} | an other type of internal error |