How to include audio in a WebRTC stream

Hi!

We have a camera AXIS M1075-L (with built in microphone) and having problems with getting the sound included when streaming via WebRTC. Our main use case is to have sound when playing a recorded stream.

We have verified that we get sound using the XProtect Web Client (both live and playing a recording).

I have been discussing this a bit with ChatGPT :wink: and done some trouble shooting and our code for connection via WebRTC is based on you sample https://github.com/milestonesys/mipsdk-samples-protocol/tree/main/WebRTC_JavaScript but there is no mention about audio there, is it not supported via your WebRTC interface or should we send some extra attributes when setting up the connection to get the audio?

If we (in our javascript) do videoCtl.srcObject.getAudioTracks(), we get an empty list.

We console log the “remote sdp” and it looks like this (according to ChatGPT we should have got an “m=audio” in the list)

v=0
o=- 24874 0 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1
m=video 59360 UDP/TLS/RTP/SAVP 101 102 103
c=IN IP4 10.14.85.220
a=rtcp:9 IN IP4 0.0.0.0
a=candidate:506560087 1 udp 2113937663 <redacted> 59360 typ host generation 0
a=ice-ufrag:LUCB
a=ice-pwd:EPCTTAPNOBRWTILIAXSFDBQY
a=ice-options:ice2,trickle
a=fingerprint:sha-256 E8:7D:6E:28:56:95:0A:27:AE:83:CE:D7:AA:8C:8D:C3:74:F8:B2:47:F6:71:5A:13:CF:5D:71:BA:EB:3E:CD:50
a=setup:actpass
a=mid:0
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=sendonly
a=rtcp-mux
a=rtpmap:101 H264/90000
a=rtcp-fb:101 goog-remb
a=fmtp:101 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
a=rtpmap:102 H264/90000
a=rtcp-fb:102 goog-remb
a=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e034
a=rtpmap:103 H264/90000
a=rtcp-fb:103 goog-remb
a=fmtp:103 packetization-mode=0;profile-level-id=42e01f
a=ssrc:1183981703 cname:ee3f663a-a1df-4b7c-8bda-073bc37aa64e
m=application 9 UDP/DTLS/SCTP webrtc-datachannel
c=IN IP4 0.0.0.0
a=ice-ufrag:LUCB
a=ice-pwd:EPCTTAPNOBRWTILIAXSFDBQY
a=ice-options:ice2,trickle
a=fingerprint:sha-256 E8:7D:6E:28:56:95:0A:27:AE:83:CE:D7:AA:8C:8D:C3:74:F8:B2:47:F6:71:5A:13:CF:5D:71:BA:EB:3E:CD:50
a=setup:actpass
a=mid:1
a=sctp-port:5000
a=max-message-size:262144

Do you have any tips on how to trouble shoot this further?

Kind regards Hans

The current implementation (2025R1) of WebRTC does unfortunately not include support for audio.

The good news.

Audio will be supported in the upcoming XProtect 2025R2, so it can be used soon.

Ok, thanks, yes that is good news, do you know (approximately

) when 2025R2 will be released?

/Hans

Mid June. Please keep a look out for updates from Milestone Systems, the official announcement should be coming soon, if not already delivered to partners…