The export is described in the proto files ExportService.proto and Export.proto.
The following 6 methods are used for export:
Export tasks are performed not by gRPC channel, but by the export agent. Currently, it is impossible to create an export agent via gRPC API, only manually in the Client.
When at least one export agent is created, it can be used to perform operations. If there are several export agents and none of them is explicitly specified in the StartSession method, then the agent with index 1 will be used.
The export operation starts on the node where the camera is located. If the export is started for several cameras, then the first node is used. Note that it is not necessary to connect to each node − the tasks will be forwarded to them automatically.
Export results are generated on the local Axxon One Server and can be passed by downloading the files using the DownloadFile method, which supports downloading from an arbitrary location in the file.
The method passes the export options, which are described in the Options message.
|
where,
Using the combination of mode and output_type, you can create 4 export types:
The LiveMode, ArchiveMode, SnapshotType and StreamType messages contain the parameters for this export type. The CommonSetting message is used to pass general settings for the export operation.
The list of main export parameters:
|
For each export type, there are timeouts after which the operation is stopped if the GetSessionState method was not executed.
The timeout is counted from the moment the export operation was started and/or from the moment the GetSessionState method was last executed.
The timeout for exporting a video clip from live video is 5 minutes, for all other export types − 30 minutes.
The id of the export operation will be received as the response to this method.
The SessionInfo message for each export operation will be received as the response to this method. If one response does not fit all the operations, then there will also be the next_page_token for the next page.
The SessionInfo message contains:
export status.
enum EState { S_NONE = 0; S_RUNNING = 1; S_COMPLETED = 2; S_REMOVED = 3; } |
where the S_COMPLETED status does not guarantee that the export was successful.
If there are export operation results, then a Result message will be received.
message Result { message File { string path = 1; uint64 size = 2; string min_timestamp = 3; string max_timestamp = 4; string mime_type = 5; } repeated File files = 1; bool succeeded = 2; } |
where,
succeeded − indicates that the export was successful;
After the export operation status changes to S_COMPLETED, you have 1 hour to download the files from the Server. Note that the timeout is reset to zero after the GetSessionState and DownloadFile methods are executed.
If the timeout is exceeded, the files will be deleted from the Server.
The id of the export operation is passed in the method.
Its EState status will be received in response to this method.
If there are export operation results, then a Result message will be received.
The id of the export operation is passed in the method.
Its updated EState status will be received in response to this method.
The method can be used only after the export operation is completed.
The following data is passed in the method:
In response to this method, FileChunk messages will be received with file data blocks, which will be coming until the entire file is downloaded.
The id of the export operation is passed in the method.