A How To On How To Display Your IP Cameras In Web Sites

Any major updates coming, Upcoming Software, General Security advice for others and topics alike Post them here so other users can chat with you.
User avatar
TheUberOverLord
Posts: 32
Joined: Sun Jul 31, 2016 5:14 pm

A How To On How To Display Your IP Cameras In Web Sites

Post by TheUberOverLord »

Live example of Amcrest IP Camera using automatic refreshed snapshots and Digital Zoom. Totally secure without exposing any IP Camera information. No DDNS, ISP IP Address, Port or User Credentials are ever exposed and is compatible with all Internet capable devices using any browsers from Computers to Tablets to Phones and TV's. Without ever needing to install or download any plugins or media players:

http://107.170.59.150/Amcrest/SecureIma ... ayZoom.htm

Don
User avatar
TheUberOverLord
Posts: 32
Joined: Sun Jul 31, 2016 5:14 pm

Re: A How To On How To Display Your IP Cameras In Web Sites

Post by TheUberOverLord »

Added Example of live Amcrest IP Camera with camera controls. Including PTZ, camera zoom and digital zoom:

http://107.170.59.150/Amcrest/SecureIma ... ontrol.htm

You can also choose your own unique User Id and Password as well:

User:admin Password:admin

http://107.170.59.150/Amcrest/SecureIma ... lLogin.php

Note: You can use HTTPS as well. The test server running these live demos is using a self-signed certificate so it's normal to see a warning. Which you would not see with a proper HTTPS certificate :

https://107.170.59.150/Amcrest/SecureIm ... ontrol.htm

https://107.170.59.150/Amcrest/SecureIm ... lLogin.php

Don
Eagle85
Posts: 6
Joined: Sun Nov 08, 2015 2:25 pm

Re: A How To On How To Display Your IP Cameras In Web Sites

Post by Eagle85 »

We have 8 cameras monitoring our business and home.
Does your software allow simultaneous viewing of multiple cameras?

//////////
User avatar
TheUberOverLord
Posts: 32
Joined: Sun Jul 31, 2016 5:14 pm

Re: A How To On it To Display Your IP Cameras In Web Sites

Post by TheUberOverLord »

Yes, while the automatic image refresh demos shown below are offline. Because all the IP Cameras shown happen to be offline. They do show how easy it is to display as many different IP Cameras at the same time, as you need. One demo uses digital zoom and the other displays a specific IP Cameras images:

http://107.170.59.150/Hikvision/

http://107.170.59.150/Hikvision/AllHikv ... thZoom.htm

Note: The demos above are using automatic recovery so that when any IP Camera is offline that their last image received will be displayed vs. showing a blank image. When a IP Camera comes back online then the demo will display the IP Cameras real-time images, automatically as well.

Don
pierreforget
Posts: 10
Joined: Thu Aug 25, 2016 10:05 am

Re: A How To On How To Display Your IP Cameras In Web Sites

Post by pierreforget »

Hi,

Thank you for your good coding and best wishes to overcome the lung cancer. Yes, it can be done with good mind programming.
You programmed yourself a cancer, so you can do the reverse.

I tried your method for Amcrest, but I can't seem to get it with IP2m-842W.

I get:

Your web server supports using php GD methods.
Your web server allows the IP Cameras port to be opened using php Curl methods.

If I comment the line, I get:

Error - Please check URL

In the code:

$ipcam_url = "http://www.ste-agathe.com/cam-1.jpg";

Which is valid.

I have my own web servers.

Thank you in advance.

Pierre Forget
pierreforget
Posts: 10
Joined: Thu Aug 25, 2016 10:05 am

Re: A How To On How To Display Your IP Cameras In Web Sites

Post by pierreforget »

Just one more thing. If I put in Chrome:

http://user:[email protected]:8086 ... apshot.cgi

I get the image from the camera.

Which you can see here:

http://www.ste-agathe.com/images/amcrest-image-test.jpg

Thanks,

