Question / Help Fit canvas size to window

reimus

New Member
I've searched everywhere for an answer to this and I've only found people trying to fit game windows to canvas size.

Question:
Is there anyway to fit the canvas size to the captured window?

I am recording one game that has somewhere near a 4:3 aspect ratio and I want to record just that. When I record, I get a lot of black space. If it use the transform feature, there is a LOT of stretching.

There is another VR game I am playing that has some weird 9:16 aspect ratio or something like that. I want to potentially record exactly what is being output to my monitor.

I can't imagine that this would be an odd request.

Also, I could possibly handle switching the settings (thought that would be cumbersome and likely lead to a lot of lost footage if I forget when switching between games) but there are only a set number of unchangeable canvas sizes. I recall someone saying that you could use some crop filter but it appears that either doesn't work, or you need to know the exact size and window position. I haven't messed around with that much since it doesn't seem to work
 
Last edited:

koala

Active Member
Is there anyway to fit the canvas size to the captured window?
No, there isn't a way to do that. This is because
  1. it isn't possible to change the resolution of a video or a stream in the middle of the recording/streaming. This is a technical characteristic of the streaming protocols and of the video container formats and of the media players. Thus, it makes no sense to fit the canvas on the fly, because you would not be able to use it.
  2. OBS composites multiple sources into one output video. To which of your sources do you want to fit the canvas? What should happen, if other sources get outside of the canvas? Or if they get too small, or too big? If you use only one source, you might not have realized that such an automatic fitting will mess up the screen composition.
  3. changing the canvas size puts a different load on the machine. Lager canvas size means higher system load, and higher system load means higher possibility of overloading the encoder. It's already difficult enough to tune the encoder settings according to a given resolution. To accomodate encoder settings dynamically according to changing resolutions is probably impossible.
What does exist is an automatic resizing of the source within the canvas. This way, you are able to get the original video without rescaling or distorting. Choose as canvas size the largest resolution you expect from your source and put the source to the top left corner of the canvas. It will extend to the right and to the bottom as the source resolution changes.

In a post processing step, after all recording, you load your recorded footage into a video editor and split the video in parts according to the then-current resolution and crop the black borders to the right and to the bottom accordingly. In this post processing step you are able to do any resizing or rescaling of your VR footage unhurriedly. Usually, the postprocessing features of a video editor are more sophisticated than the filters of OBS, so you will produce better videos this way.
 
Last edited:

reimus

New Member
That's a shame. So far every other video recording software I've worked with has this feature, though they aren't advanced enough to allow the multiple sources. I'd imagine that the feature I am looking for would be sought after enough that it would be implemented into this software.

The solution is easy enough because all you would need is to have an additional option in the settings output menu where you could select "Fit to source" instead of selecting the canvas size to be 1920x1080, etc. If it's too confusing for people, you could even have a warning message (like the one that appears for recording to mp4) that states that the canvas size is locked into the viewable sources at the start of recording.
 

jsg

New Member
I also looked everywhere to do this same simple thing:
I have a window with a fixed (and unknown) size and I just want to capture that without rescaling anything. I can't understand a so obvious feature is not implemented. I will just jump to another capture software, which is a pity because OBS seemed to be quiet powerful.
 

prakthetruthful

New Member
No disrespect intended, but it seems koala misunderstood the request, and answered with respect to modifying canvas size during the recording session.

Add me to the list of people who'd like a "set canvas size to current window" solution, or even being able to manually set base/output resolutions, FIXED for the entire recording.

So can we please treat this question as being unanswered? I have hope that there actually is a way - find it hard to believe that we're forced into canvas sizes of 720p or 1080p !
 

koala

Active Member
You can enter any resolution as canvas size. You are not limited to the values in the dropdown list. Just directly enter your numbers into the field in 1234x5678 format. It's only that a custom number has to be entered manually and is not automatically filled by the size of some source.
To be able to quickly switch between a few fixed different resolutions, create different OBS profiles. One for each resolution.

There is a commit in the current development version of OBS, which is labeled Add ability to resize output based on source size, but it seems this is just a new menu entry to avoid manual copy of the size value, no automatic thing.
 

