~.ffmpeg
FFmpeg
FFmpegProcess
FFmpegProcess()
FFmpeg encoder process.
Create a new FFmpeg process handler.
start
async
terminate
async
terminate() -> None
Kill the internal process.
FFmpegWorker
FFmpegWorker()
Manages a single FFmpeg process when requested.
Create a new worker.
encode
async
encode(
source: AudioSource, connection: VoiceConnection
) -> None
Encode an entire audio source and stream each Opus frame into the output.
| PARAMETER | DESCRIPTION |
|---|---|
source
|
The audio source to read and encode.
TYPE:
|
connection
|
The active connection requesting this encoding.
TYPE:
|
stop
async
stop() -> None
Stop the internal process.
FFmpegPool
Manages all FFmpeg workers and deploys them when needed.
Create a FFmpeg process pool.
| PARAMETER | DESCRIPTION |
|---|---|
max_per_core
|
The maximum amount of processes that can be spawned per logical CPU core.
TYPE:
|
max_global
|
The maximum, hard-cap amount of processes that can be spawned.
TYPE:
|
submit
async
submit(
source: AudioSource, connection: VoiceConnection
) -> None
Submit and schedule an audio source to be encoded into Opus and stream output into a buffer.
| PARAMETER | DESCRIPTION |
|---|---|
source
|
The audio source to read and encode.
TYPE:
|
connection
|
The active connection requesting this encoding.
TYPE:
|
stop
async
stop() -> None
Stop future scheduling and terminate every worker process.