Export start

Export is initiated using one of the following POST requests:
 http://IP-Address:port/prefix/export/archive/SERVER1/VIDEOSOURCEID/BEGINTIME/ENDTIME - archive export
 http://IP-Address:port/prefix/export/live/SERVER1/VIDEOSOURCEID/BEGINTIME/ENDTIME - live video export

where BEGINTIME and ENDTIME set time in the YYYYMMDDTHHMMSS format. If BEGINTIME is greater than ENDTIME, then the values will swap. BEGINTIME must be equal to ENDTIME for snapshot export.  

Complex data structures are in use to describe frames and masks. These structures can be divided into several types:

Supported parameters that are sent in the body of initial POST request:

  1. format (string) is a mandatoryparameter; available values are mkv, avi, exe, jpg and pdf. It sets the format of output export container. 
  2. maxfilesize (number) is a maximum export file size (in bytes). A new file will be created when the size limit is exceeded. Export results in the collection of files. Default value is 0 (as a result, a single file).
  3. vcac (number) is a compression quality level for video and audio respectively. Allowed values are from 0 to 6 (6 means the worst). The initial quality level will be set when 0 is specified (original API fault). Default value is 0.
  4. freq (number) – frame rate of the output stream. Default value is 0. Available values:
    1. 0 – original
    2. 1 – half of original
    3. 2 - quarter of original
    4. 3 – one-eighth of original
  5. tsformat (string) is a time stamp format template. Any string can be generated http://www.boost.org/doc/libs/1_55_0/doc/html/date_time/date_time_io.html. Default value is %Y-%b-%d %H:%M:%S.

    Server does not check the format of the input string.

  6. croparea (area) is a snapshot area for export (Default value is 0,0!0,0 – the entire snapshot).
  7. maskspace (mask) is a snapshot mask space. By default a snapshot is not masked.
  8. color (string) is a color of a comment and time stamp text. It is set in the #FFFFFF format.
  9. comment (string) is a comment.

    Parameters relevant to PDF format only.
  1. snapshotplace (area) is a snapshot location on the page
  2. commentplace (area) is a comment location on the page
  3. tsplace (area) is a time stamp location on the page
layout (number) – page layout. Available values are 0 (portrait), 1 (landscape).

 The request will result in an error response or response that looks like:

HTTP/1.1 202 Accepted
Connection: Close
Location: /export/3dc15b75-6463-4eb1-ab2d-0eb0a8f54bd3
Cache-Control: no-cache

Possible error codes:

  • 400 -  incorrect request.
  • 500 - Server internal error.

Get export status

GET http://IP-Address:port/prefix/export/id/status

where id is the value from the Location field (here 3dc15b75-6463-4eb1-ab2d-0eb0a8f54bd3)

Sample response:

{
  "id": "73c2e1d2-0f8f-414c-9cc0-ac5fb43cd8dd"
  ,"state": 1
  ,"progress": 0.51062298
  ,"error": ""
  ,"files":
  [
  ]
}

where

Export completion

DELETE http://IP-Address:port/prefix/export/id

where id is the value from the Location field.

Download file

GET http://IP- Address:port/prefix/export/id/file?name=SERVER_DeviceIpint.1[20160527T132900-20160527T133000].mkv

where