Low latency streaming with Axis cameras
From SpinetiX Support Wiki
Applies to: HMP350 devices.
Axis and SpinetiX have teamed up to create a powerful and smart streaming solution. By combining the Axis network cameras with SpinetiX HMP 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 instore-communications.
The HMP 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, HMP players handle event triggering from the Axis network camera, allowing screen content to change based on predefined shop scenarios. For example, every 10th visitors can be rewarded with a coupon triggered by the connected people counter.
Axis and SpinetiX help to create an engaging smart shopping experience with instore-communication that matters to customers making them more loyal.
Configure low latency streaming
This tutorial shows how to configure the HMP350 for low latency streaming.
- Difficulty: Medium.
- Total duration: 15 - 20 minutes.
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 latency + Network latency + HMP stream decoding latency + HMP rendering 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.
The latency on the HMP side is mainly generated by two processes: the stream decoding and the content rendering. By default, the HMP is conservatively configured with high values for these two for stability and smooth output purposes: 750 milliseconds for stream buffering and 1.5 seconds for render buffering. Both of them can be reduced to lower values 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 the screen latency - disabling them would help in such cases.
Reduce stream decoding latency
By default, the HMP is conservatively configured to 750 milliseconds of stream buffering for decoding stability purposes.
- Find the streaming layer within the Edit panel and click its button
- Within the "Layer Properties" dialog that opens, select the "Advanced" tab.
- Add the "spx:buffering" attribute and set it to a negative duration:
- Click on "Name" column to add a new property.
- From the drop-down box, select "spx:buffering".
- Click on "Value" column.
- Enter a negative duration; this will be deducted from the default 750 milliseconds.
- If no time unit is specified, then seconds is assumed.
- The value should not be larger than -600ms, to avoid buffer underflows when the latency is too low to handle network delay variations.
- Press "Enter" to apply the attribute value.
- Add the "spx:packetization" and set it to "
compliant". Firmware 4.1.0 or later is required for this.
- This will further reduce the stream decoding latency by one frame - 25ms or 33ms depending on the streaming frame rate.
- Click the OK button to apply the changes.
Reduce HMP rendering latency
By default, the HMP is conservatively configured to 1.5 seconds of render buffering to ensure smooth output at the configured frame rate. The rendering latency can be easily reduced down to 250 milliseconds from the Advanced Applications > Interactivity page of HMP Control Center. For more details, see how to reduce the rendering latency.
If required, it is possible to further reduce the HMP rendering latency, to ultra-low values: 200ms, 100ms, or 50ms - for that follow these steps:
- Download the "Ultra-low latency configuration" archive on the right side.
- It contains three configuration backup files for setting the HMP rendering latency to 50ms (config_50ms.xml), 100ms (config_100ms.xml), or 200ms (config_200ms.xml).
- Extract the desired configuration file.
- Open HMP Control Center home page 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.