diff --git a/services/discord-gateway/src/goLive/BaseMediaConnection.ts b/services/discord-gateway/src/goLive/BaseMediaConnection.ts index 6f9bdf5..43ca716 100644 --- a/services/discord-gateway/src/goLive/BaseMediaConnection.ts +++ b/services/discord-gateway/src/goLive/BaseMediaConnection.ts @@ -258,6 +258,19 @@ a=ice-lite `a=rtpmap:${el.payload_type} ${el.name}/90000`, `a=rtpmap:${el.rtx_payload_type} rtx/90000`, `a=fmtp:${el.rtx_payload_type} apt=${el.payload_type}`, + // CRITICAL: H264 MUST advertise packetization-mode=1. The encoder + // emits baseline slices up to 8KB (>RTP MTU), so the packetizer + // fragments them into FU-A units (RFC 6184). Discord's receiver only + // reassembles FU-A when packetization-mode=1 is negotiated — without + // it the slices (type 28) are DROPPED while SPS/PPS (small single + // NALs) and Opus audio (no fragmentation) still arrive → black video + // with working audio. profile-level-id=42e01f (constrained baseline + // 3.1) matches the -profile:v baseline encoder + SPS VUI rewriter. + ...(el.name === "H264" + ? [ + `a=fmtp:${el.payload_type} level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f`, + ] + : []), `a=rtcp-fb:${el.payload_type} ccm fir`, `a=rtcp-fb:${el.payload_type} nack`, `a=rtcp-fb:${el.payload_type} nack pli`,