obsproject / obs-studio

OBS Studio - Free and open source software for live streaming and screen recording
https://obsproject.com
GNU General Public License v2.0
58.89k stars 7.84k forks source link

Crop/Pad Filter and Transform on Window Capture doesn't reset correctly when window is restored after being maximized in some apps (Firefox, Edge, Thunderbird...) #8906

Open LukasThyWalls opened 1 year ago

LukasThyWalls commented 1 year ago

Operating System Info

Windows 10

Other OS

No response

OBS Studio Version

29.1.1

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/NVMDgmotURhHbB4o

OBS Studio Crash Log URL

No response

Expected Behavior

Using the Crop/Pad Filter (or the Transform tool) in a Window capture (in my case, capturing Firefox) should maintain the crop configured when the window is maximized and restore the window to the normal size, without doing anything more.

Current Behavior

When i set a crop filter (or the Transform tool) in a window capture with Firefox, and that window is maximized, obviously the crop change, but if i restore the window, the crop doesn't match what is showing before, like if it was moved.

However, if i change scene, or i hide/unhide the window capture source, the window shows again like i configured at first.

Steps to Reproduce

  1. I open Firefox, and i put it in a window not maximised (i use Sizer, to measure easier the width and height, in this case using the preset 1280x960 because i am in a 1080p display).

  2. In my test case, i have two window capture from the same window:

    • One capturing the Firefox page without the Firefox GUI ("Firefox Pagina")
    • Other capturing only the Firefox URL in the GUI ("Firefox URL")
  3. For both of them, i set a Crop/Pad Filter:

    • Firefox Pagina: Using relative size, only hidding the top GUI. OBS_CropPadIssue_CropPadRelative_FirefoxPagina
    • Firefox URL: Using absolute size, cutting only the URL part in the GUI. OBS_CropPadIssue_CropPadAbsolute_FirefoxURL
  4. Using a 1080p output in OBS, i have this scene: OBS_CropPadIssue_Preview1_WindowNormal

  5. Then, i maximised the Firefox window, causing the scene to change correspondly: OBS_CropPadIssue_Preview2_WindowMaximized

  6. Then, i restore the maximised Firefox to window, but the scene doesn't restore to the look in the Step 4, the crop is changed: OBS_CropPadIssue_Preview3_WindowWrong

  7. However, if i hide/unhide the sources, or i swap to other scene and return to this one, the sources return to the aspect in Step 4 again.

NOTE: You can also use the transform tool, as i found after some research.

Anything else we should know?

I tried to replicate this issue with Windows Explorer and Microsoft Edge, with Explorer it doesn't do the same as it works as expected, with Edge it has the same issue as Firefox.

Also, i tried in two different computers with Windows 10 and OBS Studio 29.1.2, and it happens in both of them.

Thanks!

Fenrirthviti commented 1 year ago

Cannot reproduce this. You mention using Sizer, are you using that to maximize/minimize the windows? Using the normal Windows maximize/restore functions, everything is working as expected.

LukasThyWalls commented 1 year ago

Cannot reproduce this. You mention using Sizer, are you using that to maximize/minimize the windows? Using the normal Windows maximize/restore functions, everything is working as expected.

I mentioned Sizer to be as specific i could in the details, but without running Sizer it stills does the same to me (I just made sure again now with one of the computers: First stopping Sizer and checking, second removing Sizer from start up, rebooting, and checking again, third uninstalling Sizer completely and checking again, always does the issue described above).

And i always use the normal maximize/restore functions, i only use Sizer to set first the size of the window more accurately.

Also it doesn't happen with all apps: Notepad and Windows Explorer doesn't do this, but Firefox, Edge and now i just found that Thunderbird does too. The only thing that all of them have that others don't is they haven't a window title bar, they use it to put the tabs.

I don't know what other details can i provide to help, but tell me what can be useful.

Fenrirthviti commented 1 year ago

The only other thing I can think of is some kind of weird interaction with DPI scaling, which you appear to have enabled.

Can you turn off DPI scaling (set to 100% instead of 125%) and see if the issue still persists?

LukasThyWalls commented 1 year ago

The only other thing I can think of is some kind of weird interaction with DPI scaling, which you appear to have enabled.

Can you turn off DPI scaling (set to 100% instead of 125%) and see if the issue still persists?

In one of the computers i use 125% scaling, so i set it to 100% but the issue still persists in the same way. I also tried to use 100% without Sizer (maybe are both things together) but it still does the same.

Then i look up in the other computer and it uses 100% scaling all the time, so it can't be it.

Also to point out something else, in that computer i have two monitors with different resolutions (1920x1200 and 1920x1080) and in the one i commonly use is a laptop without monitor attached (so only one display at 1920x1080) and it happens exactly the same thing on both, so it's not a multi-screen thing too.

I don't know exactly what to say, for me is something that happens every time, and also something that didn't happen a while ago, although i can't say exactly what version was the first affected, or if it was something that changed in those apps (although it will be rare, I'm testing other apps to see if one does the same, but for the ones i have no one does it except Firefox, Edge and Thunderbird).

Thanks!

Fenrirthviti commented 1 year ago

Thanks for the detail information. I've tried a few more times to reproduce on my end, and can't seem to do so, everything returns exactly back where it's suppose to be.

As another test, can you do this in a clean scene collection, with only a single source and see if the issue occurs there as well? There might be some kind of settings issue with the current scene collection that might be playing a part. If it doesn't in a new scene collection, that should at least help narrow things down a bit.

LukasThyWalls commented 1 year ago

As another test, can you do this in a clean scene collection, with only a single source and see if the issue occurs there as well? There might be some kind of settings issue with the current scene collection that might be playing a part. If it doesn't in a new scene collection, that should at least help narrow things down a bit.

