Versions Compared

Key

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

...

Code Block
https://[IP address or hostname]:[port]/video/

WILL BE DEPRECATED IN NEXT RELEASE, USE /channels

Returns stored video from the camera with the given camera number and options (start time, end time, length, framerate, and/or resolution). Note: Datetime values are formatted according to the ISO 8601 specification: YYYY-MM-DDTHH:MM:SS For example, 2012-12-05T13:40:27. For more information, see this article from the W3C W3.org: Date and Time Formats.

...

The exchange between client and server is shown here:

...

All exchanges are secure using HTTP BASIC authentication. The user names and passwords must match users that have been added to your 3VR system using System Manager.

Query Format

To perform the query, the client POSTs the predicate XML to the URL https://[host name]:8080/rss/ where the XML is passed as the URL encoded argument "queryxml" in the request body. (Your programming environment probably has helper functions to perform this POST operation for you. See the sample and helper code for some examples.) The predicate XML will look something like this (the details of each element will be explained in later sections):

Code Block
languagexml
<?xml version="1.0" encoding="utf-8"?>
<Predicate>
<AndPredicate name="and" isEnabled="True" id="" DistinctIndividualQueries="False">
<ComparisonPredicate name="=" isEnabled="True" id="" DistinctIndividualQueries="False">
<FacetOperand reference="EventType" />
<Comparison operation="=" />
<ValueOperand type="System.Int" value="1" />
</ComparisonPredicate>
<ComparisonPredicate name="=" isEnabled="True" id="" DistinctIndividualQueries="False">
<FacetOperand reference="Channel.Id" />
<Comparison operation="=" />
<ValueOperand type="System.Int32" value="1" />
</ComparisonPredicate>
<ComparisonPredicate name="&gt;=" isEnabled="True" id="" DistinctIndividualQueries="Fal
se">
<FacetOperand reference="starttime" />
<Comparison operation="&gt;=" /> <RelativeValueOperand type="System.TimeSpan"
value="0:30:0" />
</ComparisonPredicate>
</AndPredicate>
</Predicate>

Query Response

The 3VR appliance will return up to 50 matching events per query. The response will be an RSS 2.0 formatted XML document, like this:

Code Block
languagexml
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:dc="http://purl.org/dc/
elements/1.1/">
<channel>
<title>3VR Events</title>
<link>https://<3vr-server>:8080/index.xml?allalerts=</link>
<description>Events matching the descriptions</description>
<pubDate>8/3/2007 4:50:43 PM</pubDate>
<lastBuildDate>8/3/2007 4:50:43PM</lastBuildDate>
<item>
<title>8/3/2007 4:47:15 PM - 8/3/2007 4:47:49 PM: Motion Event on Camera Camera 1</
title>
<link>http://<3vr-server>:80/event/id</link>
<description>&lt;img alt=http://<3vr-server>:80/images/3 _ 8 _ 2007/23/eventtype _ 1/0/1/
images1.24.MFA src="http://<3vr-server>:80/images/3 _ 8 _ 2007/23/eventtype _ 1/0/1/images1.24.
MFA" width=120 height=80&gt;&lt;img alt=http://<3vr-server>:80/images/3 _ 8 _ 2007/23/eventtype
_ 1/0/1/images1.25.MFA src="http://<3vr-server>:80/images/3 _ 8 _ 2007/23/eventtype _ 1/0/1/
images1.25.MFA" width=120 height=80&gt;&lt;img alt=http://<3vr-server>:80/images/3 _ 8 _ 2007/23/
eventtype _ 1/0/1/images1.26.MFA src="http://<3vr-server>:80/images/3 _ 8 _ 2007/23/eventtype
_ 1/0/1/images1.26.MFA" width=120 height=80&gt;</description>
<pubDate>4:50 PM</pubDate>
</item>
</channel>
</rss>

Most of this XML is intended to allow reasonable output when viewing this XML in a browser. As a programmer, the tag that you're most interested in is the <link> tag under <item>. Each of these contains the URL for the detailed information about that event.

To retrieve the event information, use an HTTP GET command with that URL. The result will be an XML document that looks like this:

Code Block
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="/eventstylesheet.xsl"?>
<ThreeVRExport version="6.0" date="8/6/2007 10:13:25 AM" server="https://<3vr-server>:8080"
ApplianceGuid="fc8ca7c5-83e7-4b8d-af70-b599b5635509">
<ThreeVREventExport>
<EventCollectionExt>
<Events>
<Event XmlReferenceId="14" StartTime="2007-08-03T16:47:15.7640000-07:00" _ Short-
StartTime="8/3/2007 4:47:15 PM" EndTime="2007-08-03T16:47:49.3060000-07:00" _ ShortEnd-
Time="8/3/2007 4:47:49 PM" Status="Closed" Guid="08c12540-7e74-4d58-bf3f-580771130ddb">
<EventType XmlReferenceId="15" Name="Motion" /> <Appliance XmlReferenceId="16"
Name="<3vr-server>" HostAddress="<3vr-server>" Guid="fc8ca7c5-83e7-4b8d-af70-b599b5635509" />
<Channel XmlReferenceId="17" Name="Camera 1" DisplayNumber="1" ChannelType="AnalogCamera"
Description="" Identifier="analogcamera://1" />
<SpecializedEvent>
<MotionEvent XmlReferenceId="18">
<EventDetails>
<MotionEventDetails XmlReferenceId="19" GridHeight="15" GridWidth="22"
GridPixelAspectRatioAdjustment="1.10000002384186" GridPixelAspectRatioNominal="1">
<OriginationByteArray />
<PresenceByteArray>…</PresenceByteArray>
<DirectionByteArray>…</DirectionByteArray>
<TerminationByteArray />
</MotionEventDetails>
</EventDetails>
<BaseEvent>
<Event XmlReferenceId="14" IsReference="True" />
</BaseEvent>
<UserFrames />
<MotionFrames>
<MotionFrame XmlReferenceId="20" IsUserCreated="False" TimeStamp="8/3/2007
4:47:16 PM">
<Picture XmlReferenceId="21" TimeStamp="2007-08-
03T16:47:16.1700000-07:00" _ ShortTimeStamp="8/3/2007 4:47:16 PM" AspectRatioAdjustment="1"
NominalAspectRatio="1" Width="160" Height="120" ImageWidth="160" ImageHeight="120"
IsAnnotated="False" FilePath="https://<3vr-server>:8080/images/3 _ 8 _ 2007/23/eventtype _ 1/0/1/
images1.24.MFA" />
</MotionFrame>
<MotionFrame XmlReferenceId="22" IsUserCreated="False" TimeStamp="8/3/2007
4:47:33 PM">
<Picture XmlReferenceId="23" TimeStamp="2007-08-
03T16:47:33.7850000-07:00" _ ShortTimeStamp="8/3/2007 4:47:33 PM" AspectRatioAdjustment="1"
NominalAspectRatio="1" Width="160" Height="120" ImageWidth="160" ImageHeight="120"
IsAnnotated="False" FilePath="https://<3vr-server>:8080/images/3 _ 8 _ 2007/23/eventtype _ 1/0/1/
images1.25.MFA" />
</MotionFrame> <MotionFrame XmlReferenceId="24" IsUserCreated="False"
TimeStamp="8/3/2007 4:47:35 PM"> <Picture XmlReferenceId="25" TimeStamp="2007-08-
03T16:47:35.3950000-07:00" _ ShortTimeStamp="8/3/2007 4:47:35 PM" AspectRatioAdjustment="1"
NominalAspectRatio="1" Width="160" Height="120" ImageWidth="160" ImageHeight="120"
IsAnnotated="False" FilePath="https://<3vr-server>:8080/images/3 _ 8 _ 2007/23/eventtype _ 1/0/1/
images1.26.MFA" />
</MotionFrame>
</MotionFrames>
<Videos>
<Video XmlReferenceId="26" StartTime="2007-08-03T16:47:15.7480000-07:00"
_ ShortStartTime="8/3/2007 4:47:15 PM" EndTime="2007-08-03T16:47:45.9150000-07:00" _ Short-
EndTime="8/3/2007 4:47:45 PM" ChannelId="1" PixelAspectRatioAdjustment="1.10000002384186"
PixelAspectRatioNominal="1" Width="352" Height="240" VideoFormat="HikvisionH264"
FilePath="https://<3vr-server>:8080/videos/3 _ 8 _ 2007/23/videos/0/1/0.mpg" />
<Video XmlReferenceId="27" StartTime="2007-08-03T16:47:45.9150000-07:00"
_ ShortStartTime="8/3/2007 4:47:45 PM" EndTime="2007-08-03T16:47:56.3240000-07:00" _ Short-
EndTime="8/3/2007 4:47:56 PM" ChannelId="1" PixelAspectRatioAdjustment="1.10000002384186"
PixelAspectRatioNominal="1" Width="352" Height="240" VideoFormat="HikvisionH264"
FilePath="https://<3vr-server>:8080/videos/3 _ 8 _ 2007/23/videos/0/1/1.mpg" />
</Videos>
</MotionEvent>
</SpecializedEvent>
<TriggeredAlerts />
<MetadataElements />
</Event>
</Events>
</EventCollectionExt>
</ThreeVREventExport>
</ThreeVRExport>

Images and videos associated with the event can also be retrieved by their URL as referenced by the <FilePath> elements.