2

Problem : I want make live stream from my camera attached to Raspberry pi 3 b+, which is connected to home WiFi. Streaming should be over internet. So that any client like Android/ iOS can stream it from anywhere. It is a security camera. There can be multiple Raspberry pi connected to home WiFi.

What I have tried :

1. Raw H.264

I could achieve the same by generating raw H.264 which android app could render. It was perfect. But this needs global IP and port to stream over internet. Problem in this method - I can not assign global IPs to multiple raspberry pi. and it needs port forwarding. Which is not acceptable in automated setup of security camera.

2. Another way

Tried this way too, but this tutorial shows a way to stream locally.

What is needed? What is preferred way to stream Raspberry Pi camera over internet to any device (at least Android/iOS)?

What could be the methods that YI Home Cameras are using?

hardillb
  • 12,813
  • 1
  • 21
  • 34

2 Answers2

3

If you are not going to allow any form of port forwarding your only option is to have an external server act as a relay.

The cameras will connect out to the known location on the internet and stream video to that location. The mobile app will then also connect to the server and stream data from there.

This solution also means that the mobile app doesn't need to know the IP address of the camera, which might change over time.

This is how nearly all the commercially available IoT "security" cameras work.

hardillb
  • 12,813
  • 1
  • 21
  • 34
1

IPv4 Address: If the Pi has been assigned an RFC 1918 non-routable IPv4 address- as you indicate it has- you'll have to use a DNAT, mapping the local IP of the Pi to the Public IP on the router. You'll configure the DNAT in the router. Then when a viewer attempts to access camera, the router will forward the traffic to the Pi on the internal IP address. In short, access to the camera must be proxied from the router to the camera- no direct connectivity is possible to it from the Internet.

IPv6 Address:. However, if you can assign the Pi a Global Unicast IPv6 address, no NAT'ing is required: viewers can hit the camera directly. Please note though that visitors will themselves require IPv6 connectivity to hit your camera.

Both IPv4 & IPv6 addressing methods will of course require entries in DNS to be accessed by a name.

F1Linux
  • 111
  • 2