Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section


Column
width35%


Panel
borderColor#CCCCCC
bgColor#FFFFFF
titleBGColor#F0F0F0
borderStylesolid
titleНа странице:
Table of Contents



Column

General information

The export is described in the proto files ExportService.proto and Export.proto.

The following 6 methods are used for export:

  1. ListSessions − is used to get a list of all export operations.
  2. StartSession − to start a new export operation.
  3. GetSessionState − to get the status of a specific operation.
  4. StopSession − to stop the operation.
  5. DestroySession − to delete the operation along with the export results.
  6. 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



일반 정보

내보내기는 proto 파일인 ExportService.proto와 Export.proto에 설명되어 있습니다.

내보내기에는 다음의 6가지 메소드가 사용됩니다.

  1. ListSessions − 모든 내보내기 작업의 목록을 가져오는 데 사용됩니다.
  2. StartSession − 새 내보내기 작업을 시작하는 데 사용됩니다.
  3. GetSessionState − 특정 작업의 상태를 가져오는 데 사용됩니다.
  4. StopSession − 작업을 중지하는 데 사용됩니다.
  5. DestroySession − 작업과 내보내기 결과를 삭제하는 데 사용됩니다.
  6. DownloadFile − 내보내기 결과를 다운로드하는 데 사용됩니다.

내보내기 작업은 gRPC 채널이 아닌 내보내기 에이전트에 의해 수행됩니다. 현재 gRPC API를 통해 내보내기 에이전트를 생성하는 것은 불가능하며, 클라이언트에서 수동으로만 생성할 수 있습니다.

적어도 하나의 내보내기 에이전트가 생성되면 이를 사용하여 작업을 수행할 수 있습니다. 여러 개의 내보내기 에이전트가 있고 StartSession 메소드에서 특정 에이전트를 명시하지 않으면, 인덱스 1인 에이전트가 사용됩니다.

내보내기 작업은 카메라가 위치한 노드에서 시작됩니다. 여러 카메라에 대해 내보내기가 시작되면 첫 번째 노드가 사용됩니다. 각 노드에 연결할 필요는 없으며 작업은 자동으로 해당 노드로 전달됩니다.

내보내기 결과는 로컬 Axxon One 서버에서 생성되며 DownloadFile 메소드를 사용하여 파일을 다운로드함으로써 결과를 전달할 수 있습니다. 이 메소드는 파일의 임의 위치에서 다운로드를 지원합니다.

StartSession 메서드

이 메소드는 옵션 메시지에 설명된 내보내기 옵션을 전달합니다The method passes the export options, which are described in the Options message.

Expand
titleClick to 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여기서,

  • oneofimplies the selection of one property that can be set in this operation이 연산에서 설정할 수 있는 속성 중 하나를 선택함을 의미합니다.
  • export_agent_access_pointexport agent 내보내기 에이전트 id.

Using the combination of mode and output_type , you can create 4 export types:유형의 조합을 사용하여 4가지 내보내기 유형을 생성할 수 있습니다.

  1. LiveMode + SnapshotType − export a frame from live video.실시간 비디오에서 프레임을 내보냄
  2. LiveMode + StreamType − export a video clip from live video.실시간 비디오에서 비디오 클립을 내보냄
  3. ArchiveMode + SnapshotType − export a frame from archive.아카이브에서 프레임을 내보냄
  4. 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., StreamType 메시지에는 각 내보내기 유형에 대한 파라미터가 포함되어 있습니다. CommonSetting 메시지는 내보내기 작업에 대한 일반 설정을 전달하는 데 사용됩니다.

주요 내보내기 파라미터 목록The list of main export parameters:

Expand
titleClick to expand...


