Local archive export

Local archive export starts exporting a TRASSIR archive and saves the output file to the screenshot folder. TRASSIR supports several methods of the local archive export:

  • Methods performed using the operator's interface object.

    Examples of the requests without flexible export parameters setting option:

        https://192.168.1.200:8080/objects/operatorgui_jmxwAqxm/archive_export?channel_name_or_guid=HsnnGa9B&start_time_YYYYMMDD_HHMMSS=2014-11-26 17:34:00&end_time_YYYYMMDD_HHMMSS=2014-11-26 17:35:00&filename=export.avi&archive_on_device=0&sid=e03qD0eg
        https://192.168.1.200:8080/objects/operatorgui_jmxwAqxm/archive_export_ss?channel_name_or_guid=HsnnGa9B&start_time_YYYYMMDD_HHMMSS=2014-11-26 17:34:00&end_time_YYYYMMDD_HHMMSS=2014-11-26 17:35:00&filename=export.avi&archive_on_device=0&sid=e03qD0eg   

    Example of a request with flexible export parameters setting option:

        https://192.168.1.200:8080/objects/operatorgui_jmxwAqxm/archive_export_ex?channel_name_or_guid=HsnnGa9B&start_time_YYYYMMDD_HHMMSS=2014-11-26 17:34:00&end_time_YYYYMMDD_HHMMSS=2014-11-26 17:35:00&filename=export.avi&sid=e03qD0eg&options={"is_hardware": 0, "video_codec": "MPEG4", "video_bitrate":3000}   

    Important

    Methods of local archive export performed using operator's interface object do not operate under the following conditions:

    • the method runs on a "blind" TRASSIR OS server (with inactive operator's interface);
    • the method runs on Windows server with TRASSIR OS started as a service.
  • The method executed using the channel object. This method does not depend on the operator interface availability. It can be run on any server.

    Examples of a request:

        https://192.168.1.200:8080/objects/CKq5LLiO/export_archive?start_time_YYYYMMDD_HHMMSS=2014-11-26 17:34:00&end_time_YYYYMMDD_HHMMSS=2014-11-26 17:35:00&filename=export.avi&sid=e03qD0eg&options={"is_hardware": 1}   

Key elements of a request:

  • archive_export, archive_export_ss - commands to call export of main or sub stream archive;
  • archive_export_ex, [channel_GUID]/export_archive - the command to call the customizable archive export of any stream;
  • operatorgui_[interface_GUID] - operator interface id;
  • channel_name_or_guid=[GUID_channel] - identifier of a channel from which an export is made;
  • start_time_YYYYMMDD_HHMMSS=2014-11-26 17:34:00 - date and time of export start;
  • end_time_YYYYMMDD_HHMMSS=2014-11-26 17:35:00 - date and time of export finish;
  • filename=[file_name.avi] - file name;
  • archive_on_device=0 - select archive source:

    • 0 - TRASSIR archive;
    • 1 - device archive.
  • options={[parameters]} - a set of export parameters in JSON format:

    "is_hardware" - select archive source:

    • 0 - TRASSIR archive (default);
    • 1 - device archive.

    "want_ss" - select stream:

    • 0 - main stream (default);
    • 1 - sub stream.

    "video_codec" - select export file video codec:

    • "" - without transcoding (default);
    • "MPEG4" - transcode to MPEG4;
    • "WMV" - transcode to WMV (not supported by TRASSIR OS).

    "video_resolution" - select video stream resolution (in case the transcoding is used):

    • "" - original video stream resolution (default);
    • "2560x1920", "1920x1080", "1600x1200", "1280x1024", "1280x960", "1280x720", "1024x768", "800x600", "720x576", "704x576", "640x480", "352x288", "320x240", "176x144" - variations of resolutions.

    "video_bitrate" - select exported file bitrate (in case the transcoding is used):

    • 200, 400, 600, 800, 1000, 2000, 2500, 3000, 5000, 7500, 10000, 16000 - bitrate variations.

    "audio_codec" - select audio codec for exported audio file:

    • "" - without transcoding (default);
    • "No audio" - sound off;
    • "PCM" - transcode to PCM;
    • "WMA" - transcode to WMA (not supported in TRASSIR OS).

    "audio_bitrate" - select exported file audio stream bitrate (in case the transcoding to WMA is used):

    • 64, 128 - bitrate variations.

    "need_channel_name_watermark" - print channel name on video:

    • 0 - do not print (default);
    • 1 - print.

    "need_timestamp_watermark" - print date and time on video:

    • 0 - do not print (default);
    • 1 - print.

    "watermark_align" - position of the text on video:

    • 1 - left upper corner default);
    • 2 - right upper corner;
    • 3 - left lower corner;
    • 4 - right lower corner.

    video "need_fliprotate" - flip and rotate:

    • 0 - do not use (default);
    • 1 - use.

    "watermark_need_figures" - print figures or subtitles on video:

    • 0 - do not print (default);
    • 1 - print.
  • sid=[id_session] - id of a session in which a request is being processed (see example Get a session ID).

