The process of viewing / downloading a recording is divided into three steps:

Explain what this how-to article is for. For example, you might write an article to teach people at your company how to set up a corporate email account or file an expense report.

(blue star) The process of viewing / downloading a recording is divided into three steps:

  1. List all available recording video qualities and storage from specified camera and time interval.

  2. Choose the proper recording and start the prepare video background process.

  3. Check the prepare recording process has finished and download the video file (mp4).

Each step is described in more details below.

Step 1. List all available recording video qualities and storage from specified camera and time interval.

Recordig_id is a unique recording identifier. It is created when you check availability using the following query. The "from" and "to" parameters define the required recording time period. Mind that it can take longer to download large (high quality) recordings located on local storage. Video from cloud storage can be downloaded much faster.

Query:

query{
  camera(node_id:62303){
    recordings(from:1589190089, to:1589190689){
      recording_id
      duration
      download_url
      outputs{
        height
      }
    }
  }
}
API Explorer will be opened

Response:

{
  "data": {
    "camera": {
      "recordings": [
        {
          "recording_id": "xRMElmAkh3",
          "duration": 598,
          "download_url": null,
          "outputs": [
            {
              "height": 480
            },
            {
              "height": 720
            },
            {
              "height": 800
            }
          ]
        }
      ]
    }
  }
}

Without Postman example.

If the response does not contain any recording in the list, check in the user interface whether the given camera is recording or was recording in the selected interval. We will now call a mutation to prepare a recording, whose parameters are recording_id and height from the previous step.

Step 2. Choose the proper recording and start the prepare video background process.

Mutation:

mutation{
  recordingPrepare(recording_id:"xRMElmAkh3", height:720)
}
API Explorer will be opened

Response:

{
  "data": {
    "recordingPrepare": true
  }
}

Without Postman example.

A value of true indicates that the recording preparation has started successfully. The state of preparation is obtained by querying the type of recording whose parameter is recording_id.

Step 3. Check the prepare recording process has finished and download the video file (mp4).

Query:

query{
  recording(recording_id:"6RjiHGzqCE"){
    progress
    download_url
  }
}
API Explorer will be opened

Response:

{
  "data": {
    "recording": {
      "progress": 100,
      "download_url": "https://cloud.camstreamer.com/api/download.php?auth_key=2YwmG01NAeNYz4m1bZfwIKLOaoHeCfxH"
    }
  }
}

Without Postman example.

The download_url is an http(s) address. Use HTTP client (GET request) or paste it to browser to fetch the video MP4 file.

In the answer we see "progress: 100". The upload is ready and download_url contains the download URL. If the recording is still being prepared, download_url contains the value "null" and progress expresses the processing status in percent.

note

An unused recording ID expires in one hour.
The URL to download the recording expires in 24 hours.
If the recording is downloaded, the download URL expires after 6 hours.

An unused recording ID expires in one hour.
The URL to download the recording expires in 24 hours.
If the recording is downloaded, the download URL expires after 6 hours.

(blue star) Related articles

The content by label feature automatically displays related articles based on labels you choose. To edit options for this feature, select the placeholder and tap the pencil icon.