WIFI IP Camera

ilan

Expert
Licensed User
Longtime User
hi

i just bought a cheap WIFI IP Cam so i can check my 3d Printer if it is still printing and has no error. First i am really surprised from the camera that is really good and also the app is very nice but what surprised me more is the fact that i don't need a static ip to connect to it. i was sure i will need a static ip but it works also with a dynamic ip and my question is HOW?

it is is interesting to understand how they did it so i can run web servers and connected to without a need of a static ip.

does anyone has an idea how they did it?
 

ilan

Expert
Licensed User
Longtime User
Camera stream to remote server, then app stream from that remote server.
i am not i understood.
the camera is connected to a router. the router has a dynamic ip.

now when i open the app how is it telling the camera to stream to a server and the app show the stream?
are you saying the camera is streaming 24/7? this will use all bandwidth mine and also the server bandwidth and if 1000 camera are streaming at the same time it will be impossible. they sell many of those camera so i cannot imaging the stream is always running to there server and if it is only streaming when i enter the app then who tells the camera to do the stream at that moment?

i also need to mention that it runs very smooth.
 

Pendrush

Well-Known Member
Licensed User
Longtime User
When you run app, app contact server, server contact camera through socket or websocket or whatever protocol and tell camera to start stream.

EDIT:
If you have MikroTik router or similar, you can very easy see what, when and how camera get connection with app.
 

ilan

Expert
Licensed User
Longtime User
When you run app, app contact server, server contact camera
how?

server doesnot know the ip of the router that the camera is connected to.

Yes, That is only explanation if it has not static ip.
But concerns about high traffic usage!

so a Chinese company sells a web ip camera for 20$ for millions of customers and then they also support a server that can allow millions of users to stream simultaneously for the rest of their life without paying anything. hmm... sounds weird to me, sorry


there is a different approach. i read that there is a way to ping a MAC address. a MAC address is unique may be they just connect directly the app to the camera using the MAC address? it doesnot make any sense to support a server for a product that cost 20$.
 

ilan

Expert
Licensed User
Longtime User
it may be IP forwarding using Pin Hole approach to overcome ISP NATing, So the camera itself work as a server streams directly to client, As anydesk/teamviewer working.
this makes more sense. the camera is a server that stream directly to the app like we use our phone camera to make video calls. so no server between both. there must be a direct connection because it makes no sense to support a server for free. but my question is still relevant how can the camera know when to the app wants to get the stream if the ip of the camera is not static.

btw the app itself says that the phone and the camera needs to be connected to the same network but i am now connected to the same network i am usin my 4g connection on my phone and i cam now about 120 km far away from home but still can connect to my camera and move it around (it rotates 360 degrees) and see everything in real time i can also turn on the camera microphone through the app and talk to my wife through the app in real time. the camera has a build in microphone and a speaker and it is like talking on the phone. it is really amazing that such a camera cost about 20$

btw if you are interested this is the camera: https://www.aliexpress.com/item/1005002669547869.html?spm=a2g0o.order_list.0.0.502e1802XzskIK

i really recommend it and the app i use is this:

ANDROID: https://play.google.com/store/apps/details?id=com.yunyi.smartcamera&hl=en&gl=US
IOS: https://apps.apple.com/us/app/yi-iot/id1375812275
 

ilan

Expert
Licensed User
Longtime User
i must say it is an amazing camera and super cheap. it has many many features even Night Vision and 2 Way Audio and many more. The also awesome thing is that it arrived very fast and the packaging was very good.

so it is really interesting how they do it because we could use the same approach to our webservers we create via b4j.
 

ilan

Expert
Licensed User
Longtime User
You got it, does it fit for outdoor?
you mean if the camera can be put outdoor?
i guess yes because they show that it is also put in outdoor but i dont know if it is waterproof. anyway i use it for indoor only i want to watch my 3d printer but it can be used for many other situations.
 

josejad

Expert
Licensed User
Longtime User
I have a similar camera. Like you, I'm very happy with it, the only problem, is that the app uses it's own push notification servers, so sometimes notifications don't arrive because Android closes the app. Anyway, the app is well designed and give you clues about how avoid this (asking some permissions).

BTW, if you have an old phone, you can use the app AlfredCamera app, it's fantastic too.
 

Magma

Expert
Licensed User
Longtime User
...Those "cloud" / "p2p" cameras are fantastic ... with few $$$ you get so much tech...

I had the same questions with Ilan....

I found out that they are using a "server" (so this is the reason sometimes stop working forever) to populate their address, their unique id (seems sometimes is not), and "somekind" of port ?

But when i ask myself how this port is accessible when you have firewall/router... they are using uPnP.. (???) with p2p ??

Another thing that I ve found... is that many (all??) of these cameras using OnVif....

how is that possible... how can we do that (upnp-p2p in b4x) ?

Also found that those cameras are not so secure... our pictures, videos, travel everywhere with no certificates.. no encoding/encrypting...
 
Last edited:

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Hi to all
I have seen this discussion and I have a question. As a matter of fact I was never able to connect an Ip camera with any software, to get the video stream. With other languages, on desktops, somebody suggest to use OpenCV (and "hope" that it connects). As I said, I was not able to do it. The story is that, some years ago, i bought an ip camera. At that time I had a router in my house, therefore I had a local network, so the camera had a local Ip and everything worked, but, as i said, only with the manufacturer App. Nevertheless, I was not able to capture the video stream for my purposes. Now I don't have that router anymore and nothing works. What I read here surprises me a little. Do I understand well: is it so straightforward to connect to the camera? At the moment I don't know how, but if it is possible, I hope to find the way. Thanks in advance for any hint.
 

Magma

Expert
Licensed User
Longtime User
Hi to all
I have seen this discussion and I have a question. As a matter of fact I was never able to connect an Ip camera with any software, to get the video stream. With other languages, on desktops, somebody suggest to use OpenCV (and "hope" that it connects). As I said, I was not able to do it. The story is that, some years ago, i bought an ip camera. At that time I had a router in my house, therefore I had a local network, so the camera had a local Ip and everything worked, but, as i said, only with the manufacturer App. Nevertheless, I was not able to capture the video stream for my purposes. Now I don't have that router anymore and nothing works. What I read here surprises me a little. Do I understand well: is it so straightforward to connect to the camera? At the moment I don't know how, but if it is possible, I hope to find the way. Thanks in advance for any hint.
* We didn't "check" that... not talking about how it is possible view/capture/browse video-or-just-a-frame with b4x code...
* We ve just talk how much tech you get with few $$$
 
Top