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

Mouse pointer offset. #2

Closed
mayank1513 opened this issue Jul 21, 2020 · 13 comments
Closed

Mouse pointer offset. #2

mayank1513 opened this issue Jul 21, 2020 · 13 comments
Labels
bug Something isn't working

Comments

@mayank1513
Copy link

Nice script but some issues needs to be resolved before it can be used.

The image and cursor have large offset. I am using two monitors/display. I am capturing my second display. But image follows the mouse pointer only on primary display and that too with large offset.

@upgradeQ
Copy link
Owner

Offset happens when you resize the source which is used for cursor. This is fixed in update_crop which is used for zoom and highlight (if not resized).

Multiple monitors setup is not supported.

@upgradeQ upgradeQ added the bug Something isn't working label Jul 22, 2020
@upgradeQ
Copy link
Owner

@mayank1513 resizing now works.

Let me know if bug is persist.

@upgradeQ upgradeQ closed this as completed Aug 2, 2020
@Karmalakas
Copy link

Update crop doesn't change anything. I have cropped area and highlight image follows cursor as if recorded area wasn't cropped. It matches cursor when in one corner, but moving away from the corner increases the offset. What am I missing?

@Karmalakas Karmalakas mentioned this issue Dec 10, 2020
@upgradeQ
Copy link
Owner

@Karmalakas what is your use case? If you are trying to create zoom, might as well try using this script https://github.com/tryptech/obs-zoom-and-follow . Update crop checkbox is used for highlighting e.g: invert color, change gamma via color correction filter. It can be used as zoom but there is better solution for that by zoom and follow script.
If possible, can you create gif / video with what are you trying to do?

@Karmalakas
Copy link

Karmalakas commented Dec 12, 2020

Here you go. I hope this clarifies what I mean :) All I want, is just for the image to follow cursor

@upgradeQ
Copy link
Owner

Do your monitor resolution match base canvas resolution?

@Karmalakas
Copy link

Looks like it does
image

@upgradeQ
Copy link
Owner

There can't be any offset issue if you'll set base canvas resolution to your monitor resolution. Try adding a desktop capture again( so it will be updated). Also, did you resize your cursor (some scene item) ?

@upgradeQ upgradeQ reopened this Dec 13, 2020
@Karmalakas
Copy link

It works fine until I add crop filter
image

@Karmalakas
Copy link

Karmalakas commented Dec 13, 2020

Also noticed, if crop ratio doesn't match output ratio and I move desktop source to the left, cursor image completely ignores where my desktop ends and goes beyond the monitor frame (don't even know how to explain). It seems all cursor script cares about, is full display resolution and where cursor is on display and calculates where it should be on the output

https://youtu.be/D5sT1DUaMu0

@upgradeQ
Copy link
Owner

It seems all cursor script cares about, is full display resolution and where cursor is on display and calculates where it should be on the output

Exactly, here is the logic behind that

scale = obs.vec2()
obs.obs_sceneitem_get_scale(scene_item, scale)
scene_width, scene_height = apply_scale(
scale.x, scale.y, scene_width, scene_height
)
next_pos = obs.vec2()
next_pos.x, next_pos.y = get_position()
next_pos.x -= scene_width / 2
next_pos.y -= scene_height / 2
# set position to center of source where cursor is
obs.obs_sceneitem_set_pos(scene_item, next_pos)

You might also try different approach with scene item transform, hold alt and adjust crop region via dragging borders.

@Karmalakas
Copy link

But then in output video it leaves all this black area :(
I guess I'll just have to crop video after recording it

Anyway, thank you for this nice script :)

@upgradeQ
Copy link
Owner

Okay, I am closing it then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants