Problem to negotiate H.264 with Firefox 102.0.1 (64 bit) on macOS 12.4, Apple Silicon

202 views
Skip to first unread message

Neil Young

unread,
Jul 23, 2022, 11:05:45 AM7/23/22
to discuss-webrtc
The originator is a 64 bit Raspberry PI OS Bullseye.
Video is hardware encoded using v4l2h264enc
The PI uses GStreamer 18.4 to produce this H.264 sendonly OFFER:

v=0
o=- 8120775504850294421 0 IN IP4 0.0.0.0
s=-
t=0 0
a=ice-options:trickle
a=group:BUNDLE video0 application1
m=video 9 UDP/TLS/RTP/SAVPF 98
c=IN IP4 0.0.0.0
a=setup:actpass
a=ice-ufrag:SBVfEv5znTnj9yvFA4ehRn3oGFOr1vhQ
a=ice-pwd:2u8wido7JsqGot81SVkgc549x30ncpQn
a=rtcp-mux
a=rtcp-rsize
a=sendonly
a=rtpmap:98 H264/90000
a=rtcp-fb:98 nack pli
a=framerate:30
a=ssrc:2959562798 msid:user3281246021@host-ec729c95 webrtctransceiver1
a=ssrc:2959562798 cname:user3281246021@host-ec729c95
a=mid:video0
a=fingerprint:sha-256 59:9D:07:48:55:EC:07:5B:39:D6:57:60:C5:56:43:30:C0:CB:D4:A1:5B:E7:F4:21:31:0A:6B:DD:C8:76:77:8D
m=application 0 UDP/DTLS/SCTP webrtc-datachannel
c=IN IP4 0.0.0.0
a=setup:actpass
a=ice-ufrag:SBVfEv5znTnj9yvFA4ehRn3oGFOr1vhQ
a=ice-pwd:2u8wido7JsqGot81SVkgc549x30ncpQn
a=bundle-only
a=mid:application1
a=sctp-port:5000
a=fingerprint:sha-256 59:9D:07:48:55:EC:07:5B:39:D6:57:60:C5:56:43:30:C0:CB:D4:A1:5B:E7:F4:21:31:0A:6B:DD:C8:76:77:8D

Firefox answers with VP8 codec, so the video connection does not succeed, which in turn leads to a rejection of all further incoming trickle ICE candidates by FF:

This function:

await this.pc.addIceCandidate(new RTCIceCandidate(candidate))

excepts with:

Failed to add remote ICE candidate DOMException: Cannot set ICE candidate for level=0 mid=video0: No such transceiver.

The candidate as JSON:

{"candidate":"candidate:1 2 UDP 2015363326 192.168.188.78 43941 typ host","sdpMLineIndex":0,"sdpMid":"video0"}


Here FF's ANSWER

v=0
o=mozilla...THIS_IS_SDPARTA-99.0 1171336043585678336 0 IN IP4 0.0.0.0
s=-
t=0 0
a=sendrecv
a=fingerprint:sha-256 11:B7:78:42:FF:85:04:88:07:B5:3B:17:38:E6:01:3E:1E:8D:56:76:71:B8:72:AE:FF:FC:C2:7C:9C:76:35:7F
a=ice-options:trickle
a=msid-semantic:WMS *
m=video 0 UDP/TLS/RTP/SAVPF 120
c=IN IP4 0.0.0.0
a=inactive
a=mid:video0
a=rtpmap:120 VP8/90000
m=application 9 UDP/DTLS/SCTP webrtc-datachannel
c=IN IP4 0.0.0.0
a=sendrecv
a=ice-pwd:997346293821d621814308db43bafcc0
a=ice-ufrag:f5693a91
a=mid:application1
a=setup:active
a=sctp-port:5000
a=max-message-size:1073741823

Question: What can I do in order to debug the video connectivity issue? about:webrtc is not telling much.

TIA

Neil Young

unread,
Jul 23, 2022, 11:09:54 AM7/23/22
to discuss-webrtc
Correction: GStreamer 1.18.4

Neil Young

unread,
Jul 23, 2022, 11:48:36 AM7/23/22
to discuss-webrtc
As always: SDP munging helps. My offer didn't contain a profile-level-id, and FF seems to love 42E01F

        sdp = sdp.replace("a=fmtp:98 packetization-mode=1;", "a=fmtp:98 packetization-mode=1;profile-level-id=42e01f;")

Works... 

Nils Ohlmeier

unread,
Jul 23, 2022, 3:16:41 PM7/23/22
to discuss-webrtc
The important part in the Firefox answer is that m-line port is set to 0 and a=inactive. That means Firefox rejected your video offer (because it didn't know which flavor of H264 you are offering as you found out yourself), therefore the code in the answer is just a dummy value with no relevance.

Cheers
  Nils

Neil Young

unread,
Jul 23, 2022, 4:14:21 PM7/23/22
to discuss-webrtc
Exactly. Thanks for the confirmation. 

Neil Young

unread,
Jul 24, 2022, 1:58:05 AM7/24/22
to discuss-webrtc
While this trick works on macOS with Firefox 102.0.1, it doesn't on Ubuntu 20.04 102.0

I'm going to make a donation to the FF community. Looking for the biggest brick available :)

Philipp Hancke

unread,
Jul 24, 2022, 7:41:12 AM7/24/22
to discuss...@googlegroups.com
if the software you are using doesn't send profile-level-ids you might want to make the "donation" there.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/4f01ca1e-3209-46d0-bff6-8b6d3b4cb4a4n%40googlegroups.com.

Neil Young

unread,
Jul 24, 2022, 9:09:06 AM7/24/22
to discuss-webrtc
You got that wrong. I'm sending profile-level-id, but that wasn't enough for at least the latest FF on Ubuntu.

This seems to be working on all versions of FF on all OS:

a=fmtp:98 profile-level-id=42e01f;level-asymmetry-allowed=1;packetization-mode=1
Reply all
Reply to author
Forward
0 new messages