Click here to Skip to main content
15,889,096 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hellos i could not get response from my ipcamera ,it build with no error but i guess the 
ip address is wrong.How can i get the correct address of my ip camera. Both the ipcamera
and PC are connected to same network named Almajilis.i get the address from my mobile 
that is connected to the same network .i am new to ipcamera i need help many thanks.


What I have tried:

using System.Web;
using System.Net;
using System.IO;
..
..
..
    private void ButStartClick(object sender, EventArgs e)
        {
            GetFrame();
        }

        private void GetFrame()
        {
            //string sourceURL = "http://192.168.0.102";
            string sourceURL = "http://192.168.0.102/jpg/image.jpg";
            //"http://192.168.0.102:4747";

            byte[] buffer = new byte[1280 * 800];
            int read, total = 0;
            HttpWebRequest req = (HttpWebRequest)WebRequest.Create(sourceURL);
            WebResponse resp = req.GetResponse();
            Stream stream = resp.GetResponseStream();
            while ((read = stream.Read(buffer, total, 1000)) != 0)
            { total += read; }
            Bitmap bmp = (Bitmap)Bitmap.FromStream(new MemoryStream(buffer, 0, total));
            pictureBox1.Image = bmp;
        }
Posted
Updated 9-Mar-18 1:06am
v5
Comments
RickZeeland 10-Mar-18 3:40am    
Did you downvote my answer ? if so I would like to know why !

If you don't know the IP address of the camera, you're going to have to find out either by reading the documentation on the camera or asking someone who does know about it.

If you didn't change any settings on the camera at all, it's probably got a default address or it picked up an address from DHCP. If the latter is the case, you'll have to consult whatever device you have dolling out IP Address for the address it assigned to the camera.
 
Share this answer
 
Comments
Maciej Los 8-Mar-18 14:05pm    
5ed!
Engineer khalid 9-Mar-18 5:57am    
hello Maciej Los ,i saw your name in my question about ipcamera with a button Reply beside it,frankly i do not know what does that mean Codeproject has updated their Site. i still need help regarding how to know the correct address about ipcamera
Maciej Los 9-Mar-18 6:51am    
Hello!
Please, carefully read Rick's answer. If your IP camera is connected to LAN, and you try to connect to it via LAN, an ip address seems to be OK (but read my notes further). But when you want to connect to camera via WAN, an ip address have to different. For example, i can access my home monitoring system via 89.161.xx.xxx address by using specific port (which is added on the end of ip address through a :xxxx)
Follow the instruction which Dave and Rick provided in their answers.
You can use a tool like Wireshark and monitor what happens when you connect the ip camera directly to a local network port.
You can also Google for the brand and model of the ip camera and see if the manufacturer has any documentation for download which mentions the default ip address.
Most ip camera's display a setup page in your browser when you enter the correct ip address.

Also most manufacturers have some kind of tool for detecting and editing the ip address.
Before you can connect to a default ip address, which often begins with 192.168, it might be handy to add that under "Advanced" ip4 network settings, see: Windows 7: Advanced Network Configuration | Pluralsight[^]
 
Share this answer
 
v3
Comments
Maciej Los 8-Mar-18 14:05pm    
5ed!
RickZeeland 8-Mar-18 14:06pm    
Muchas gracias :)
Maciej Los 8-Mar-18 14:08pm    
Por favor!
Engineer khalid 9-Mar-18 5:40am    
I appreciate the help,for the time being i have only 1 network .
1- Is it possible for the ip camera to work using 1 network (my location now has only
one network)
2- Does my program seems to work (the only error is uncorrect ip address)
3- Because i have no idea about the complete address format. Is it normal to add
/jpg/image.jpg or may be jpeg/image.jpeg to address like i did in the above program
RickZeeland 9-Mar-18 6:40am    
It should be possible to use only one network, but the ip address of the ip camera needs to be in the same range. If your network uses DHCP it's possible that the ip camera gets an ip address automatically.
The correct URL you will have to lookup in the manufacturers documentation, another good source is the ISpy database: https://www.ispyconnect.com/sources.aspx
The way you can connect an ip camera depends on many factors...

If you try to access your ip camera via LAN, an address looks promisingly. If you try to access your ip camera via WAN, an address is wrong. Please, read my comment.

I'd suggest to follow the instruction which Dave i Rick provided in their answer, especially about camera provider, model, etc...

Additionally, take a look at these samples:
Capture Live Video from various Video Devices.[^]
Camera Vision - video surveillance on C#[^]
IP-based Camera Sample[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900