Search code examples
pythonpython-2.7mjpegsimplecv

SimpleCV Jpeg Streamer only works with local host


When I run the following python code and connect to in chrome localhost:8080 I can see my camera but then if I try to connect to TheComputersIP:8080 on chrome on another device on the same network I cant connect and just get error connection refused. I'm not sure how to fix it and any help would be greatly appreciated (The script is being run on windows using PyCharm).

from SimpleCV import *

w=640/2
h=480/2

cam = Camera(0,{"width":w,"height":h})

disp =Display()

js = JpegStreamer(8080,0.01)
print(js.url())
print(js.streamUrl())

while disp.isNotDone():
    img = cam.getImage()
    img.show()
    img.save(js)

Solution

  • Solved it now just changed:

    js = JpegStreamer(8080,0.01)
    

    to:

    js = JpegStreamer("0.0.0.0:8080",0.01)