obs-zoom-and-follow icon indicating copy to clipboard operation
obs-zoom-and-follow copied to clipboard

Multi-Monitor and PyWInCtl, PyMonCtl and PyWinBox issues

Open Kalmat opened this issue 2 years ago • 4 comments

Hi @tryptech!

Some users are opening issues about multi-monitor and PyWinCtl related to OBS-Zoom-and-Follow. I just wanted to check with you if we can work together in order to fine-tune everything in this sense.

Regarding PyWinCtl (and all its dependencies), some quick tips:

  • v0.0.40 and above will require Python 3.7 or above (it is a typed version, using typing_extensions, available only in 3.7+). If using Python 3.6 or below, v0.0.38 is fine (but not for multi-monitor setups).
  • Multi-monitor setups will require version 0.2 or above (latest PyMonCtl and PyWinBox versions are highly recommended in this case, as well as Python 3.10+)
  • In case you find a "no module named" error, but you are sure that all modules are actually installed, perhaps this can help:
    • For windows users, check this.
    • For Linux users, Linux uses to come with a built-in version of Python, which you can not modify. It typically complains about "error: externally-managed-environment" when you try to install any module on it. Be sure that OBS is not using this default, built-in Python version, but the one which allows installing new modules and the one in which PyWinCtl (and all its dependencies) is installed.
    • In general, check OBS paths related to Python to assure using the right Python version and location (sorry I can not be more specific since I am not skilled in OBS).

Kalmat avatar Oct 05 '23 08:10 Kalmat

@Kalmat I appreciate the check in.

  • Multi-monitor is something I need to work on further to make sure it works 100%.

    • I've tested it in macOS recently using a 42" 3840x2160 primary display, and a 12.9" iPad Pro as a secondary display. It seems to work without issue regardless of monitor position and display scaling.
    • I need to find the time to test Windows 11 under the same conditions.
    • I would need to find someone to test/maintain Linux compatibility with respect to all the major desktop environments/window managers as I do not use any Linux systems myself.
    • I run off the assumption that PyWinCtl and PyMonCtl report information in a system-agnostic way, which mostly holds.
    • I also run off the assumption that OBS reports information in a system-agnostic way, which does not hold consistently.
  • In regards to Python installation/dependency issues, I can only provide support as far as Python 3.10+ on the most recent versions of Windows 11 and macOS, as those are the systems I maintain for myself.

    • I have listed within the description the installation instructions insofar as installing dependencies from a requirements.txt file, which lists the following:
    PyWinCtl>= 0.0.50
    PyMonCtl>= 0.3
    typing-extensions>= 4.7.1
    
    • There are a number of third party "how to install" videos out regarding obs-zoom-and-follow. Some of them are outdated, and some of them do weird things with their installation and I cannot personally keep up with vetting these as they come up nor contacting the authors whenever there are breaking changes.
    • There is a large casual, non-technical user base for OBS which makes troubleshooting difficult. It is not necessarily their fault but it leads to a number of issues in and of itself:
      • Not knowing how to report an issue in a detailed way
        • I could try to provide a template that lists all of the information that would make it easier for me to parse
      • Not knowing the technicalities of using Python and OBS
        • Wrong version of Python/OBS
        • Did not install dependencies/installed dependencies to the wrong version of Python
        • Configuring the wrong version of Python within OBS

Proceeding the , the install process in it's entirety is as follows:

  1. Install the most recent version of OBS
  2. Install the most recent version of Python supported by OBS
  3. Download the script git repository
  4. Install the requirements from the git onto the OBS-supported Python
  5. Configure the OBS-supported Python in OBS
  6. Add the obs-zoom-and-follow script to OBS
  7. Configure the script in OBS as per the "How to Use" section

