Skip to main content

Multipath network transmission

A growing number of electronic devices support simultaneous network access through multiple connections, such as Wi-Fi and cellular, or Wi-Fi and dual-SIM cellular. Each connection is independent of the actual network transmission path and does not share bandwidth bottlenecks.

This page explains how to implement multipath network transmission in your project.

Understand the tech

Starting with v4.6.0, the Video SDK adds a new network transmission feature called Multipath. This feature is designed for devices that support multiple network interfaces, including 5G, Wi-Fi, and LAN. Multipath helps reduce or even eliminate poor user experiences caused by weak network conditions. In lab tests, under weak network conditions with frequent bandwidth jitter, enabling Multipath reduces lag by more than 50% while maintaining image quality and latency.

Multipath improves real-time audio and video experiences that require stable transmission in poor network conditions, including video conferencing, online education, IoT parallel operations, and remote production and broadcasting.

Prerequisites

Before you begin, make sure you have:

  • A mobile device running Android 7.0 (API level 24) or later, with two or more active network connections.

Implementation

To implement Multipath network transmission in your project:

Add network permissions

Multipath requires permission to access and manage the device network state. You must add the following permissions to the Android project’s /app/src/main/AndroidManifest.xml file:


_2
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
_2
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>

Multipath APIs

The Video SDK supports enabling and configuring multipath transmission capabilities through the following parameters in ChannelMediaOptions:


_7
public class ChannelMediaOptions {
_7
// ...
_7
public Boolean enableMultipath;
_7
public Integer uplinkMultipathMode;
_7
public Integer downlinkMultipathMode;
_7
public Integer preferMultipathType;
_7
}

Use enableMultipath to enable multipath transmission. Once enabled, the SDK supports two transmission modes:

  • Dynamic mode (default): Dynamically selects the optimal transmission path based on network conditions. This mode is suitable for traffic-sensitive scenarios with high user experience requirements, such as conferences and education. In this mode, you can use preferMultipathType to specify a preferred network path, such as Wi-Fi or mobile network.

  • Full redundancy mode: Sends data simultaneously across all available network paths. This mode is suitable for scenarios where traffic use is less sensitive but a highly reliable user experience is required, such as outdoor production, broadcasting, and parallel operation. This mode incurs additional fees. Contact technical support to enable it.

You can configure the transmission mode separately for uplink (uplinkMultipathMode) and downlink (downlinkMultipathMode).

When multipath is enabled, the SDK reports transmission statistics for each path in real time through the onMultipathStats callback. These statistics include traffic consumption for each network type and real-time performance metrics for each path, making it easier to monitor and optimize network performance.


_10
public static class MultipathStats {
_10
public int lanTxBytes;
_10
public int lanRxBytes;
_10
public int wifiTxBytes;
_10
public int wifiRxBytes;
_10
public int mobileTxBytes;
_10
public int mobileRxBytes;
_10
public int activePathNum;
_10
public PathStats[] pathStats;
_10
}

Sample code

The following sample code shows how to enable and configure multipath network transmission:


_24
private String multipathModeStr = "";
_24
private int activePathNum = 0;
_24
_24
// Enable multipath network transmission
_24
mediaOptions.enableMultipath = true;
_24
_24
multipathModeStr = spinner_multipath_mode.getSelectedItem().toString();
_24
Constants.MultipathMode multipathMode = Constants.MultipathMode.valueOf(multipathModeStr);
_24
_24
// Set uplink transmission mode
_24
mediaOptions.uplinkMultipathMode = Constants.MultipathMode.getValue(multipathMode);
_24
_24
// Set downlink transmission mode
_24
mediaOptions.downlinkMultipathMode = Constants.MultipathMode.getValue(multipathMode);
_24
_24
// In dynamic transmission mode, use preferMultipathType to specify the preferred path
_24
mediaOptions.preferMultipathType = Constants.MultipathType.MULTIPATH_TYPE_WIFI.getValue();
_24
_24
// Report multipath transmission statistics
_24
@Override
_24
public void onMultipathStats(MultipathStats stats) {
_24
super.onMultipathStats(stats);
_24
activePathNum = stats.activePathNum;
_24
}

Reference

This section contains content that completes the information on this page, or points you to documentation that explains other aspects to this product.