11f2ad5f23360f811ceddd9e34e6d17afffc9012
Lag root cause: vPipe/aPipe were objectMode PassThrough HWM 128 → the pipe held up to 128 frames ≈ 4.3s of video before backpressure reached the encoder. The viewer was watching a 4+ second stale backlog. Fixes (both faithful to @dank074/discord-video-stream): 1. vPipe/aPipe HWM 2 — at most ~1-2 frames in flight (~66ms @ 30fps), so the writeFrame() backpressure pauses ffmpeg stdout almost immediately and the whole chain (encoder → NUT → demuxer → vPipe → BaseMediaStream → WebRTC) runs at the sender's real pace, exactly like dank's 'resume &&= vPipe.write'. 2. Wire vStream.syncStream = aStream — audio is the master clock; video sleeps/wakes on ptsDelta like upstream newApi.js. Prevents A/V drift under variable encoder throughput.
Description
Bete Discord moderation watcher
26 MiB
Languages
TypeScript
95.5%
C++
1.2%
Nix
1%
Shell
0.7%
JavaScript
0.6%
Other
1%