NeuralNine / vidstream

Streaming video data via networks

Home Page:https://pypi.org/project/vidstream/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't work on MacOS

codinginpython123 opened this issue · comments

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.

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 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!

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

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 ?

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.