Raspberry Pi Projects: Live Streaming Using Raspberry Pi Development Board

By Somnath Bera


Port forwarding

Now, try to access the live-streaming video from any other available network using port forwarding. To enable this on your home broadband router for Raspi on port 8081, follow the steps given below.

A router provides the route between the Intranet and the Internet. Most routers are set to work one way, although almost all routers have provision to work both ways. The most-popular route set to operate is from the Internet to the Intranet. For example, you are watching a Web page and sending mail, and all traffic is from the outside world to the inside.
In almost all router administration pages, there is port-forwarding facility that helps create the traffic route, which allows driving of contents from the Intranet to the Internet.
The router does not see which computer to use for reverse traffic flow; it only sees which port to allow for traffic flow.

Open Advanced page (of your modem or router’s administration page) and click on Port Forwarding.

Set the port (say, 8081, 8082, 5678, 8083 and so on) and associate the IP address of Raspi. This port will drive its contents to the Internet. In our case, anyone can view the contents by calling public IP address along with port 8081.

But the problem still remains—which computer’s IP address should be entered on the browser page?

For that, find out the IP address of the modem or router obtained from the Internet service provider at that point of time. For that, go to the status page of router again and find out its external IP address (say, http://a1.a2.a3.a4). This is your public IP address.
Now, you can share this IP address along with the port number with your friend. He or she can enter this IP address plus port number on the browser to access your live-streaming video.

Note that, this IP address may undergo changes many times in a day, as most home connections have a dynamic public IP address. So keep track of it before enabling port forwarding.

Author’s old mobile phones connected to a laptop for live streaming

The easiest way to get an external IP is to use an old mobile with a SIM card along with an Internet pack, and go online. Run ifconfig at command prompt; you will get the external IP address for the laptop or Raspi.

The old mobile acts as a modem to get connected with the Internet for reverse traffic flow. Since the modem in the phone is primitive in nature, it has no firewall. When an old mobile is connected to the Internet it gets a public IP address (202.54.x.x or 132.56.x.x) unlike 192.168.x.x or

In short, if your friend wants to access your live-streaming video through your computer, he or she can type, say, http://a1.a2.a3.a4:8081 on the browser or VLC player of his or her computer or mobile phone. And you can talk on your old phone as you look at the live-streaming video on your computer.

You may also like these DIYs: click here

Somnath Bera is an avid user of open source software. Professionally, he is a thermal power expert and works as additional general manager at NTPC Ltd


Please enter your comment!
Please enter your name here