Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partial recorder bug fix + app version included in logs / titlebar #102

Closed
wants to merge 21 commits into from

Conversation

NickIs211
Copy link
Contributor

No description provided.

src/main/obsRecorder.ts Outdated Show resolved Hide resolved
src/main/obsRecorder.ts Outdated Show resolved Hide resolved
@tdaugaard
Copy link
Contributor

I think there might be a better way to fix the issue of this +/- 1 pixel thing due to the scaling; someone said somewhere on the Internet that you could simply use Math.floor() on the calculation where it multiplies by the scaling factor. Perhaps that would be better to test out?

aza547 and others added 2 commits September 15, 2022 20:07
* feb22 backup

* fix playerCombatant bug
* Cleanup application status values and logic

- Create an enum for the application status values in a new module,
  `main/types`.

- Replace `if..else` with an object of messages mapped to the new
  `AppStatus` enums.

* Address comments in PR aza547#104
@aza547
Copy link
Owner

aza547 commented Sep 15, 2022

I think there might be a better way to fix the issue of this +/- 1 pixel thing due to the scaling; someone said somewhere on the Internet that you could simply use Math.floor() on the calculation where it multiplies by the scaling factor. Perhaps that would be better to test out?

I think this is what @NickIs211 initially suggested in discord and I steered away from it. Might have been right all along. Not had a chance to look over this beyond the comments yet so not sure of my opinion. Will get a chance at the weekend.

tdaugaard and others added 5 commits September 16, 2022 22:01
Add `enum UnitFlag` to types for easier identification of the various
flags that a unit can have.

Add `isUnitPlayer()` to easier identify a player controlled unit.

Refactor `isUnitSelf()` to make use of `isUnitPlayer()` and `UnitFlags`.
* Remember volume and mute state when changing video

* Avoid re-render when not needed

We don't need to use `useState()` for reading and storing the current settings
of the video player, only during the `useEffect()` call when
`state.videoIndex` changes as the current state is being passed to
`useState()` when the video changes in `handleChangeVideo()`.
Copy link
Owner

@aza547 aza547 left a comment

Choose a reason for hiding this comment

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

