Video Streaming from ESP32-CAM

The IP address of 192.168.x.x is internal to your home network.
It can’t be resolved by the Blynk app or server.

Your WiFi router has two IP addresses - its public address, known as the WAN and its internal address, known as the LAN address. It’s the LAN (Local Area Network) address that you’ve quoted above, but that is local to your network.

Blynk can only see your WAN address (Wide Area Network). This is a single public IP address that is assigned by your ISP, and is normally dynamic (it changes from time to time, usually when you reboot your router).
Data sent to this WAN IP address is routed to the correct internal device by your router (hence its name).
For the router to correctly route data to your ESP32 CAM module you need to tell your router that any traffic on port XXXX needs to be routed to internal IP address 192.168.1.1
This is done by setting-up port forwarding rules in your router. Exactly how you do that will depend on your router, and the access to these settings that your ISP allows.

You may think that the traffic is flowing outwards from your ESP32 CAM module to Blynk, so why do inbound requests on the video streaming port need to be routed to the ESP32 CAM. This is because the Blynk widget needs to initialise the stream, so it sends an inbound message saying “give me your video”. Without this the video stream won’t initialise.

Most people have a dynamic public IP address, and to ensure that the Blynk app knows what that is whenever it changes, you need to use a Dynamic Domain Name System (DDNS) service which gives you a static URL, but forwards inbound data on that URL to your current public (WAN) IP address. For the DDNS service to know your current public IP address you need to be running an updater service on a device within your private network. This could be your router, if it has a DDNS facility, or it could be a device running an updater client.
Common free DDNS services are NoIP.com and DuckDNS.net

So, (unless you have a static public IP addresss) you need a DDNS service and an updater.
You then need to have your ESP32 CAM set-up with a static internal IP address (so that your router’s DHCP system doesn’t allocate it a different IP when it reboots) and forward inbound and outbound data packets on whichever port you’re using for video streaming to/from your ESP32 CAM’s internal IP address.
You then use your DDNS URL and the video streaming port in the Blynk video streaming app.

Pete.

2 Likes