Add a parameter to your app.run()
. By default it runs on localhost, change it to app.run(host= '0.0.0.0')
to run on all your machine's IP addresses. 0.0.0.0
is a special value, you'll need to navigate to the actual IP address.
if __name__ == '__main__':
app.run(host= '0.0.0.0',debug=True)
Then a Client Browser need your machine IP and your open port to navigate and view the Stream
http://your-machine-ip:5000
So the mechanism is that your machine create a file index.html and serve it when a external Browser request the address
http://your-machine-ip:5000
put your index.html in folder templates/index.html
More details here : Configure Flask dev server to be visible across the network
I think you need camera.release()
also.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…