[PR #8113] Calculate output audio bitrate from output channel count #11618

Closed
opened 2026-02-07 06:41:37 +03:00 by OVERLORD · 0 comments
Owner

Original Pull Request: https://github.com/jellyfin/jellyfin/pull/8113

State: closed
Merged: No


384kbps is unnecessarily high for stereo output with our encoders and sending data over network is expensive. This commit introduces logic for calculating output bitrate based on output channel count, like this:

(inputChannels, outputChannels) switch
{
    ( >= 6, >= 6 or 0) => Math.Min(640000, audioBitRate.Value),
    ( > 0, > 0) => Math.Min(outputChannels * 128000, audioBitRate.Value),
    ( > 0, _) => Math.Min(inputChannels * 128000, audioBitRate.Value),
    (_, _) => Math.Min(384000, audioBitRate.Value)
}

That means transcoded stereo output in hls is going to be at most 256kbps, mono 128kbps, surround 640kbps, etc.

This is a relatively small change I hope could get to users before the next major version, therefore this PR is for 10.8.z.

**Original Pull Request:** https://github.com/jellyfin/jellyfin/pull/8113 **State:** closed **Merged:** No --- 384kbps is unnecessarily high for stereo output with our encoders and sending data over network is expensive. This commit introduces logic for calculating output bitrate based on output channel count, like this: ```csharp (inputChannels, outputChannels) switch { ( >= 6, >= 6 or 0) => Math.Min(640000, audioBitRate.Value), ( > 0, > 0) => Math.Min(outputChannels * 128000, audioBitRate.Value), ( > 0, _) => Math.Min(inputChannels * 128000, audioBitRate.Value), (_, _) => Math.Min(384000, audioBitRate.Value) } ``` That means transcoded stereo output in hls is going to be **at most** 256kbps, mono 128kbps, surround 640kbps, etc. This is a relatively small change I hope could get to users before the next major version, therefore this PR is for 10.8.z.
OVERLORD added the pull-request label 2026-02-07 06:41:37 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#11618