-1

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?

Kush Swarnkar
  • 21
  • 1
  • 4

5 Answers5

2

You need to port forward to the pi's from your router. If you look in the settings there should be options related to port forwarding. Once you've set up a forward you can access it using your external IP.

rohtua
  • 469
  • 1
  • 4
  • 8
1

This answer is mainly respected to the first revision of the question.

You already have public ip addresses for all your devices. So you can address all devices direct from the internet using its public ip addresses. You only have to setup the static public ip address on the RasPis. How to do it you can look at Setup a Static IP Address.

You have gotten the public ip addresses from your internet provider. He usually ensures that these addresses are visible in the internet. Most of them will give you a modem (or a router configured as modem) - not a router - to ensure that the ip addresses are part of the public subnet of the provider. Maybe you have to configure your own router this way. If your provider uses pppoe for internet connection there may be different settings. As you see there cannot be given general information here. It is primary a service of your internet provider.

And as you also see the only issue belonging to Raspberry Pi is to give them a static ip address. Everything else is part of the internet modem/router. So for details about the internet connection you should ask your internet provider and if further help is needed you can ask at https://serverfault.com

Ingo
  • 42,961
  • 20
  • 87
  • 207
1

If port forwarding and using your WAN IP address is distasteful for you then you could try setting up a VPN hosted on a more secure host instead. You'd need to then connect each mobile/remote device and the Pi to the VPN in order to view the stream.

For example, I've used ZeroTier for this sort of thing in the past to get SSH access to my Pi without having to configure anything on the WAN gateway or needing to know the WAN IP address either. They have clients for Linux, Mac/iOS, Windows, and Android and it's free for small networks (<101 nodes) and reasonable for larger ones.

Other VPN solutions are available and might be better suited if you want to tweak the system.

Roger Jones
  • 1,484
  • 8
  • 14
1

You could use Youtube Live Streaming or Other Live Streaming Software like Wowza, Where global IP and port forwarding setup is not required.

To start with checkout this link. https://www.raspberrypi.org/blog/youtube-live-streaming-docker/

For example I am using following ffmpeg command to Stream to my Youtube channel from raspberry pi

ffmpeg -re -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -f v4l2 -c:v rawvideo -i /dev/video0 -c:v h264_omx  -r 60 -s 960x540 -b 6000k  -threads 6  -acodec aac -ab 128k -g 50 -strict experimental -f flv <Youtube rtmp link here>
karan
  • 116
  • 3
1

If you want to stream, you can use MotionEye. It's easy to add to Raspberry Pi. You can use bash script from this GitHub project.

It will be available from your-raspberry-ip:8888. Also, you can see and implement base configuration from This link. It contains adding static ip-address, which is important to be sure, that you can get access every time for your raspberry.

If you have questions - create issue.

Best regards, Roman.

romankh3
  • 165
  • 1
  • 1
  • 13