RobmOz

New Member
I'm really keen for this feature as well as I just use OBS to capture windows that are not full screen.

I think this would require being about to change the size of the output stream to match the source?
 

gremlin

New Member
Untitled.png

This is right click on Source. I do not see "Resize output (source size) "
 

jptobs

New Member
How to make "Resize output (source size) " always enable?
I need to press "CTRL+F" to make "Resize output (source size) " to active every time after quit the program.
 

Zippydsmlee

New Member
In version 28.1.2 , its under edit(by file at the top left of screen) select preview scaling, then you can set it to scale by size or output sources. I hope this helps.
 

snlehton

New Member
I was asking for a free screen capture software for WIndows to sharing clips of game play/tools I'm working on etc. Part of the screen basically.

I think there's some confusion here. What OP asked is how to set the output size to the size of a window capture, and not vice versa which many are saying. You can do this by hand, but it's extremely tedious. You can easily record a screen, and then crop it using the ALT + those red handles.
1674120208223.png


However, that's when the struggle happens. I now have an arbitrarily shaped rectangle on the screen, and I'd like to set the size of the output to match that rectangle.
1674120518138.png

Using "Resize output (source size)" sounds like it would set the size of the output to the source size, which it probably does, but it doesn't consider the cropped size but the original source size (2560x1440 in my case) and then OBS scales up the cropped element to match the output, but this leaves black space, as the aspect ratios don't match (and the output size is huge anyway)

1674120682018.png

If you want to do it manually, you can choose "Transform/Edit Transform..." and then calculate the rectangle size from there, and go, and adjust the output size manually, and scale the cropped element to full output size.
1674120836188.png


There's a slightly less painful solution (but only slightly) where instead of cropping the element, you add a Crop/Pad filter to it. But unfortunately that filter does not have any visual handles, only text input, and adjusting the crop numbers is quite pain.
1674121042349.png


But after cropping that way, the "Resize output (source size)" does what you'd expect and you get a exact size of the element.

1674121111782.png


The easiest(?) solution would be for the "Resize output (source size)" function to actually consider the cropped size and not the source size. TBH this feels like a bug to me anyway. Why would you want to resize using the original source size if you've cropped the element anyway?
 

Akito

New Member
Well. This is utterly baffling.

First, a comment on the feature's availability.

It's in OBS for almost 2 years already. Right-click your source->"Resize output (source size)".

This is technically what is needed, but the setup of it is way too cumbersome & fidgety. I wouldn't use it on a daily basis, especially when having lots of different things to record.

For example, you would need to create a profile for each window you ever record more than once. Even worse, the same window can have a different size the next day, so you again have to resize. This is a nightmare.
The least cumbersome way to use this feature is to manually activate the resizing before every recording. This does not go along well with the whole idea of profiles & having everything "ready to go", at all. You would be always one step behind starting the recording & would be forced to never forget the activation.



As a user, I am going to describe what I would expect from this feature.

I have window of an arbitrary size. It is arbitrary to begin with, but does not change during recording.
I select the profile, which has a setting like "Always adjust Output Size to current Window Size" enabled.
I select the Scene & the only window in it automatically sets the resolutions correctly.
If the Scene has more than one window, the first one in the ordered list is used to set the resolutions.
I start the recording & the output matches the window, exactly. Easy.
 

WhazzItToYa

New Member
As a user, I am going to describe what I would expect from this feature.

I have window of an arbitrary size. It is arbitrary to begin with, but does not change during recording.
I select the profile, which has a setting like "Always adjust Output Size to current Window Size" enabled.
I select the Scene & the only window in it automatically sets the resolutions correctly.
If the Scene has more than one window, the first one in the ordered list is used to set the resolutions.
I start the recording & the output matches the window, exactly. Easy.

Given that OBS's primary use-case is to composite lots of different sources into an output stream, I'm not surprised that such a specific behavior to change output size based on a single source hasn't been prioritized (or indeed, even thought of).

If you're technically minded, OBS has a script engine built in, and you could almost certainly probably script the behavior you're describing.
 
Top