Hi, thanks for the PR, sorry for taking so long to get to it (and I've still only had a second glance). There is a bunch of changes here that I think are due to other PRs. Could you catch up with main by either merging it in or rebasing please?

I've quickly checked the version stuff which is awesome, curious why I see 18.0.3 on dev builds? You mentioned in comments that it works fine for release builds. Why the difference? I searched the repo for 18.0.3 and couldn't find a reference to it! Where is it coming from?

I've not managed to review the OBS bits as I'm not awake enough, but I promise I'll get to them soon!

src/main/main.ts Show resolved Hide resolved
tdaugaard and others added 7 commits September 16, 2022 23:41
…za547#106)

* Fix problem with `maxSplits` in `splitLogLine()`

`break` wasn't breaking out of both the `switch` and the `for` blocks,
which is should have, causing us to not limit the number of splits we
did but also to split incorrectly as `value` wasn't cleared before
starting the next element value.

* Fix off-by-one for month in `LogLine`date()`

`Date.getMonth()` returns a zero based month number, with January being
0 and December being 11. This caused months to be off-by-one during
parsing into a proper date.
* Refactor `categories` to be an enum type

* Address comments in PR aza547#109
* Initial attempt at adding min encounter duration

* Add default minimum encounter duration setting

* Clean up syntax / formatting
Copy link
Owner

@aza547 aza547 left a comment

Choose a reason for hiding this comment

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

Hi, happy enough with the function, but a few code style comments for you to fix up. Thanks!

src/main/obsRecorder.ts Outdated Show resolved Hide resolved
src/main/obsRecorder.ts Outdated Show resolved Hide resolved
src/main/obsRecorder.ts Outdated Show resolved Hide resolved
src/main/obsRecorder.ts Outdated Show resolved Hide resolved
return isClose(parseInt(resW, 10), physicalWidth) && isClose(parseInt(resH, 10), physicalHeight);
};

// TODO: Output should eventually be moved into a setting field to be scaled down. For now it matches the monitor resolution.
Copy link
Owner

Choose a reason for hiding this comment

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

Where did this information come from? It's news to me - I'm quite keen to understand OBS better so if you have knowledge please share!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

Video.Base translates to Base Canvas Resolution, which is the size of the scene we are creating. For current purposes, this should always match monitor resolution.
Video.Output translates to Output Resolution, which is the video resolution we're recording at. For users where storage space is a concern, they should be able to change the output resolution to a size that they find acceptable, say 720p. Currently, with this setup, users with 4k monitors will record at 4k.

Copy link
Owner

Choose a reason for hiding this comment

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

Ah I see. That's interesting for #67 if you fancy tackling another issue after!

src/main/obsRecorder.ts Outdated Show resolved Hide resolved
src/main/obsRecorder.ts Outdated Show resolved Hide resolved
src/main/obsRecorder.ts Outdated Show resolved Hide resolved
@NickIs211
Copy link
Contributor Author

@aza547 code refactored based on comments above

Copy link
Owner

@aza547 aza547 left a comment

Choose a reason for hiding this comment

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

Nice. This looks good, with the only problem being I'm not sure what happens if I try to merge this given the massive "files changed" page. I'm not good enough with git to know how to resolve (thought merge / rebase would do it) - can you either fix that via some git means (if you are better with it than me!) or re-create the PR so it's got a clean diff? Then I'm happy to merge!

return isClose(parseInt(resW, 10), physicalWidth) && isClose(parseInt(resH, 10), physicalHeight);
};

// TODO: Output should eventually be moved into a setting field to be scaled down. For now it matches the monitor resolution.
Copy link
Owner

Choose a reason for hiding this comment

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

Ah I see. That's interesting for #67 if you fancy tackling another issue after!

// Update source settings:
let settings = videoSource.settings;
settings['monitor'] = monitorIndexFromZero;
settings['width'] = physicalWidth;
Copy link
Owner

Choose a reason for hiding this comment

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

Were these doing anything at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They weren't being respected when creating anything really, and looking at

https://github.com/stream-labs/obs-studio-node/blob/5e22aaa87103ddc4f234d6b0f73d173e9b76b507/tests/osn-tests/util/input_settings.ts#L106
https://github.com/stream-labs/obs-studio-node/blob/d048994aac4c3988e5f300d835feabdf8e57a3df/tests/osn-tests/src/test_osn_input.ts#L134

They don't seem to be used properties during osn testing. Also couldn't find the related fields in the libobs docs.

@aza547
Copy link
Owner

aza547 commented Sep 18, 2022

Also in the new PR, please add a changelog fixed entry linked to #96.

@aza547 aza547 mentioned this pull request Sep 18, 2022
@NickIs211
Copy link
Contributor Author

NickIs211 commented Sep 18, 2022

Nice. This looks good, with the only problem being I'm not sure what happens if I try to merge this given the massive "files changed" page. I'm not good enough with git to know how to resolve (thought merge / rebase would do it) - can you either fix that via some git means (if you are better with it than me!) or re-create the PR so it's got a clean diff? Then I'm happy to merge!

Should be all good now. I initially merged main branch instead of bug-fixes ;;;;;;
@aza547

@aza547
Copy link
Owner

aza547 commented Sep 18, 2022

Nice. This looks good, with the only problem being I'm not sure what happens if I try to merge this given the massive "files changed" page. I'm not good enough with git to know how to resolve (thought merge / rebase would do it) - can you either fix that via some git means (if you are better with it than me!) or re-create the PR so it's got a clean diff? Then I'm happy to merge!

Should be all good now. I initially merged main branch instead of bug-fixes ;;;;;; @aza547

Hmm I still see 22 files changed (and lots of stuff from other commits). I think I was expecting merging main to be the correct thing to do (I'm not sure what bug-fixes is/was).

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.

4 participants