Get video stream URI

Our example shows how to get a video stream URI from a camera connected via gateway.
The communication between the gateway and the camera follows the ONVIF protocol.

See Demos with ONVIF camera connected via gateway for the prerequisites.

The section is structured as follows:

Goal

Get a video URL by sending a message to a VideoProvider feature of a thing with ID com.mycompany.example:gateway-001:da:device:Cameras:1.

Below is an example of how this can be accomplished via the Bosch IoT Things API.

Request

Use the API docs of Bosch IoT Things

  • Authorize with a fresh Suite OAuth token.
    See Device provisioning

  • Message resource

    • POST /things/{thingId}/features/{featureId}/inbox/messages/{messageSubject}
      Send a message TO a specific feature of a specific thing

    • Set the thingId to com.mycompany.example:gateway-001:da:device:Cameras:1
      Note: The thingId can be taken from Things dashboard.

    • Set the featureId to VideoProvider
      Note: The featureId can be taken from Things dashboard.

    • Set the messageSubject to getVideoURL
      Note: The getVideoURL is the operation name of respective functional item with ID da:item:Cameras:1:Configuration in gateway runtime. Use WebAdmin console in gateway runtime to get it.

    • Set the body
      The operation arguments are to be set in the request body:

      {
      "proxy": "false",
      "props": "null"
      }
    • Click Execute

Response

Your response body should look similar to following snippet:

{
"result": "rtsp://172.22.203.8:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif",
"error": null
}

Check the result

Open the URL in a video player, from a PC in the same network as the camera edge device. In case everything was successful, you should see the video streamed by the camera.