Pierre Forget
User avatar
TheUberOverLord
Posts: 32
Joined: Sun Jul 31, 2016 5:14 pm

Re: A How To On How To Display Your IP Cameras In Web Sites

Post by TheUberOverLord »

Thanks.

I can assure you that it's "Outbound" ports from the servers perspective and not "Inbound" ports.

Additionally, IPTABLES was/is also not in play with your issue for normal Linux distribution installs. So this issue was caused by a file security write/read issue alone. Had you read the ___ReadThisFirst.txt file carefully. You would have seen the instruction to secure ipcam1.jpg for write/read file access which would have resolved your problem. By itself.

For Amcrest IP Cameras the URL should not be:

Code: Select all

$ipcam_url = "http://www.ste-agathe.com/cam-1.jpg";
But should be this:

Code: Select all

$ipcam_url = "http://User:Password@DDNSorISPIPAddress:PortForCamera/cgi-bin/snapshot.cgi";
Don
pierreforget
Posts: 10
Joined: Thu Aug 25, 2016 10:05 am

Re: A How To On How To Display Your IP Cameras In Web Sites

Post by pierreforget »

Thanks for the fast response.

Sorry, I see my mistake. I had the $ipcam_url at 2 spots in the code.

Now I have:
Your web server supports using php GD methods.
Your web server does NOT allow the IP Cameras port to be opened using php Curl methods.

I understand I have to get the outbound port for Curl. It's not clear to me.

The firewall (iptables) is fully opened on outbound:

iptables -P OUTPUT ACCEPT

All the other rules are INPUT rules.

As for Curl, here is the result of phpinfo:

curl

cURL support enabled
cURL Information 7.27.0
Age 3
Features
AsynchDNS No
Debug No
GSS-Negotiate No
IDN Yes
IPv6 Yes
Largefile Yes
NTLM Yes
SPNEGO No
SSL Yes
SSPI No
krb4 No
libz Yes
CharConv No
Protocols dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtsp, smtp, smtps, telnet, tftp
Host i686-pc-linux-gnu
SSL Version OpenSSL/1.0.1c
ZLib Version 1.2.7

Do I need to recompile something in PHP?

PHP 5.4.11

As I am the hosting service, it should be easier.

Thanks again
User avatar
TheUberOverLord
Posts: 32
Joined: Sun Jul 31, 2016 5:14 pm

Re: A How To On How To Display Your IP Cameras In Web Sites

Post by TheUberOverLord »

You are very welcome.

Please try using this URL for a test which is using port 80, which should by default be open in your php environment:

Code: Select all

$ipcam_url = "http://extcam-22.se.axis.com/jpg/1/image.jpg";
What does check for ports show? That all is well?

Your php.ini may only have port 80 and 443 as allowed outbound ports. I don't know your setup but would be worthwhile to check.

Don
pierreforget
Posts: 10
Joined: Thu Aug 25, 2016 10:05 am

Re: A How To On How To Display Your IP Cameras In Web Sites

Post by pierreforget »

Hi Don,

Finally found the issue. As a sysop, I tend to always think server side. It is "outbound port" for the camera side, but "inbound port" for the server!

So, I added these lines to iptables:

iptables -I INPUT -p tcp -s 24.122.xx.xxx --sport 1024:65535 -d 205.237.69.240/28 --dport 8086 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -I INPUT -p tcp -s 24.122.xx.xxx --sport 8086 -d 205.237.69.240/28 --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT

And problem is fixed.

I also needed to:

chmod 666 ipcam1.jpg

so that the jpg is saved on the disk.

As for your health problem, look at this scanned document (jpg in zip format), it may help you or at least view from a different perspective:
http://www.st-donat.com/temp4/cancer-anglais-img.zip

If you ever need details:

http://www.st-donat.com/pierremaina.html

Thanks for all!
Last edited by pierreforget on Sun Oct 30, 2016 8:52 am, edited 1 time in total.
Post Reply