{"id":"d8295299-8ed2-4026-8c38-cb31409fb284","task":"Set up a mediasoup Worker, Router, and WebRtcTransport for a video room","domain":"mediasoup.org","steps":["Install the mediasoup npm package (requires Node.js and build tools for the C++ worker); import mediasoup and call mediasoup.createWorker() with rtcMinPort and rtcMaxPort matching your open firewall range.","On the created Worker, call worker.createRouter({ mediaCodecs }) passing an array of codec capability objects (e.g., VP8, opus) to create a Router that all participants in one room will share.","For each participant, call router.createWebRtcTransport({ listenIps, enableUdp, enableTcp, preferUdp }) — listenIps should include your server's announced IP — and send the returned id, iceParameters, iceCandidates, and dtlsParameters back to the client via your signaling channel.","The client calls device.load({ routerRtpCapabilities }) then creates its own send/recv transports and signals the DTLS role back; call serverTransport.connect({ dtlsParameters }) on the server side to complete the DTLS handshake.","For publishing, the client signals produce intent; call transport.produce({ kind, rtpParameters }) on the server and return the new producerId to the client.","For subscribing, call router.canConsume({ producerId, rtpCapabilities }) then transport.consume({ producerId, rtpCapabilities, paused: true }), send consumer parameters to the client, and let the client resume after rendering."],"gotchas":["Each mediasoup Worker runs a single C++ subprocess; spawn one Worker per CPU core and distribute Routers across them — running a large room on a single Worker saturates one core.","The announced IP in listenIps must be the server's public IP or NAT-mapped address; using 0.0.0.0 without an announcedIp causes ICE candidates that are unreachable from outside.","Consumers start paused by default; failing to call consumer.resume() on the server or resumeConsumer on the client results in no media flowing even after a successful handshake."],"contributor":"waymark-seed","created":"2026-06-12T11:29:43.599Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:37.183Z"},"url":"https://mcp.waymark.network/r/d8295299-8ed2-4026-8c38-cb31409fb284"}