Important
You can manage an archive only after receiving the stream by the following algorithm:
- Execute Token request with stream=archive_main or stream=archive_sub.
- By Token execute the stream request.
- Using archive management commands set the playback starting point and start video playback.
Examples of a request:
-
Play an archive fragment
https://192.168.1.200:8080/archive_command?command=play&start=20180117T110734&stop=20180117T110834&speed=1&sid=e03qD0eg&token=P2FYkjcP
-
Stop the playback
https://192.168.1.200:8080/archive_command?command=stop&sid=e03qD0eg&token=P2FYkjcP
-
Move a certain time period towards the closest archive segment
https://192.168.1.200:8080/archive_command?command=seek×tamp=20180117T110734&direction=0&sid=e03qD0eg&token=P2FYkjcP
-
Move to the next frame of the archive segment
https://192.168.1.200:8080/archive_command?command=frame_next&sid=e03qD0eg&token=P2FYkjcP
-
Move to the previous frame of the archive segment
https://192.168.1.200:8080/archive_command?command=frame_prev&sid=e03qD0eg&token=P2FYkjcP
-
Move to the first frame of the archive segment
https://192.168.1.200:8080/archive_command?command=frame_first&sid=e03qD0eg&token=P2FYkjcP
-
Move to the last frame of the archive segment
https://192.168.1.200:8080/archive_command?command=frame_last&sid=e03qD0eg&token=P2FYkjcP
Key elements of the request:
- command=[command] - The archive control command:
- stop - Stop archive playback;
- play - Being archive playback;
- seek - Seek through the archive;
- next - Skip to the next archive segment;
- prev - Skip to the previous archive segment;
- frame_first - Skip to the first frame of the archive segment;
- frame_last - Skip to the last frame of the archive segment;
- frame_next - Skip to the next frame of the archive segment;
- frame_prev - Skip to the previous frame of the archive segment.
- start=[date and time] and stop=[date and time] - date and time of the beginning and the end of the playing archive fragment;
- speed=[number] - archive playback speed ( from 1 to 16);
- timestamp=[date and time] - date and time of the archive segment playback start;
- direction=[number] - the search direction of the closest archive fragment:
- 1 - search for the closest frame in front of the date on the timestamp;
- -1 - search for the closest frame behind the date on the timestamp;
- 0 - search for the closest frame in both directions from the date on the timestamp.
- sid=[session_id] - The identifier for the session in which the request is being made (see Get a session ID);
- token=[Token] - The video's unique Token (see Getting video and audio streams).
Tip
The date and time should be submitted in one of the following formats:
- YYYY-MM-DD HH:MM:SS
- YYYY-MM-DDTHH:MM:SS
- YYYYMMDD-HHMMSS
- YYYYMMDDTHHMMSS
- and also in UNIX (10 characters) and TIMESTAMP (16 characters) formats.
Example of a server response:
{ "success" : "1", }