...
Section |
---|
Column |
---|
|
Panel |
---|
borderColor | #CCCCCC |
---|
bgColor | #FFFFFF |
---|
titleBGColor | #F0F0F0 |
---|
borderStyle | solid |
---|
title | На странице: |
---|
| |
|
|
General information
Ogólne informacje
Eksport jest opisany w proto-plikach The export is described in the proto files ExportService.proto and oraz Export.proto.
The following 6 methods are used for exportNastępujące z 6 metod mogą być użyte do celów eksportu:
- ListSessions - is used to get a list of all export operationsużywana w celu pozyskania listy wszystkich operacji eksportu.
- StartSession - to start a new export operationw celu rozpoczęcia nowej operacji eksportu.
- GetSessionState - to get the status of a specific operationw celu pozyskania statusu określonej operacji.
- StopSession - to stop the operationw celu zatrzymania operacji.
- DestroySession - to delete the operation along with the export resultsw celu usunięcia operacji wraz z wynikami eksportu.
- DownloadFile - to download the export results.
Export tasks are performed not by NativeBL, but by the export agent. Currently, it is impossible to create an export agent via NativeBL, 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 Next 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
- w celu pobrania wyników eksportu.
Zadania eksportu nie są wykonywane przez NativeBL, lecz przez szablon eksportu. Obecnie nie jest możliwe utworzenie szablonu eksportu poprzez NativeBL; należy zrobić to ręcznie w Kliencie.
Gdy co najmniej jeden szablon eksportu zostanie utworzony, może on być używany w celu przeprowadzania operacji. Jeśli istnieje kilka szablonów eksportu, a żaden z nich nie jest określony w metodzie StartSession, szablon o indeksie 1 zostanie użyty.
Operacje eksportu rozpoczynają się na węźle, na którym kamera jest zlokalizowana. Jeśli eksport zostanie rozpoczęty dla kilku kamer, tylko pierwszy węzeł jest używany. Nie oznacza to, że nie jest wymagane połączenie do każdego węzła - zadanie zostanie przekazane automatycznie.
Wyniki eksportu są generowane na lokalnym Serwerze Axxon Next; mogą one być przekazanie przez pobranie pliku za pośrednictwem metody DownloadFile, która wspiera pobieranie z określonych lokalizacji.
Metoda StartSession
Metoda przekazuje opcje eksportu, które są opisane w The method passes the export options, which are described in the Options message.
Expand |
---|
|
Code Block |
---|
message Options
{
oneof mode
{
LiveMode live = 1;
ArchiveMode archive = 2;
}
oneof output_type
{
SnapshotType snapshot = 3;
StreamType stream = 4;
}
repeated CommonSetting settings = 5;
// Maximum size of output file.
// New file will be created on reaching this value.
uint64 max_file_size = 6;
string export_agent_access_point = 100;
} |
|
where,gdzie:
- oneof - implies the selection of one property that can be set in this operationimplikuje selekcję jednej właściwości, która może być wybrana w operacji.
- export_agent_access_point - export agent id.ID szablonu eksportu.
Korzystając z kombinacji mode oraz Using the combination of mode and output_type, you can create 4 export types można utworzyć 4 typy eksportu:
- LiveMode + SnapshotType - export a frame from live videoeksportowanie stopklatki z wideo na żywo.
- LiveMode + StreamType - export a video clip from live videoeksportowanie klipu wideo z wideo na żywo.
- ArchiveMode + SnapshotType - export a frame from archiveeksportowanie klatki z archiwum.
- ArchiveMode + StreamType - export a video clip from archiveeksportowanie klipu wideo z archiwum.
The Messages 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.oraz StreamType zawierają parametry dla tego typu eksportu. Message CommonSetting jest stosowana w celu przekazywania ogólnych ustawień do operacji eksportu.
Lista głównych parametrów eksportuThe list of main export parameters:
Expand |
---|
|
ParameterExport typeDescriptionMaximum file size (see Opis |
---|
Options max_file_size |
Export a video clip | Eksportowanie klipu wideo | Maksymalny rozmiar pliku (zobacz: |
All | Wszystkie | ID szablonu eksportu | Export agent idExport a video clip | Output Eksportowanie klipu wideo | Format pliku wyjściowego | file formatExport a frame | Eksportowanie klatki | Format pliku wyjściowego | Output file format. | ArchiveMode/LiveMode Source origin | AllVideo source (see Get video cameras list and their parameters using gRPC API methods Export from archive | Archive (see Get video cameras list and their parameters using gRPC API methods Export from archive | Timestamp of the export interval startEksportowanie z archiwum | Znacznik czasu startu eksportowanego interwału czasowego. | ArchiveMode end_timestamp |
Export from archive | Eksportowanie z archiwum | Znacznik czasu końca eksportowanego interwału czasowego | Timestamp of the export interval endAllComment.Komentarz | CommonSetting timestamp_format | AllTimestamp formatFormat stopklatki. | CommonSetting text_place |
All | Place for commentWszystkie | Miejsce na komentarz. | CommonSetting text_color |
All | Wszystkie | Kolor tekstu komentarza | Comment text color. | CommonSetting burn_subtitle | AllText overlay or lub no). | CommonSetting apply_mask | AllMask overlay or lub no). | StreamSetting video_quality |
Export a video clip | Eksportowanie klipu wideo | Jakość strumienia wideo | Video stream quality. | StreamSetting video_codec |
Export a video clip | Eksportowanie klipu wideo | Kodek wideo | Video codec. | StreamSetting audio_quality |
Export a video clip | Audio stream qualityEksportowanie klipu wideo | Jakość strumienia audio. | StreamSetting audio_codec |
Export a video clip | Eksportowanie klipu wideo | Kodek audio | Audio codec. | StreamSetting frame_frequency |
Export a video clip | Frame frequencyEksportowanie klipu wideo | Częstotliwość klatek. | SnapshotSetting pdf_layout |
Export a frame | PDF file orientationEksportowanie klatki | Układ strony PDF. | SnapshotSetting snapshot_place |
Export a frame | Frame location in the PDF fileEksportowanie klatki | Lokalizacja klatki w pliku PDF. | SnapshotSetting comment_place |
Export a frame | Comment location in the PDF fileEksportowanie klatki | Lokalizacja komentarza w pliku PDF. | SnapshotSetting timestamp_place |
Export a frame | Timestamp location in the PDF fileEksportowanie klatki | Lokalizacja znacznika czasu w pliku PDF. | SourceSetting crop_area | AllExport area (see AllMaskMaska. | SourceSetting text_place |
All | Wszystkie | Miejsce na komentarz | Place for comment. | SourceSetting text_color |
All | Comment text color. | |
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:
Wszystkie | Kolor tekstu komentarza. |
|
Dla każdego typu eksportu istnieje okres oczekiwania, po upłynięciu którego operacja jest zatrzymywana, o ile nie została wykonana metoda GetSessionState.
Okres oczekiwania jest wyliczany począwszy od chwili rozpoczęcia operacji i/lub od chwili, w której ostatnio użyta została metoda GetSessionState.
Okres oczekiwania dla eksportowania klipów wideo to 5 minut; dla wszystkich typów eksportu - 30 minut.
ID operacji eksportu będzie otrzymane jako odpowiedź do tej metody.
Metoda ListSessions
Message SessionInfo dla każdej operacji eksportu będzie otrzymywana jako odpowiedź do tej metody. Jeśli odpowiedź nie zawiera wszystkich operacji, będzie zawarty next_page_token do przejścia do następnej strony.
Message SessionInfo zawiera:
- ID operacji eksportu oraz jej właściwości.
Status eksportu
- id of the export operation and its properties.
export status.
Code Block |
---|
enum EState
{
S_NONE = 0;
S_RUNNING = 1;
S_COMPLETED = 2;
S_REMOVED = 3;
} |
where the gdzie status S_COMPLETED status does not guarantee that the export was successful.nie oznacza, że eksport zakończył się powodzeniem.
Jeśli istnieją wyniki operacji eksportu, zostanie wysłana wiadomość ResultIf there are export operation results, then a Result message will be received.
Code Block |
---|
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,gdzie:
succeeded - indicates that the export was successfulmówi, że operacja eksportu została zakończona powodzeniem;
- 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:
- określa listę plików gotowych do pobrania, wliczając w to warunkową ścieżkę do użytku w metodzie DownloadFile, oraz ich wielkość.
Po zmianie statusu operacji eksportu na S_COMPLETED, limit czasu na pobranie plików z Serwera to 1 godzina. Timeout jest resetowany do zera po wykonaniu jednej z metod: GetSessionState lub DownloadFile.
Jeśli timeout zostanie przekroczony, pliki zostaną usunięte z Serwera.
Metoda GetSessionState
ID operacji eksportu jest przekazywane przy tej metodzie.
Status EState zostanie przekazany w odpowiedzi na tę metodę.
Jeśli istnieją wyniki operacji eksportu, wiadomosć Result zostanie wysłana.
Metoda StopSession
ID operacji eksportu jest przekazywane przy tej metodzie.
Zaktualizowany status EState zostanie przekazany w odpowiedzi na tę metodę.
Metoda DownloadFile
Metoda ta może zostać użyta tylko w sytuacji, gdy operacja eksportu została już wykonana.
Następujące dane są przekazywane w tej metodzie:
- ID operacji eksportu;
- ścieżka do pliku
- export operation id;
- path to the file;
- chunk_size_kb - data block sizewielkość bloku danych;
- 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
- numer seryjny bloku danych.
W odniesieniu do tej metody wiadomości FileChunk zostaną przesłane wraz z blokami danych plików, które będą przesyłane, aż cały plik zostanie pobrany.
Metoda DestroySession
ID operacji eksportu jest przekazywane w tej metodzieThe id of the export operation is passed in the method.