Low latency streaming with Axis cameras
From SpinetiX Support Wiki
Contents
Introduction
Axis and SpinetiX have teamed up to create a powerful and smart streaming solution. By combining the Axis network cameras with SpinetiX players, the screen at shop entrance turns into a Welcome Screen. This smart streaming solution allows retailers to include security as part of their aesthetically pleasing in-store communication.
The player gets the live stream directly from the door-facing Axis network camera and displays it on the Welcome Screen. Furthermore, to make it relevant and targeted to the shopper, the player handle event triggering from the Axis network camera, allowing screen content to change based on predefined shop scenarios. For example, every 10th visitor can be rewarded with a coupon triggered by the connected people counter.
Axis and SpinetiX help to create an engaging smart shopping experience with in-store communication that matters to customers, making them more loyal.
Configure low latency streaming
This tutorial shows how to configure the player for low latency streaming.
- Difficulty: Medium.
- Total duration: 15 – 20 minutes.
- Requirements:
- Axis network camera;
- SpinetiX player with the latest firmware (minimum 4.0.2);
- Elementi latest version (minimum Elementi 2015 Update 2).
Getting started
When doing real-time streaming from an Axis camera, it is important to reduce as much as possible the streaming latency of the overall system, which is computed as following:
Total Latency = Camera encoding latency + Network latency + Player latency + Screen latency
Camera latency highly depends on the camera model used and how it is set up (capture rate, image enhancement, compression, buffering, audio). A very good white paper explaining how to reduce the camera latency can be found on Axis website.
Network latency depends on three major factors: the infrastructure (determines the bandwidth), the amount of data produced by the camera (determines the bitrate), and the choice of transmission protocol. As a general rule, network latency is proportional to bitrate and inversely proportional to bandwidth. In a local area network (LAN), the network latency is usually insignificantly low (only a few ms) and can be ignored.
Player latency is mainly generated by two processes: the stream decoding and the content rendering. By default, the player is conservatively configured with high values for these two, for stability and smooth output purposes; both of them can be lowered for low-latency streaming, as detailed below.
Screen latency is induced by the refresh frequency of the screen and shouldn't be more than 30-40 ms. In some cases, image processing options might contribute to the screen latency – disabling them would help in such cases.
Reduce stream decoding latency
By default, the player is conservatively configured to buffer 750 milliseconds of stream for decoding stability purposes. If the stream is reliable, it is possible to (gradually) reduce the stream decoding latency through the "spx:buffering" attribute.
For that, open the Elementi project and follow these steps:
- Find the streaming layer within the Edit panel and click its button.
- Select the "Advanced" tab within the "Layer Properties" dialog that opens.
- Add the "spx:buffering" attribute to the streaming layer.
- Click on the "Name" column and select the "spx:buffering" attribute from the drop-down list.
- Click on the "Value" column next to it and enter a negative value from 0 to -0.6 (or "-600ms").
- Press "Enter" to apply it.
- Click the OK button to apply the changes.
- The value used above is negative because it represents the amount of time to be deducted from the default 750 milliseconds. It can be a number (of seconds) or an explicit duration, like: -0.4 or -400ms. It cannot exceed 600ms to avoid buffer underflow when the latency is too low to handle network delay variations.
- In case of a reliable RTP stream, is it possible to further reduce the stream decoding latency by one frame (25ms or 33ms, depending on the stream frame rate) by adding the "spx:packetization" attribute set to "
compliant
".
Reduce rendering latency
By default, the player is conservatively configured to buffer 1 second of content rendering to ensure smooth output at the configured frame rate. The rendering latency can be easily reduced down to 250 milliseconds from Control Center → Advanced Applications → Interactivity page. For more details, see how to reduce the rendering latency.
It is possible to further reduce the player rendering latency to ultra-low values using a configuration file:
- Download the "Ultra-low latency configuration" archive on the right side, which contains three configuration files for setting the player rendering latency to 50ms (config_50ms.xml), 100ms (config_100ms.xml), or 200ms (config_200ms.xml).
- Extract the desired configuration file.
- Open Control Center and find the "Quick Links" section.
- Click on "Restore Config".
- Browse and select the configuration file extracted above. Click "Open".
- Click on the "Restart Now" button to apply the new configuration.
See also
- Tutorial about how to display streaming media content.
- Axis M3045-V network camera dedicated page.
- Motion detection with Axis cameras.
- Axis Q7401 video encoder dedicated page.
- More Axis cameras tested with the HMP players.
- Axis Roadshow sample project.