yellow-discord-stream
v1.0.2
Published
Experiment for making video streaming work for discord selfbots
Maintainers
Readme
Yellow Discord Stream (v1.5.0)
[!CAUTION] Using any kind of automation programs on your account can result in your account getting permanently banned by Discord. Use at your own risk.
⚡ FIXES (Community Patch by Yellow)
This version introduces critical performance and stability patches to handle Discord's recent WebRTC DAVE (End-to-End Encryption) updates:
- Unlocked FPS Locking: Removed the hardcoded minimum of 60 FPS in
BaseMediaConnection. The library now supports any requested framerate (30, 25, 24, etc.) without forcibly upscaling, which drastically reduces CPU usage and "Sync Lag". - DAVE Encryption Stability: Disabled the
PacingHandlersynchronous thread-blocking which previously caused700% frametimespikes during AES-GCM encryption. - Network Flood Prevention: Disabled aggressive
SyncStreamcatch-up logic to prevent UDP socket overflows and sudden voice disconnects.
About this Fork
This package is a community-driven, performance-focused fork of the fantastic @dank074/discord-video-stream module.
A massive thank you to dank074 and all the original contributors for laying down the incredible foundation that makes self-bot video streaming possible on Discord! This fork was created purely for fun and to provide a highly stable alternative for the self-bot community, specifically tailored for extreme high-framerate environments.
Why this fork?
With Discord's recent WebRTC DAVE (End-to-End Encryption) protocol updates, heavy computations (like native AES-GCM encryption) were introduced to the pipeline. While the original module is brilliant, a few of its native safety mechanisms inadvertently caused heavy event-loop execution limits in Node.js when processing high-bitrate (e.g. 1080p/60FPS) feeds, resulting in 700% frametime lag and sudden voice disconnects.
We gently refactored a few structural limits to let your hardware breathe!
What's been modified? (by Yellow)
- Disabled SyncStream Catchup Logic: The video stream operates flawlessly on its native hardware-driven timestamp clock (
FRC / PTS). It no longer drops frame-pacing boundaries to unnaturally chase audio loops. This completely solves the WebRTC socket network flood crashes (the infamous "5-second stream drop"). A/V sync remains pixel-perfect thanks to FFmpeg's.nutmultiplexing. - Removed Node.js Thread-lock Sleep Timers: Disabled the
PacingHandlernetwork wrapper to prevent the host CPU from forcefully sleeping mid-tick. This eliminates the massive DAVE encryption lag spikes, enabling raw hardware-accelerated WebRTC routing directly into Discord.
Features
- Playing video & audio in a voice channel (Go Live or Webcam video)
- Support for H.264 and H.265 codecs
- RTP and RTCP support
- Full End-to-End Encryption (DAVE) compatibility
- Optimized for high-bitrate performance on self-bots
Requirements
For full functionality, this library requires an FFmpeg build with libzmq enabled.
- Windows & Linux: BtbN's FFmpeg Builds
Installation
Install the package alongside its peer-dependency discord.js-selfbot-v13:
npm install yellow-discord-stream@latest
npm install discord.js-selfbot-v13@latest[!IMPORTANT] This library makes use of native dependencies (
node-avandnode-datachannel). If you use package managers that don't run install scripts by default (pnpm, bun, etc.), you'll need to manually allow them.
Usage Guide
1. Initialize Streamer
import { Client } from "discord.js-selfbot-v13";
import { Streamer } from 'yellow-discord-stream';
const streamer = new Streamer(new Client());
await streamer.client.login('YOUR_TOKEN');2. Join a Voice Channel
await streamer.joinVoice("GUILD_ID", "CHANNEL_ID");3. Start Sending Media
import { prepareStream, playStream, Utils, Encoders } from "yellow-discord-stream"
try {
// NVENC (Hardware Acceleration) is supported!
let encoder = Encoders.nvenc({
preset: "p1",
rc: "cbr"
});
const { command, output } = prepareStream("VIDEO_URL_OR_FILE", {
encoder,
height: 1080,
frameRate: 30, // Now truly respects values below 60!
bitrateVideo: 5000,
videoCodec: Utils.normalizeVideoCodec("H264"),
});
await playStream(output, streamer, {
type: "go-live" // Use "camera" for webcam mode
});
} catch (e) {
console.error(e);
}Documentation & API
prepareStream Options
| Option | Description |
| :--- | :--- |
| width / height | Output resolution |
| frameRate | Target FPS (Supports 1-60) |
| bitrateVideo | Average bitrate in kbps |
| hardwareAcceleratedDecoding | Enable GPU decoding |
| videoCodec | Supports H264, H265, VP8 |
Performance Tips
- Use
NVENCif you have an NVIDIA GPU to offload encryption. - Keep
frameRateat 30 for the best performance/quality ratio on Discord. - Ensure your source resolution matches the output to avoid extra scaling.
A massive thank you to dank074 for the original foundation! This fork is maintained for fun and for the community. ❤️
