obsproject / obsproject/obs-studio

OBS incorrectly reads the window resolution when it has a border

Open
#10,031 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
76.4k
Forks
10.2k
Avg merge
4d 23h
Merged PRs (30d)
12

Description

Operating System Info

Other

Other OS

Arch Linux

OBS Studio Version

Git

OBS Studio Version (Other)

30.0.0-rc1-165-g7931f2acb (commit 481dd06)

OBS Studio Log URL

https://obsproject.com/logs/o4EnRVqpdI1mRz1K

OBS Studio Crash Log URL

No response

Expected Behavior

If a window has a border, OBS should record the window and that border. When getting the canvas resolution, it should add the border width times two to the width and height (since the width and height given by X11 does not include the border).

Current Behavior

OBS records the window and the border. OBS only gets the base canvas resolution (excluding the border), and downscales the actual window (with the border) slightly.

Steps to Reproduce
  1. Use a tiling window manager (e.g. dwm)
  2. Set the layout to tiling and the border width to non-0 (e.g. 2)
  3. Open OBS
  4. Add a 'Window Capture' source
  5. Select, for example, OBS itself
  6. Right click on the source and select Resize output, giving confirmation if necessary
  7. Go to settings > video and observe the base canvas resolution
Anything else we should know?

If the resolution of the monitor used is 1920x1080 and the border width is 2, the window manager will reduce the width and height of any window by 4 px and draw a border of 2 px around it. OBS uses this new resolution of 1916x1076 as the canvas resolution (excluding the border), but records the whole 1920x1080 window (including the border). This means that it will always scale down the window slightly, no matter what settings are changed, since there will always be a difference between the resolution that OBS has read and the actual resolution of the window being recorded.

(wrong github account again, ugh)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the X11 Window Capture source and the canvas-resolution path exercised by Resize output and Settings > Video. Reproduce the issue with a non-zero tiling-window-manager border, then verify that the canvas resolution includes the border and matches the captured window dimensions.

Written by the indexing model from the issue text.

Assessment

Tech stack
arch-linux, c, linux
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.