RTSP video

Introduction

It is possible to get RTSP video for both live and recorded video using API v3. RTSP streams can come from the cloud or directly from a bridge associated with the requested camera.

  • The /media API is used for retrieving recorded video
  • The /feeds API is used to get live video feed from a camera

Recorded RTSP video

  1. Retrieve the recorded RTSP video using /media .

The required parameters are the following:

  • "deviceId" is the camera Id obtained from the /cameras endpoint
  • "type" parameter value is "main"
  • "mediaType" needs to be specified as "video"
  • "include" parameter value should be "rtspUrl" in order to retrieve the rtspUrl for the recorded video
curl --location --request GET 'https:/<baseURL>/api/v3.0/media?deviceId=10097dd2&type=main&mediaType=video&include=rtspUrl&startTimestamp__gte=2022-08-15T07%3A59%3A22.946%2B00%3A00&endTimestamp__lte=2022-08-15T11%3A42%3A42.665%2B00%3A00' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <access_token>'
{
    "nextPageToken": "MToxMDA6MTY2MDU3NzAzNjM2Njot",
    "prevPageToken": "",
    "results": [
        {
            "type": "main",
            "deviceId": "10097dd2",
            "mediaType": "video",
            "startTimestamp": "2022-08-15T07:56:54.894+00:00",
            "endTimestamp": "2022-08-15T08:27:14.448+00:00",
            "rtspUrl": "rtsp://rtsp.c001.eagleeyenetworks.com:554/media/streams/main/rtsp?esn=10097dd2&from=2022-08-15T07%3A56%3A54.894%2B00%3A00&till=2022-08-15T08%3A27%3A14.448%2B00%3A00&stream_session=7fcd2302-2698-4238-980e-d865a2b602aa"
        },
        {
            "type": "main",
            "deviceId": "10097dd2",
            "mediaType": "video",
            "startTimestamp": "2022-08-15T08:27:26.444+00:00",
            "endTimestamp": "2022-08-15T08:28:10.433+00:00",
            "rtspUrl": "rtsp://rtsp.c001.eagleeyenetworks.com:554/media/streams/main/rtsp?esn=10097dd2&from=2022-08-15T08%3A27%3A26.444%2B00%3A00&till=2022-08-15T08%3A28%3A10.433%2B00%3A00&stream_session=7d48c27d-1d80-463a-a4b6-5140d1e062a2"
        }
        ]
}
  1. With this rtspUrl and the access token, you can view the video using popular players, such as VLC or FFplay.

🚧

Important

Always provide the access token along with the rtspUrl . The final URL should follow the following format: rtspUrl&access_token=<access token>

Live full video

You can retrieve the livestream of a camera using the /feeds API, and play it with VLC by using the rtspUrl retrieved in the response. The required parameters are deviceId, type and include.

  • deviceId is the camera ID obtained from the camera's endpoint
  • type can be preview or main. For a full-resolution video, the value is main.
  • The include parameter has to be rtsp here
curl --location --request GET 'https://<baseUrl>/api/v3.0/feeds?deviceId=10097dd2&type=main&include=rtspUrl' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <access_token>' \
{
    "nextPageToken": "",
    "prevPageToken": "",
    "results": [
        {
            "id": "10097dd2-main",
            "type": "main",
            "deviceId": "10097dd2",
            "mediaType": "video",
            "rtspUrl": "rtsp://rtsp.c001.eagleeyenetworks.com:554/media/streams/main/rtsp?esn=10097dd2&stream_session=d755bb70-dbdb-4a78-88db-2357d6ac5010"
        }
    ]
}

Live preview video

The /feeds API provides a low-quality live video by setting the type parameter as preview.

curl --location --request GET 'https://<baseUrl>/api/v3.0/feeds?deviceId=10097dd2&type=preview&include=rtspUrl' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <access_token>' \
{
    "nextPageToken": "",
    "prevPageToken": "",
    "results": [
        {
            "id": "10097dd2-preview",
            "type": "preview",
            "deviceId": "10097dd2",
            "mediaType": "video",
            "rtspUrl": "rtsp://rtsp.c001.eagleeyenetworks.com:554/media/streams/preview/rtsp?esn=10097dd2&stream_session=7e524248-2f47-4e5d-bdc4-1f423eae1f47"
        }
    ]
}

🚧

Important

Always provide the access token along with the rtspUrl . The final URL should follow the following format: rtspUrl&access_token=<access token>

Live LocalRTSP from the Bridge

It is possible to include localRtspUrl in your request in order to receive a direct stream from the bridge associated with the requested camera. The following is a sample localRtspUrl request:

curl --request GET \
     --url 'https://<base-URL>/api/v3.0/feeds?deviceId=1004cb8c&type=main&include=localRtspUrl&pageSize=100' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer <access token>'

The response to the above request:

{
  "nextPageToken": "",
  "prevPageToken": "",
  "results": [
    {
      "id": "1004cb8c-main",
      "type": "main",
      "deviceId": "1004cb8c",
      "mediaType": "video",
      "localRtspUrl": "rtsp://devtest%40een.com:LrRCW84D%2BkiFo%2BHilM5FgzOPj4U%[email protected]:8554/1004cb8c"
    }
  ],
  "totalSize": 1
}

📘

Note

To receive a Local RTSP URL for a camera, the camera and its bridge have to be associated with the account. The local RTSP URL is not available for the cameras that are shared from another account.

Video streaming via VLC

Here is an example of how to play RTSP video on VLC:

  1. Open VLC, then do either of the following:
  • Go to Media --> Open Network stream.
  • Press Ctrl + N.

  1. In the Open Media dialog copy the value of the localRTSPUrl and the access token.

🚧

Important

Always provide the access token along with the rtspUrl . The final URL should follow the following format: rtspUrl&access_token=<access token>