Skip to content

frontend: Scale simple output recording audio bitrate by channel count - #13311

Open
nickvonkaenel wants to merge 1 commit into
obsproject:masterfrom
nickvonkaenel:fix/simple-output-multichannel-audio-bitrate
Open

frontend: Scale simple output recording audio bitrate by channel count#13311
nickvonkaenel wants to merge 1 commit into
obsproject:masterfrom
nickvonkaenel:fix/simple-output-multichannel-audio-bitrate

Conversation

@nickvonkaenel

Copy link
Copy Markdown

Description

In Simple output mode, the recording audio bitrate was hardcoded to 192 kbps regardless of channel layout. The intention of this based on the git log was to ensure a high enough quality for recording regardless of the streaming setting. It didn't account for recordings with more than 2 channels where 192 kbps will not suffice.

This change replaces the hardcoded 192 value with a value calculated by scaling proportionally from the stereo reference (192 kbps) using the active channel count, snapping to the closest bitrate supported by the selected encoder (AAC or Opus).

Stereo recordings are unchanged (192 * 2 / 2 = 192 kbps).

Motivation and Context

Currently, users recording in 5.1 or 7.1 formats will have degraded audio encoding (~32 kbps per channel) unless they switch to advanced mode. This does not seem like ideal behavior, especially since it's not clear this is happening based on the UI. By scaling the encoding quality depending on the channel count, we can ensure a quality experience.

How Has This Been Tested?

Built on Windows 11 and tested by recording a capture with 6 channels in simple mode, confirming that the bitrate was increased as expected.

Types of changes

  • Tweak (non-breaking change to improve existing functionality)

Checklist:

  • I have read the contributing document.
  • My code has been run through clang-format.
  • My code follows the project's style guidelines
  • My code is not on the master branch.
  • My code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@pkviet pkviet self-assigned this Apr 10, 2026
@pkviet pkviet added the kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. label Apr 10, 2026
@tt2468

tt2468 commented Apr 10, 2026

Copy link
Copy Markdown
Member

Are there any other examples of applications which implement this behavior? I mainly ask because users with specific bitrate requirements may encounter this as unexpected behavior. I definitely would myself.

Perhaps it would be good to provide some kind of label in the UI providing a simple calculation of real audio track bitrate, so that the user is aware of this scaling. cc @Warchamp7

I do agree with the choice to implement this scaling via the UI code, as it preserves existing behavior for features like Enhanced Broadcast.

@nickvonkaenel

Copy link
Copy Markdown
Author

That's a good point. Hiding this value has caused confusion for me and others I work with. If it were exposed in the interface as 192 then I would have just changed it. I thought it was based off the streaming setting and couldn't understand why it was so low for surround formats.

I would be in favor of just exposing the recording bitrate in the UI instead of my change, and perhaps considering a higher default such as 320 which at least wouldn't be terrible for 5.1

@notr1ch

notr1ch commented Apr 10, 2026

Copy link
Copy Markdown
Member

IMO simple mode should be a "just works" mode for people who don't understand encoder and bitrate and just want OBS to set sensible values for them, so in this case, I think exposing it as an option does more harm than good. I'd be fine with the approach taken in this PR.

@mihawk90

Copy link
Copy Markdown
Contributor

Are there any other examples of applications which implement this behavior?

I happened to come across a similar discussion in a PR for a Jellyfin music player:

finamp-app/finamp#1524

TLDR We decided we didn't want to take away control from the user by hardcoding any kind of formula. Instead we went for a setting so users can decide how they want to handle multitrack audio themselves.

Obviously this is a slightly different usecase (music listening vs. recording), but that's just my 2c on it.

@nickvonkaenel

Copy link
Copy Markdown
Author

Perhaps the default setting could be "auto" which does the scaling in this pr but it's still able to be changed by the user to a specific bitrate. That would alleviate the confusion imo.

