robmikh / SimpleRecorder

A simple screen recorder using both the Windows.Graphics.Capture and Windows.Media.Transcoding APIs.
MIT License
219 stars 43 forks source link

Option to disable upscaling (?) #41

Closed MarcAnt01 closed 2 years ago

MarcAnt01 commented 2 years ago

When I select a certain resolution and record a small window it ends up having the same resolution of the full screen, I suppose a kind of upscaling is performed. Is there a way to disable it and keep the original window resolution? On high res displays (such as 5k) this seems to affect the recording smoothness.

robmikh commented 2 years ago

You'll need to compose the texture that gets sent to the encoder differently. I would look at CaptureFrameWait.cs where CopySubresourceRegion is called. You'll want to copy this into a larger texture, and then feed that larger texture to the encoder instead of allowing it to upscale by itself. Don't forget to set those input size settings on the encoder so that it doesn't expect a smaller texture.