I’m trying to make web camera with latency 50-100ms for real-time control purposes. The server is a python script, the client is WebRTC application running in Android Google Chrome, directly connected to the server (There is no switch or router between). No audio stream. It would be good if a frame is displayed as soon as received. Lagging and freezing is OK. The resolution is 1024×578 colorsubsampling=’420′, H.264, 50 FPS. My Android device supports hardware accelerated decoding. Hardware acceleration is on in the browser options.
The smallest latency I’ve achieved is 170 ms. I understand that it is called low latency for real live applications? but Is it possible to reduce latency more? The same application running in Desktop Google Chrome has 100 ms latency which is OK. I suppose that Android Google Chrome has minimum jitter buffer limit higher than Desktop one. Am I right?
My current code for establishing WebRTC connection and streaming the following
public async runWebRTC() {
const pc = this.pc;
pc.addTransceiver('video', {direction: 'recvonly'});
pc.ontrack = event => {
this.video.nativeElement.srcObject = event.streams[0];
pc.getReceivers().forEach(receiver => {
if (receiver.track.kind === "video") {
try {
receiver.jitterBufferTarget = 10;
receiver.track.contentHint = "motion";
} catch (e) {
}
}
});
};
pc.onicecandidate = async e => {
if (e.candidate === null) {
const offer = pc.localDescription;
try {
const response = await fetch('/offer', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify(offer)
});
const answer = await response.json();
await pc.setRemoteDescription(answer);
} catch (err) {
console.error('Error sending offer:', err);
}
}
};
// Create an offer to send to the server
const offer = await pc.createOffer();
await pc.setLocalDescription(offer);
}
What can be done on client side to reduce latency?