I understand making the simple mode a simple experience, but if the bitrate is hidden I would expect it to be hidden for both recording and streaming. Right now it's only exposed for streaming with the hardcoded value for recording.

@pkviet pkviet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM apart from the cosmetics.
I don't remember why I did not change the default for simple output.
I agree with R1ch that there should be no options in Simple output; it is the purpose of Advanced Output to expose fine-grained control.

Comment thread frontend/utility/SimpleOutput.cpp Outdated
@nickvonkaenel
nickvonkaenel force-pushed the fix/simple-output-multichannel-audio-bitrate branch from cf0b1c7 to db54f3e Compare April 14, 2026 01:23

@nickvonkaenel nickvonkaenel left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added spacing after the bitrate selection block.

@Warchamp7 Warchamp7 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me aside from the codestyle fixes.

Comment thread frontend/utility/SimpleOutput.cpp Outdated
Comment thread frontend/utility/SimpleOutput.cpp Outdated
Comment thread frontend/utility/SimpleOutput.cpp Outdated
@nickvonkaenel
nickvonkaenel force-pushed the fix/simple-output-multichannel-audio-bitrate branch from db54f3e to be9fac4 Compare April 22, 2026 17:22
@nickvonkaenel

Copy link
Copy Markdown
Author

Looks good to me aside from the codestyle fixes.

Fixed in be9fac4

@nickvonkaenel
nickvonkaenel requested a review from Warchamp7 April 28, 2026 18:53
@github-project-automation github-project-automation Bot moved this to Requires Changes in 33.0 Release Tracker Jul 6, 2026
@Warchamp7 Warchamp7 added this to the OBS Studio 33.0 milestone Jul 6, 2026
@nickvonkaenel

Copy link
Copy Markdown
Author

Would it be possible to revisit this?

@nickvonkaenel
nickvonkaenel requested a review from pkviet July 28, 2026 00:22
@Warchamp7 Warchamp7 moved this from Requires Changes to Ready For Merge in 33.0 Release Tracker Aug 7, 2026
Comment thread frontend/utility/SimpleOutput.cpp Outdated
@github-project-automation github-project-automation Bot moved this from Ready For Merge to Requires Changes in 33.0 Release Tracker Aug 7, 2026
@Warchamp7 Warchamp7 moved this from Requires Changes to Ready For Merge in 33.0 Release Tracker Aug 8, 2026
@Warchamp7

Copy link
Copy Markdown
Member

Needs squash but ready to go

@Warchamp7 Warchamp7 added the release-note/change Groups pull request under the "Changes" section in the associated patch notes label Aug 8, 2026
@nickvonkaenel
nickvonkaenel force-pushed the fix/simple-output-multichannel-audio-bitrate branch from aa3e750 to e24ec51 Compare August 8, 2026 23:38
@nickvonkaenel

Copy link
Copy Markdown
Author

Needs squash but ready to go

Squashed

@RytoEX RytoEX left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-format will need to be fixed.

@github-project-automation github-project-automation Bot moved this from Ready For Merge to Requires Changes in 33.0 Release Tracker Aug 18, 2026
The recording audio bitrate was hardcoded to 192 kbps regardless of
channel layout. For a 5.1 mix this yields ~32 kbps per channel which is
very low quality. Scale proportionally from the stereo reference (192
kbps) using the active channel count, snapping to the closest bitrate
supported by the selected encoder (AAC or Opus).

Stereo recordings are unchanged (192 * 2 / 2 = 192 kbps).
@nickvonkaenel
nickvonkaenel force-pushed the fix/simple-output-multichannel-audio-bitrate branch from e24ec51 to 1550531 Compare August 19, 2026 00:01
@Warchamp7
Warchamp7 requested a review from RytoEX August 19, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. release-note/change Groups pull request under the "Changes" section in the associated patch notes

Projects

Status: Requires Changes

Development

Successfully merging this pull request may close these issues.

7 participants