Following this installation procedure, I commonly see the following issues:

    • Some users do not update their OBS regularly. I understand the hesitation as any major changes could break support with other plugins, or fundamentally change layouts. But I do not want to maintain for multiple versions of OBS when some of the data from their Python API is inconsistent between operating systems already.
    • OBS in the past has not always used the most recent version of Python. Previous versions of OBS were stuck to using Python 3.6.8 on Windows for a while.
    • Some users are using portable versions of Python in which they aren't fully aware of what they're installing or using, making it somewhat ambiguous as to what version of Python they might actually be using.
    • As you said, some Linux users have a built-in version of Python, which causes confusion as to what version of Python they're installing to altogether.
    • Some users do not get the most recent version of the script, either from having an old version on hand, or by using one distributed from another source.
    • Some users do not install the requirements at all, either because they do not install from the GitHub project directly, or they do not read the README.
    • Some users are not aware of this configuration option in the scripts section of OBS.
    • Some users configure the wrong Python version.
    • Some users install old versions of the script which I can't guarantee the function of with their combination of OS/Python/OBS
    • Old versions of the script had trouble here when loading sources. That has been factored out in recent versions of the script.
    • OBS changes have sometimes broken the script config behind the scenes.

I'm open to suggestions on how the install process can be improved or streamlined, but I do not believe the onus is on you to support at all since your libraries work as intended, and I do not believe that the onus is on me to address basic installation issues of OBS or Python.

tryptech avatar Oct 06 '23 01:10 tryptech

Ok, I understand and fully agree with you. Sorry for my complete ignorance about OBS.

You are totally right that it is really complex and totally out of our reach. Thank you so much for your complete and very clear explanation. Just guessing, maybe it can be helpful to pin this answer (or a similar text) somewhere in Issues and/or Discussions (it's a pitty that github has no "troubleshooting" section). Maybe that way all users can easily find it and even help each other. Taking into account the "audience" your script is addressed to, perhaps a video showing the whole installation process and common mistakes may help (I know, I know... though definitely useful, maybe recording a video it's too much. It would also be extremely hard in my case... HAHAHAHA!)

Regarding Linux, I can run the tests. I have 2 monitors, actual installs of Ubuntu/GNOME, Ubuntu/Wayland and Manjaro/KDE; and VM installs of Mint/Cinnamon, KUbuntu and Raspbian. I can install some others if required. Just let me know how to. About maintaining it in Linux, most likely I will not be able because of, again, my total ignorance about OBS... But perhaps we can work together on it, or you can show me how to, or... well, who knows.

Kalmat avatar Oct 07 '23 19:10 Kalmat

Hey! Just installed OBS Studio (v.29.1.3 64bit) in Ubuntu/GNOME from the Ubuntu Software Center. Once open, everything looks like black magic to me, to be honest... Well, let's get to the point:

  1. There is no "Python Path" option or similar (not inside "Tools -> Scripts", nor anywhere else that I could find)
  2. After loading OBS-Zoom-and-Follow script, I get the same message as many users: "ModuleNotFoundError: No module named 'pywinctl'"
  3. I then uninstalled OBS and installed it by following the Linux official installation page... Voilá! The ModuleNotFoundError is gone!!!

The conclusion is clear: if you install OBS from the Ubuntu Software Center, it fails; but it's OK if you install it from their repository.

If you or anyone else can provide me with some basic instructions on how to test the script, I can perform some basic tests to check if everything properly works in Linux. Furthermore, if you need to specifically test/debug something, just let me know.

Kalmat avatar Oct 14 '23 19:10 Kalmat

A lot of issues come down to dependencies that differ. One solution "could be" getting the OBS Zoom and Follow script included into the OBS Flatpak package - that way any Linux distro can install OBS and use it, and it may negate the mix-match of modules and dependences. The issue with the Flatpak is we can't install scripts ourselves, so the Flatpak maintainer needs to include the script. The Zoom and Follow script is very popular so I can't see why they would not include it.

I see this request was already logged at https://github.com/obsproject/obs-studio/pull/8708, but closed and suggested it should be an installable plugin for the Flatpak version. It is explained at https://github.com/flathub/com.obsproject.Studio/wiki/Plugins how plugins can be distributed for the Flatpak version.

OBS Studio plugins can be distributed on Flathub as Flatpak extensions. This is the preferred method of distributing plugins. By using Flatpak for distribution, plugins can request additional permissions and alter some aspects of the sandbox.

Seems then there will be a standard OBS Studio base to support as the Flatpak is officially supported by OBS.

Danie10 avatar Oct 17 '23 19:10 Danie10