Parameter파라미터Export type내보내기 유형Description설명
Options max_file_sizeExport a video clip비디오 클립 내보내기최대 파일 크기 (Maximum file size (see 내보내기 옵션 구성 참조).
Options export_agent_access_pointAll모두Export agent 내보내기 에이전트 id.
StreamType formatExport a video clip비디오 클립 내보내기출력 파일 형식Output file format.
SnapshotType formatExport a frame프레임 내보내기출력 파일 형식Output file format.
ArchiveMode/LiveMode Source originAll모두Video source (see Get video cameras list and their parameters using gRPC API methods 비디오 소스 (gRPC API 메서드를 사용하여 비디오 카메라 목록과 그 매개변수 가져오기 (DomainService) 참조).
ArchiveMode Source storagesExport from archive아카이브에서 내보내기Archive (see Get video cameras list and their parameters using gRPC API methods 아카이브 (gRPC API 메서드를 사용하여 비디오 카메라 목록과 그 매개변수 가져오기 (DomainService) 참조).
ArchiveMode start_timestampExport from archive아카이브에서 내보내기인터벌 시작 타임스탬프Timestamp of the export interval start.
ArchiveMode end_timestampExport from archive아카이브에서 내보내기인터벌 종료 타임스탬프Timestamp of the export interval end.
CommonSetting commentAll모두Comment.코멘트
CommonSetting timestamp_formatAll모두타임스탬프 형식Timestamp format.
CommonSetting text_placeAll모두코멘트 위치Place for comment.
CommonSetting text_colorAll모두코멘트 텍스트 색상Comment text color.
CommonSetting burn_subtitleAll모두Text overlay (yes or no).텍스트 오버레이 (예 또는 아니오)
CommonSetting apply_maskAll모두Mask overlay (yes or no).마스크 오버레이 (예 또는 아니오)
StreamSetting video_qualityExport a video clip비디오 클립 내보내기비디오 스트림 품질Video stream quality.
StreamSetting video_codecExport a video clip비디오 클립 내보내기비디오 코덱Video codec.
StreamSetting audio_qualityExport a video clip비디오 클립 내보내기오디오 스트림 품질Audio stream quality.
StreamSetting audio_codecExport a video clip비디오 클립 내보내기오디오 코덱Audio codec.
StreamSetting frame_frequencyExport a video clip비디오 클립 내보내기프레임 빈도Frame frequency.
SnapshotSetting pdf_layoutExport a frame프레임 내보내기PDF file orientation.파일 방향
SnapshotSetting snapshot_placeExport a frame프레임 내보내기PDF 파일 내 프레임 위치Frame location in the PDF file.
SnapshotSetting comment_placeExport a frame프레임 내보내기PDF 파일 내 코멘트 위치Comment location in the PDF file.
SnapshotSetting timestamp_placeExport a frame프레임 내보내기PDF 파일 내 타임스탬프 위치Timestamp location in the PDF file.
SourceSetting crop_areaAll모두Export area 내보내기 영역 (see 내보내기 영역 및 마스크 구성 참조).
SourceSetting mask_spaceAll모두Mask.마스크
SourceSetting text_placeAll모두코멘트 위치Place for comment.
SourceSetting text_colorAllComment 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:

모두코멘트 텍스트 색상


각 내보내기 유형에는 GetSessionState 메서드가 실행되지 않은 경우 작업이 중지되는 시간 제한이 있습니다.

시간 제한은 내보내기 작업이 시작된 시점과/또는 마지막으로 GetSessionState 메서드가 실행된 시점부터 계산됩니다.

라이브 비디오에서 비디오 클립을 내보내는 경우 시간 제한은 5분이며, 다른 모든 내보내기 유형은 30분입니다.

내보내기 작업의 ID는 이 메서드에 대한 응답으로 받게 됩니다.

ListSessions 메서드

각 내보내기 작업에 대한 SessionInfo 메시지가 이 메서드의 응답으로 제공됩니다. 하나의 응답으로 모든 작업을 처리할 수 없는 경우, 다음 페이지를 위한 next_page_token도 함께 제공됩니다.

SessionInfo 메시지에는 다음 내용이 포함됩니다.

  1. 내보내기 작업의 ID와 해당 속성들
  2. 내보내기 상태

  3. id of the export operation and its properties.
  4. export status.

    Code Block
    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.상태는 내보내기가 성공적이었음을 보장하지 않습니다.

  5. 내보내기 작업 결과가 있는 경우, Result 메시지가 응답으로 제공됩니다If 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여기서,

    1. succeeded − indicates that the export was successful;내보내기가 성공했음을 나타냅니다.

    2. 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:

    1. 다운로드할 준비가 된 파일 목록을 설명하며 DownloadFile에 사용할 경로와 파일 크기가 포함됩니다.

내보내기 작업 상태가 S_COMPLETED로 변경되면, 서버에서 파일을 다운로드할 수 있는 시간은 1시간입니다. GetSessionStateDownloadFile 메서드가 실행되면 타임아웃은 다시 초기화됩니다.

타임아웃이 초과되면 파일은 서버에서 삭제됩니다.

GetSessionState 메서드

내보내기 작업의 ID가 이 메서드에 전달됩니다.

응답으로 해당 EState 상태가 반환됩니다.

내보내기 작업 결과가 있는 경우, 결과 메시지가 반환됩니다.

StopSession 메서드

내보내기 작업의 ID가 이 메서드에 전달됩니다.

응답으로 해당 EState 상태가 업데이트된 상태로 반환됩니다.

DownloadFile 메서드

이 메서드는 내보내기 작업이 완료된 후에만 사용할 수 있습니다.

이 메서드에 전달되는 데이터는 다음과 같습니다.

  1. 내보내기 작업 id
  2. 파일 경로
  3. export operation id;
  4. path to the file;
  5. chunk_size_kb − data block size;데이터 블록 크기
  6. 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

  1. 데이터 블록의 일련 번호

이 메서드에 응답으로, 전체 파일이 다운로드될 때까지 파일 데이터 블록을 포함한 FileChunk 메시지가 전송됩니다.

DestroySession 메서드

내보내기 작업의 ID가 이 메서드에 전달됩니다.The id of the export operation is passed in the method.