Skip to content

feat(webrtc): add per-camera "Disable Opus Audio" option#2063

Open
laurent-builds wants to merge 1 commit into
koush:mainfrom
laurent-builds:webrtc-disable-opus-audio
Open

feat(webrtc): add per-camera "Disable Opus Audio" option#2063
laurent-builds wants to merge 1 commit into
koush:mainfrom
laurent-builds:webrtc-disable-opus-audio

Conversation

@laurent-builds

Copy link
Copy Markdown

Problem

Some cameras — notably certain Ring Pro doorbells — deliver audio over their
direct WebRTC connection as 60ms SILK Opus that decodes to crackle on every
decoder tested (HomeKit/iOS, ffmpeg, browser), despite byte-perfect, in-order
RTP. Cameras that send 20ms CELT Opus are clean. The corruption is in the
camera's encoding on that path, upstream of Scrypted — which is why transcoding
downstream doesn't fix it.

Fix

The audio is clean when the camera/media server transcodes it server-side
instead of forwarding raw Opus (Ring does this on a codec mismatch). This adds a
per-camera "Disable Opus Audio" option that offers only G.711 on the receiving
WebRTC connection, forcing that server-side transcode.

  • Per-camera setting, default off — no change for existing cameras.
  • When enabled: clean H.264 video + stable connection; audio drops to G.711.
  • Fixes crackly audio in both live view and recordings.

Testing

multiple Ring cameras: the affected doorbell goes crackly → clean with the toggle on;
other Ring cameras are unaffected and keep full 48kHz Opus with it off.

Related to #1617 — this matches the symptoms there (Ring doorbell audio crackle
over HomeKit). Would appreciate the reporter confirming whether enabling this
option resolves it on their device.

Some cameras (notably certain Ring Pro doorbells) send 60ms SILK Opus over their direct WebRTC connection that decodes to crackle/interference on every decoder, from byte-perfect, in-order RTP. The audio is clean when the camera/media server transcodes it instead (triggered by a codec mismatch).

Add a per-camera "Disable Opus Audio" toggle that offers only G.711 on the receiving connection, forcing that server-side transcode. Default off; other cameras are unaffected. Fixes crackly audio in both live view and recordings.

Likely resolves koush#1617.
@koush

koush commented Jun 10, 2026

Copy link
Copy Markdown
Owner

@koush

koush commented Jun 10, 2026

Copy link
Copy Markdown
Owner

// framesPerPacket argument is buggy in that it assumes that the frame durations are always 20.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants