Skip to content

fix Rescale output is not working for advanced recordings#1729

Merged
sandboxcoder merged 6 commits into
stagingfrom
rno/rescale-output-adv-recording
Jun 10, 2026
Merged

fix Rescale output is not working for advanced recordings#1729
sandboxcoder merged 6 commits into
stagingfrom
rno/rescale-output-adv-recording

Conversation

@sandboxcoder

@sandboxcoder sandboxcoder commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Description

Update IAdvancedRecording::Start to call obs_encoder_set_scaled_size() when rescaling is enabled.

After posting the PR, I received a defect from copilot that calling obs_encoder_set_scaled_size & obs_encoder_set_gpu_scale_type can mutate livestream filter.

These are my notes after more digging:
useStreamEncoders controls whether the recording reuses the streaming output's video encoder instead of creating its own.

It's set to true when the user selects "Use stream encoder" for recording (i.e., RecEncoder in the OBS config is "" or "none"):

This corresponds to the "Use stream encoder" option in Settings > Output > Recording > Video Encoder dropdown.

What happens in each case:

┌───────────────────┬──────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────┐                                   
│ useStreamEncoders │ obs_get_multiple_rendering() │                                           Result                                           │                                 
├───────────────────┼──────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────┤                                   
│ false             │ either                       │ Recording has its own encoder — safe to mutate                                             │                                 
├───────────────────┼──────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────┤
│ true              │ true                         │ UpdateEncoders() duplicates the encoder — safe to mutate the copy                          │                                   
├───────────────────┼──────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────┤                                   
│ true              │ false                        │ videoEncoder = streaming->videoEncoder — same pointer, mutating it affects the live stream │                                   
└───────────────────┴──────────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────┘                                   

So the guard !recording->useStreamEncoders || obs_get_multiple_rendering() precisely covers the only safe cases where we can call obs_encoder_set_scaled_size(). In the dangerous
case (shared pointer, single rendering), the scaling calls are skipped — which means rescaling won't apply when "Use stream encoder" is selected, but that's actually correct
behavior since you can't independently rescale a shared encoder anyway.

Motivation and Context

In this pull request I updated frontend to properly migrate the rescaleRes but OSN had an issue where it did not utilize this scale.

How Has This Been Tested?

Manually ran Desktop, exported a recording with rescale output set, and verified when I opened the file it contained the resolution.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@sandboxcoder sandboxcoder requested a review from Copilot June 10, 2026 01:25
@sandboxcoder sandboxcoder marked this pull request as ready for review June 10, 2026 01:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes advanced recording rescale output not being applied by configuring the recording video encoder’s scaled size when rescaling is enabled.

Changes:

  • Add encoder scaling configuration (obs_encoder_set_scaled_size) during IAdvancedRecording::Start.
  • Set GPU scale type for the recording encoder when rescaling is enabled.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread obs-studio-server/source/osn-advanced-recording.cpp Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread obs-studio-server/source/osn-advanced-recording.cpp Outdated
@sandboxcoder sandboxcoder requested a review from Copilot June 10, 2026 02:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread obs-studio-server/source/osn-advanced-recording.cpp Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@sandboxcoder sandboxcoder merged commit 9eb083d into staging Jun 10, 2026
20 checks passed
summeroff pushed a commit that referenced this pull request Jun 10, 2026
Fixes advanced recording rescale output not being applied by configuring the recording video encoder’s scaled size when rescaling is enabled.

(cherry picked from commit 9eb083d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants