View and download of the video recording
The process of viewing / downloading a recording is divided into three steps:
Â
 The process of viewing / downloading a recording is divided into three steps:
List all available recording video qualities and storage from specified camera and time interval.
Choose the proper recording and start the prepare video background process.
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
}
}
}
}
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)
}
Response:
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:
Response:
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.
Â
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.