AXIS Object Analytics is a multifeatured video analytics that comes preinstalled on compatible Axis cameras, adding value at no extra cost. It detects and classifies humans, vehicles, and types of vehicles. Thanks to AI-based algorithms and behavioral conditions, it analyzes the scene and spatial behavior of the objects within —all tailored to your specific needs. This scalable, edge-based analytics requires minimum set up and supports various scenarios running simultaneously. Using the camera’s event management system, it integrates with all major video management systems. Designed to enable proactive monitoring you can quickly verify detected events or set up automatic responses and collect data to access actionable insights. 


As of firmware 11.3, it is possible to count objects that cross a virtual tripwire in a defined direction using the Crossline counting (BETA) scenario. An event can be triggered whenever a set number of selected objects have crossed the line. You can set up events and collect data seperately or simultaneously. There are a wide variety of use cases and applications for the object counting data produced by AXIS Object Analytics. The following examples are just a small fraction of the ways in which this information can be leveraged:

  • Gain actionable insights and identify peak traffic hours across different locations  
  • Quantify and evaluate the impact of measures taken on traffic flow
  • Notify personnel when a facility requires maintenance based on usage
  • Analyze visitor trends to optimize resource allocation and reduce costs
  • Understand the flow of movement within areas of interest

Based on open APIs, data can easily be accessed in multiple ways and integrated into third-party apps for visualization and an instant overview. This guide provides important information such as suggested architecture, development examples, and recommended considerations when designing a solution that uses this data.


The integration described in this guide does not have any impact on existing integrations that might be in place with AXIS Object Analytics, as it utilizes a separate scenario within the application known as Crossline counting (BETA). This scenario generates its own events based on objects being counted in addition to the already available events generated by the "Object in area" or "Line crossing" scenarios.

Plan your integration

The ability to visualize the object counting data produced by AXIS Object Analytics in a digestible manner is key to being able to measure and analyze data trends over time to facilitate data-driven decision making. Being edge-based, AXIS Object Analytics processes and analyses live video directly on the camera, eliminating the need for costly servers. This in turn means that the only data leaving the Axis camera is metadata describing details about the objects that have been counted. This greatly reduces the number of components necessary to design a solution capable of visually presenting the information in graphs or dashboards.

In its simplest form, the components of such a solution could be as follows:

crossline counting components example 1. Publishing 2. MQTT broker 3. Visualization

In this example architecture, an Axis camera running AXIS Object Analytics sends event driven metadata each time an object has been counted to a MQTT cloud broker, where the data can then be stored in a database component for storing and further processing. A data visualization or business intelligence platform retrieves the stored data as often as necessary and visually presents it in graphs and dashboards. 

The components making up this type of solution can of course vary drastically from one project to another based on customer specific needs and requirements. 

Develop your integration


  • To develop this solution, you will need access to a camera that supports AXIS Object Analytics and the Crossline counting (BETA) scenario. See compatible products.

Object count event payload

Assuming that you have already configured a Crossline counting (BETA) scenario within AXIS Object Analytics, the scenario will generate a stateless event containing metadata about the type of object that was counted as well as aggregated counts for each of the selected object classes since the time of last reset. For information on how to configure a Crossline counting (BETA) scenario, please visit the application manual.

  • Scenarios can be configured via AXIS Object Analytics API, but counting scenarios will not be part of the VAPIX library until the beta tag is removed. 


Example payload in XML format of the event generated by AXIS Object Analytics - Crossline counting scenario in event stream sent over RTSP/RTP:

<tt:MetadataStream xmlns:tt="">
  <tt:Event xmlns:tt="">
    <wsnt:NotificationMessage xmlns:tns1="" xmlns:tnsaxis="" xmlns:wsnt="" xmlns:wsa5="">
      <wsnt:Topic Dialect="">tnsaxis:CameraApplicationPlatform/ObjectAnalytics/Device1Scenario1</wsnt:Topic>
        <tt:Message UtcTime="2023-01-16T12:46:07.800792Z">
            <tt:SimpleItem Name="startTime" Value="2023-01-15T23:00:00Z" />
            <tt:SimpleItem Name="totalTruck" Value="1258" />
            <tt:SimpleItem Name="reason" Value="car" />
            <tt:SimpleItem Name="totalCar" Value="18345" />
            <tt:SimpleItem Name="total" Value="19723" />
            <tt:SimpleItem Name="totalUnknown" Value="0" />
            <tt:SimpleItem Name="totalBus" Value="120" />
            <tt:SimpleItem Name="totalMotorcycle/bicycle" Value="0" />

