Go to documentation repository
Documentation for Intellect 4.10.4. Documentation for other versions of Intellect is available too.
Previous page Next page
Video stream is received from the archive in the same format as live video.
Essential video frame fields when using the archive:
file.name – the value of this field is to be saved to navigate through the archive (frame-by-frame viewing, viewing by records, etc.)
frm.total – total frames in the record
frm.id - id of current frame in the record (starts at 0)
Information on the records in the archive is sent using Msg:
- Msg=start\n
type=CAM\n
id=1\n
action=SET_INTERVALSREC\n
intervals=14-05-08 14:06:25 14-05-08 14:06:26;14-05-08 14:06:30 14-05-08 14:06:31;\n
Msg=end\n - Msg=start\n
type=CAM\n
id=1\n
action=SET_INTERVALSREC\n
intervals=14:06:25 14:06:26;14:06:30 14:06:31;\n
date=14-05-08
Msg=end\n
In both cases the information in messages is the same, though formatted in different ways.
Information on the beginning and ending of the record is comma-separated, information on records is semi-colon separated.
day-month-year hours:minutes:seconds
14-05-08 14:06:25 14-05-08 14:06:26
If the value of the intervals parameter is empty, then there are no records on this day.
If you have the list of records in the archive, as well as file.name, file.id and the set of commands below, you can make a kind of player on the client (pause, stop, forward/backward playback, etc.)
Entering the archive - arc.enter
GET
http://example.com:[port][/somecontext]/secure/video/action.do?version=4.7.8.0&sessionid=29101F1&cam.id=5&command=arc.enter&intervals=true&date=15.05.10 09:51:07&login=XXX&password=YYY
command=arc.enter – entering the archive command.
date – date per which the archive is to be received.
intervals – send information on records in the archive (the beginning and ending of the record).
After entering the archive, the client gets the message with intervals and and 1 (one frame).
Playing back one record in the archive - "arc.play"
GET
http://example.com:[port][/somecontext]/secure/video/action.do?version=4.7.8.0&sessionid=29101F1&cam.id=5&command=arc.play&file.name=C%3A%5CVIDEO%5C20-05-10%2016%5C0._01&frame.id=0&login=XXX&password=YYY
file.name is taken from the received video frame, frame.id – frame starting at which the archive is to be played back.
Sequence of frames from the part of record is received; playback stops (this can be tracked by frame.id).
Non-stop playing back records in the archive - "arc.playnonstop"
GET
http://example.com:[port][/somecontext]/secure/video/action.do?version=4.7.8.0&sessionid=29101F1&cam.id=5&command=arc.playnonstop&file.name=C%3A%5CVIDEO%5C20-05-10%2016%5C0._01&frame.id=0&login=XXX&password=YYY
The command is the same as "arc.play", but the player does not stop at one record – it keeps playing back the records in the archive. Do not forget to update file.name and intervals that will be changed from time to time.
Playback stops when all the records are played back.
Going to one frame or one record backward - "arc.prev"
GET
http://example.com:[port][/somecontext]/secure/video/action.do?version=4.7.8.0&sessionid=29101F1&cam.id=5&command=arc.prev&file.name=C%3A%5CVIDEO%5C20-05-10%2016%5C0._01&frame.id=0&login=XXX&password=YYY
If the frame.id parameter is specified, then system looks for the previous frame in the archive and sends it. If this parameter is not specified, then the first frame of the previous record is received.
Only one frame is sent in response.
Note.
When the beginning of the archive is reached and there are no records, then the following message is received:
Msg=start\n
type=CAM\n
id=1\n
action=ARCH_ERROR\n
Msg=end\n
Going to one frame or one record forward - "arc.next"
GET
http://example.com:[port][/somecontext]/secure/video/action.do?version=4.7.8.0&sessionid=29101F1&cam.id=5&command=arc.next&file.name=C%3A%5CVIDEO%5C20-05-10%2016%5C0._01&frame.id=0&login=XXX&password=YYY
If the frame.id parameter is specified, then system looks for the next frame in the archive and sends it. If this parameter is not specified, then the first frame of the next record is received
Only one frame is sent in response.
Note.
When the end of the archive is reached and there are no records, then the following message is received:
Msg=start\n
type=CAM\n
id=1\n
action=ARCH_ERROR\n
Msg=end\n
Stopping playback - "arc.stop"
GET
http://example.com:[port][/somecontext]/secure/video/action.do?version=4.7.8.0&sessionid=29101F1&cam.id=5&command=arc.stop&login=XXX&password=YYY
Getting the list of records
GET
http://example.com:[port][/somecontext]/secure/archive/CAM:2/[2011-12-30|2011-12][?splitTreshold=50]
splitTreshold – if the difference between the ending of the previous record and beginning of the next record and ending is less than this number (in milliseconds), then records are merged into one. In order not to merge any records, set splitTreshold=0. By default the value is 50.
For the server time is interpreted as local.
Sample. Records per day (December 30, 2011):
http://example.com:[port][/somecontext]/secure/archive/CAM:2/2011-12-30/
http://example.com:[port][/somecontext]/secure/archive/CAM:2/2011-12-01/
Sample of response:
XML:
<?xml version="1.0" encoding="UTF-8"?>
<days>
<day>
<id>2011-09-01T00:00:00-05:00</id>
<records>
<from>2011-09-01T00:00:00-05:00</from>
<to>2011-09-01T00:00:35-05:00</to>
</records>
<records>
<from>2011-09-01T00:00:35-05:00</from>
<to>2011-09-01T00:01:10-05:00</to>
</records>
</day>
</days>
JSON:
[ {
"id" : "2011-09-01T00:00:00-0500",
"records" : [ {
"from" : "2011-09-01T00:00:00-0500",
"to" : "2011-09-01T00:00:35-0500"
}, {
"from" : "2011-09-01T00:00:35-0500",
"to" : "2011-09-01T00:01:10-0500"
}, {
"from" : "2011-09-01T01:26:24-0500",
"to" : "2011-09-01T01:26:59-0500"
} ]
} ]
Sample. Records per month (shows the days in September when there are records):
http://example.com:[port][/somecontext]/secure/archive/CAM:2/2011-12/
XML:
<?xml version="1.0" encoding="UTF-8"?>
<days>
<day>
<id>2011-09-02T00:00:00-05:00</id>
</day>
<day>
<id>2011-09-03T00:00:00-05:00</id>
</day>
<day>
<id>2011-09-05T00:00:00-05:00</id>
</day>
</days>
JSON:
[ {
"id" : "2011-09-01T00:00:00-0500",
"records" : [ ]
}, {
"id" : "2011-09-03T00:00:00-0500",
"records" : [ ]
}, {
"id" : "2011-09-01T00:00:00-0500",
"records" : [ ]
} ]
If there are no records, then
XML:
<days/>
JSON:
[]