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

Doesn't work on MacOS #4

Open
codinginpython123 opened this issue Feb 12, 2021 · 5 comments
Open

Doesn't work on MacOS #4

codinginpython123 opened this issue Feb 12, 2021 · 5 comments

Comments

@codinginpython123
Copy link

On MacOS there is a limitation: You can't run a gui outside the MAIN Thread. @NeuralNine please find a way to run the the gui in the Main Thread to have compatability with MacOS.

@NeuralNine
Copy link
Owner

Thanks for the information. I don't have any MacOS systems I can test this package on at the moment. I will work on it once I have the possibility. Of course I am also happy to accept pull requests from Mac users that are able to fix this issue.

@codinginpython123
Copy link
Author

codinginpython123 commented Feb 15, 2021

Thanks for the information. I don't have any MacOS systems I can test this package on at the moment. I will work on it once I have the possibility. Of course I am also happy to accept pull requests from Mac users that are able to fix this issue.

Thanks for replying to my issue. I also have a Windows machine but my mac is my main programming computer! I will also try it on the Windows machine. I will try to make the library work in MacOS myself too. Also huge fan of your Youtube Channel!

@codinginpython123
Copy link
Author

codinginpython123 commented Feb 17, 2021

I studied the source code of vidstream and if i find a way to not put the __client_connection function on the StreamingServer class inside a Thread it may work on MacOS

@chatLong
Copy link

chatLong commented Apr 5, 2023

I studied the source code of vidstream and if i find a way to not put the __client_connection function on the StreamingServer class inside a Thread it may work on MacOS

Hello, I'm also a mac user. Do you can share your solution ?

@YanivFalik
Copy link

YanivFalik commented May 21, 2024

Hi,
Had this bug also :)
This helped me - opencv/opencv#22602
The thing is macOs doesn't allow UI actions from threads other then main thread.
Meaning in StreamingServer.start_server program initiate new thread of __server_listening.
So when we try to do UI action in line 179
cv2.imshow(str(address), frame)
We'll get an error.

I tried to init __server_listening in another process, i.e:
`.

    """
    Starts the server if it is not running already.
    """
   def start_server(self)
    if self.__running:
        print("Server is already running")
    else:
        self.__running = True
        processId = os.fork()
        if processId > 0:
            self.__server_listening()

`

and it worked fine.

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

No branches or pull requests

4 participants