Example payload in JSON format of the event generated by AXIS Object Analytics - Crossline counting scenario sent over MQTT:

"topic": "axis:CameraApplicationPlatform/ObjectAnalytics/Device1Scenario1",
"timestamp": 1670518346712,
"serial": "ACCC8EF1E944",
   "message": { "source": {},
   "key": {},
   "data": {   
       "startTime": "2022-12-06T22:01:25Z",
       "totalBus": "0",    "total": "20960",
       "totalTruck": "2857",
       "totalCar": "18103",
       "totalUnknown": "0",
       "reason": "car",
       "totalMotorcycle/bicycle": "0",
       "totalHuman": "0"

Description of the metadata fields:

Field Description
topic Topic specifying the application scenario that produced the event.
timestamp Timestamp at which the event was generated.
serial MAC address of the device.
message An array containing information about the event.
message.source N/A
message.key N/A An array containing the counting data information. Time at which the counting started - e.g. time of last data reset. Number of objects of type bus class counted since time of last reset. Accumulated number of objects of all classes counted since time of last reset. Accumulated number of objects of type truck class counted since time of last reset. Accumulated number of objects of type unknown class counted since time of last reset. Type of object responsible for triggering the event. Accumulated number of objects of type motorcycle/bicycle class counted since time of last reset. Accumulated number of objects of type human class counted since time of last reset.

The accumulated number of counts can be reset in two ways within the Crossline counting (BETA) scenario. Manually, by clicking on the "Reset counts" button, or automatically every day at midnight by clicking the "Reset counts at midnight" button. If none of these options are selected, the accumulated number of counts will never reset.

Passthrough threshold event

If the Passthrough threshold feature has been configured, the Crossline counting (BETA) scenario will also generate a stateful event whenever the number of objects exceeds the amount specified within the application. This event does not contain metadata about the classified objects and is primarily used to alert staff or operators to take action when this condition is met. For example, within facility management to perform maintenance when 100 people have been counted.  

crossline counting settings in GUI

Subscribe to the event stream

The object counting metadata can be accessed using the following methods:

Event data streaming: 

  • The event topic axis:CameraApplicationPlatform/ObjectAnalytics/Device1Scenario1 should be used to subscribe to the specific events generated by the Crossline counting (BETA) scenario. The scenario number used in the event topic needs to match the Crossline counting scenario number that has been configured within AXIS Object Analytics. So, Scenario1 in the event topic corresponds to the first Crossline counting (BETA) scenario configured in AXIS Object Analytics and Scenario2 would correspond to the second one. Please see an example below. Other scenarios such as Object in area or Line crossing will not contain the object count metadata described in the previous section.
scenario example in user interface

A client may receive event notifications by subscribing to specific events in the stream. The event stream is sent over RTSP/RTP. Events emitted by Axis products are in XML format and follows the ONVIF standard. Please visit the VAPIX Event data streaming documentation which describes how to query the Axis product for supported events, how to subscribe to the event stream and how to interpret the response.

To avoid overloading the Axis product, only subscribe to the events interesting to the client or application. Do not subscribe to more events than necessary. Event subscriptions start internal services in the Axis product and may cause performance problems.


  • The MQTT client in AXIS OS can simplify integration of data and events produced in the device to systems that are not video management software (VMS). Using the Crossline counting (BETA) scenario as a trigger condition within an MQTT publish event allows subscribed clients to receive the object count metadata included in the payload of each event generated. This guide does not provide an overview of the MQTT protocol or specific configuration of the MQTT client on the camera. To find out more about these topics, please visit Device integration with MQTT and VAPIX MQTT Client API.

Start implementing

You now posses the necessary information to develop a solution that enables visualization of the counting data produced by the Crossline counting (BETA) scenario. As previously alluded to, the components making up such a solution can vary drastically depending on the specific needs of your project. In most cases, the data will be stored in a database type component which can be queried regularly to extract the data of interest and visually present it in graphs or dashboards. In other cases, however, the database component might not be required if there is a need to present the data in as close to real-time as possible. 

You can read about the configuration steps required to connect an Axis device to widely available MQTT brokers in the next sections: