Reputation: 1260
I have raspberryPi camera with mjpeg stream to show live streaming. Right now when I create a web-server inside the local network I am able to see the live stream on web browser using simple html iframe
. Now I need to move my webserver to public server and I will not be able to do port forwarding with raspberryPi to show the live on web-page.
Is there any way to stream a video feed to we-browser where the server is publicly accessible. I have found the webRTC. Is there any quicker why available to make stream a camera feed to website. That is peer to peer connection between a web Browser and raspbarryPi where no port forwarding can be do at raspbarryPi.
Upvotes: 1
Views: 2745
Reputation: 115
I know it's an old question, but will answer for the late me. I answered a similar question here. It boils down to:
/usr/bin/autossh -N -f -M 0 -i /home/pi/.ssh/id_rsa -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -R 10554:192.168.1.100:554 [email protected]
where:
-N
: don't execute any command via SSH-f
: put SSH in the background-R
: remote port forwarding10554
: a port to open on the VPS to access the IP camera (better if > 1024)192.168.1.100:554
: IP address and port you want to access remotely[email protected]
: user and address of your VPSTo access the RTSP stream of the camera, open rtsp://<username>:<password>@example.com:10554/<path-to-stream>
.
Of course it works fine also for other kind of streams (e.g. HTTP).
Upvotes: 0
Reputation: 1469
Make port public using ngrok.com
This tool can make a port publicly accessible without router access. It creates a link from where you can see your current link to your webcam. The free version of ngrok do have some limitations like that max amount of new connections per minute.
Port forwarding through VPS using ssh
In Godaddy you can also create an ubuntu system. You can open ports on this system for it to be accessible from anywhere. Then on your raspberry-pi you can run ssh -L [public-port]:localhost:[private-port] [youruser]@[server-ip]
example: ssh -L 3000:localhost:3000 [email protected]
. This would make your project on the raspberry pi on port 3000 be accessible with "mywebsite.com:3000"
Upvotes: 2