Tip

The time is indicated according to time zone configured on the server.

Example of a server response:

{
    "success" : "1",
} 

Commands for managing local export tasks

Request for current local export tasks

Example of a request:

    https://192.168.1.200:8080/export_tasks?sid=e03qD0eg 

Key elements of the request:

  • sid=[id_session] - id of a session in which a request is being processed (see example Get a session ID).

Example of a server response:

[{
	"additional_data" : "{\n\t\"extras\" : \n\t{\n\t\t\"bluring\" : false,\n\t\t\"class_detection\" : \"head\",\n\t\t\"need_research_detectors\" : false\n\t}\n}\n",
	"created_ts" : "1571922911615786",
	"export_finish_ts" : "0",
	"export_start_ts" : "1571922911615786",
	"filename" : "C:/DSSL/Trassir-4.1/shots/TR-D8121WDIR2v2 1_20191024-132119--20191024-132727.avi",
	"fragments" :
	[

			{
				"channel" : "qK30lb5k_OsnJuSGv",
				"end_ts" : "1571911565998605",
				"filename" : "",
				"start_ts" : "1571911180998846"
			},
			{
				"channel" : "qK30lb5k_OsnJuSGv",
				"end_ts" : "1571912847980932",
				"filename" : "",
				"start_ts" : "1571912479981939"
			}

	],
	"id" : "uzbijs1A",
	"out_format" : 0,
	"postponed_until_ts" : "1571922910083000",
	"progress_percent" : "30",
	"state" : 1,
	"state_desc" : "in_progress"
}] 

The response in the given example contains the following:

  • "additional_data" - a set of parameters of local export task;
  • "created_ts" - local export task creation time;
  • "export_start_ts" - local export task start time;
  • "export_finish_ts" - local export task completion time;
  • "filename" - file name and path (in case several fragments are being exported);
  • "fragments" - the list of exported fragments:

    • "channel" - unique channel id in [channel_GUID]_[server_GUID] format;
    • "start_ts" - exported fragment start time;
    • "end_ts" - exported fragment finish time;
    • "filename" - file name and path (in case a signal fragment is being exported);
  • "id" - local export task unique identifier;
  • "out_format" - export file format (0 - AVI, 1 - TRAVI);
  • "postponed_until_ts" - time of scheduled task start (in case the postponed export is used);
  • "progress_percent" - task completion percentage;
  • "state" - task state:

    • 0 - the task is waiting;
    • 1 - the task is in progress;
    • 2 - the task is completed.
  • "state_desc" - state description:

    • "postponed" - the task is pending;
    • "in_progress" - the task is in progress;
    • "completed" - the task is completed.

Tip

The time is in microseconds in UNIX time format based on the timezone configured on server.

Request for local export task removal

Example of a request:

    https://192.168.1.200:8080/export_cancel?sid=e03qD0eg&task_id=uzbijs1A 

Key elements of the request:

  • sid=[id_session] - id of a session in which a request is being processed (see example Get a session ID);
  • task_id=[task_id] - local export task unique id.

Example of a server response:

{
    "success" : "1"
}