Go to documentation repository
Documentation for Axxon One 1.0.
General information
The export is described in the proto files ExportService.proto and Export.proto.
The following 6 methods are used for export:
- ListSessions − is used to get a list of all export operations.
- StartSession − to start a new export operation.
- GetSessionState − to get the status of a specific operation.
- StopSession − to stop the operation.
- DestroySession − to delete the operation along with the export results.
- DownloadFile − to download the export results.
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.
StartSession method
The method passes the export options, which are described in the Options message.
where,
- oneof − implies the selection of one property that can be set in this operation.
- export_agent_access_point − export agent id.
Using the combination of mode and output_type, you can create 4 export types:
- LiveMode + SnapshotType − export a frame from live video.
- LiveMode + StreamType − export a video clip from live video.
- ArchiveMode + SnapshotType − export a frame from archive.
- ArchiveMode + StreamType − export a video clip from archive.
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.
ListSessions 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:
- id of the export operation and its properties.
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;
- message File − describes the list of files ready for download, including the conditional path to be used in the DownloadFile method and size.
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.
GetSessionState method
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.
StopSession method
The id of the export operation is passed in the method.
Its updated EState status will be received in response to this method.
DownloadFile method
The method can be used only after the export operation is completed.
The following data is passed in the method:
- export operation id;
- path to the file;
- chunk_size_kb − data block size;
- start_from_chunk_index − serial number of the data block.
In response to this method, FileChunk messages will be received with file data blocks, which will be coming until the entire file is downloaded.
DestroySession method
The id of the export operation is passed in the method.