From a53d7b71da2bcde0e6e32903067ec22cd841eb4e Mon Sep 17 00:00:00 2001 From: asepharyana Date: Tue, 11 Aug 2026 10:56:49 +0700 Subject: [PATCH] =?UTF-8?q?fix(voice):=20screen=20share=20GoLive=20died=20?= =?UTF-8?q?instantly=20=E2=80=94=20neutralize=20node-av=20custom=20ffmpeg?= =?UTF-8?q?=20filters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit prepareStream (from @dank074/discord-video-stream) unconditionally appends audio filters 'volume@internal_lib' + 'azmq' that exist ONLY in its custom node-av jellyfin-ffmpeg build. The Nix deployment runs plain ffmpeg-headless on PATH, so fluent-ffmpeg died instantly with 'Filter not found' (exit 8), the NUT output stream stayed empty, and playStream's node-av demux failed with 'Failed to open input from Readable stream: Invalid data found when processing input' — every screen share failed ~100ms after start. Fix: pass customFfmpegFlags ['-filter:a','anull'] — ffmpeg applies the LAST -filter:a for a stream, so the trailing no-op filter overrides the custom chain (verified: command ends with '-filter:a anull', transcode runs, node-av demux finds video+audio). Realtime volume control was already removed from GMW (a690e5b), so dropping the filters is lossless. Verified end-to-end with the failing URL (youtu.be/fONoh7Pc6VU, AV1+Opus DASH): getDirectScreenInput → NUT merge → patched prepareStream → node-av demux finds H264 video + Opus audio streams. --- .../src/modules/voice-recording/screenShareController.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/services/discord-gateway/src/modules/voice-recording/screenShareController.ts b/services/discord-gateway/src/modules/voice-recording/screenShareController.ts index 9f20782..81858f1 100644 --- a/services/discord-gateway/src/modules/voice-recording/screenShareController.ts +++ b/services/discord-gateway/src/modules/voice-recording/screenShareController.ts @@ -107,6 +107,15 @@ export class ScreenShareController { bitrateVideoMax: 4000, includeAudio: true, videoCodec: Utils.normalizeVideoCodec("H264"), + // The library unconditionally appends `volume@internal_lib` + `azmq` + // audio filters that only exist in its custom node-av ffmpeg build + // (jellyfin-ffmpeg) — NOT in the Nix ffmpeg-headless on PATH. Without + // an override fluent-ffmpeg dies instantly with "Filter not found", + // the NUT output stays empty and playStream fails with "Invalid data + // found when processing input". ffmpeg applies the LAST -filter:a for + // a stream, so a trailing no-op filter neutralizes the custom chain. + // Realtime volume control was removed from GMW, so this is lossless. + customFfmpegFlags: ["-filter:a", "anull"], }); let stopped = false;