The problem is that in the second computer i created the scenes only for testing this issue, so i don't think that can be it.

However, I've gone further. I just uninstalled OBS removing all the settings and reinstalled it. Then i configured it (nothing special, just using using the starting guide to put it in 720p60 for recording, as i don't use OBS in this computer for nothing else than testing), and i created from scratch the scene to test Firefox, Edge and Thunderbird, like i show in the original post.

The result are the same, the issue is still there.

BTW, the export of the scene collection is this one: CropPad_Issue_Test__Scenes_Collection.zip

It's weird that i can reproduce so easily the issue in several computers but you can't. Something we are missing here...

Thanks!

Fenrirthviti commented 1 year ago

Tested with your collection, using Edge as a test case this time, still works perfectly fine for me:

https://pub.rachni.com/vid/obs64_2023-06-09_15-33-21.webm

LukasThyWalls commented 1 year ago

The same thing in my end:

https://github.com/obsproject/obs-studio/assets/1467366/4addc91b-2eb7-4155-89aa-41a7655195ea

However, i found something new: It's not the Crop/Pad filter, it also happens with the transform tool, cropping there without any filter.

I was using the filter because what i want (and i had before working) is the web url and the web content in two sources to use in several scenes, and also doing similar things with some webs rendered by Firefox (for example, show a Youtube video pre-cropped to use in different scenes).

Also to point out, it happens to me when i restore the window after i maximised it, when it is maximised the filter/transform is correct, and when i change the size of the window manually, if i come back to the original size it shows like it should be (also Sizer helps to do it, although i did it without using it), so it's only when i go to from maximised to restore the window only.

Thanks!

Fenrirthviti commented 1 year ago

I am absolutely baffled at this point. I've had another person on the team test as well, and they also weren't able to replicate. I'm not even sure where to look at next. Might need someone else to take a look at this or test to see if they can replicate as well.

alinsavix commented 1 year ago

FWIW, I just gave this a shot, and I can't reproduce the issue, either (using Firefox on Win 11 and OBS 29.1.2, in this case)

Warchamp7 commented 1 year ago

@LukasThyWalls Can you do a recording with just a full display capture and at least one of your cropped sources shown on top. You mentioned having two monitors so place OBS on the second one to avoid a hall of mirrors effect.

I'd like have a visual of the entire screen when this issue is happening for you.

LukasThyWalls commented 1 year ago

@LukasThyWalls Can you do a recording with just a full display capture and at least one of your cropped sources shown on top. You mentioned having two monitors so place OBS on the second one to avoid a hall of mirrors effect.

I'd like have a visual of the entire screen when this issue is happening for you.

Right now all the testing i'm doing is with a laptop with only one screen, the other computer with two screens was the one i realised the issue but i don't do heavy testing there because it's actually in use.

I tried to record anyway with one screen, putting the Edge URL above all and marked with a green back to be noticeable. To be noted, when i maximised and the search bar window capture change, is normal because in Edge the search bar position changes depending the size (In Firefox doesn't happen), but when i restore to the original window size, it should be the same as the window size is the same exactly than the beginning (what is the issue i'm talking about).

https://github.com/obsproject/obs-studio/assets/1467366/2ddd2220-5727-4a4a-8749-986647629773

Also the current log, that i didn't put here, although i don't think it's useful in this case as the other computer is way different and it has also the exact same issue: OBS_current_log_file_2023-06-11 01-08-25.txt

Thanks!

LukasThyWalls commented 11 months ago

Hello.

Only to point out and bring back some new testing i did: Third new computer (Different monitor, GPU, etc...), new clean Windows 10 installation, new clean installation of OBS Studio 29.1.3 with only the initial setup wizard done, and the first thing i did is to test this... and it happens exactly the same as the other two computers, the same issue as the videos.

I don't know why it is irreproducible by other people, but for me is always reproducible. Maybe is something weird like OBS and Windows is in Spanish (i tried it with OBS in English but it does the same), my user name path has a space (but in the first computer happens and the user name is a single word), some normal configuration/personalisation i normally do in Windows (and others don't) messes how OBS do this (I have the taskbar always shown, and the W10 theme is the normal black one with purple color). Really, i don't know... ¯\_(ツ)_/¯

Thanks.


EDIT 12/05/2023: To not to flood the issue with my comments about things i tested, i will edit this one meanwhile, specially when it doesn't add anything specific and important to clarify the issue, only is more info to add.

This afternoon i thought something else to test: Going back to older OBS releases looking for a different behaviour, because in any moment this issue had to begin and maybe I could find when. However, I went until 24.0.3 (Last 24.x build with Windows version) and 25.0 RC1 (First 25.x build), where is when it's added the actual way to do Window Capture in Windows 10 (by @jpark37) but also then this issue is there too. Also I noticed that if I try to use the old BitBlt method, Firefox doesn't render in OBS: With 25.0 RC1 and with actual 30.0 it's an all white source, and with 24.0.3 (What I suppose it only use the "old method" as it hasn't a selector as the new one is not implemented) it shows a freeze capture of the monitor view (all windows rendered above the selected Firefox Windows at that moment).

So, and because I think I'm pretty sure at some moment this was working correctly (But not take me as proof, that is because a couple years ago I setup some scenes cropping Firefox and I never had this issue then, and suddenly it came in all of them an unknown day and all have issues... so something has changed since then), it could be that something of how Windows 10 render these kind of Apps without title bars changed at some point (because a Windows Update or the App themselves using new update libraries) and OBS needs to be tweaked to crop them correctly again. But IDK why it's seems that only happens to me (in several computers!) and no one else can reproduce it...

That is for now what i could add, I hope someday can be useful to fix this....

Thanks.