Important Message from Foscam Digital Technologies Regarding US Sales & Service

Foscam.US (aka Foscam Digital Technologies and now Amcrest Technologies) is an independent United States based distributor of "Foscam" branded products. We have been offering telephone support, US local warranty and building the Foscam brand in the US for the past 7 years. Based on our experiences with Foscam and feedback from end users we have launched our own new and improved line of wireless IP cameras and security systems under the Amcrest brand. Working in partnership with the second largest security camera manufacturer in the world, Amcrest was founded with a deep commitment to end-user privacy and security, highly reliable software and hardware as well a seamless and intuitive user experience. For more information, please visit www.Amcrest.com

If you are having trouble with your Foscam cameras, we sincerely apologize for this inconvenience and would love to help. For technical support, response to inquiries and for obtaining replacements for any Foscam IP Cameras or NVR products, please reach out to tech@foscam.com or call 1-844-344-1113.

If you are interested in exchanging your Foscam camera for an Amcrest camera, we can offer you a massive loyalty discount, even if you are out of warranty. Please send an email to support@amcrest.com, sales@amcrest.com or call 1-888-212-7538

If you are subscribed to Foscam Cloud (www.foscamcloud.com), please contact cloud@foscam.us for support.

If you currently use the manufacturer's cloud service (www.myfoscam.com or linked in any way to www.foscam.com), you will need to contact them directly for support, at www.myfoscam.com.


Free Generic Browser Interface For Foscam IP MJPEG Cameras

General discussion regarding Foscam IP Cameras

Re: Free Generic Browser Interface For Foscam IP MJPEG Came

Postby TheUberOverLord » Wed Aug 22, 2012 6:23 am

H2ans wrote:
TheUberOverLord wrote:Depends on your setup, wired, wireless ("9db Antenna vs. standard 3db antenna") as well as many other factors if you are in wireless mode.

In wired mode, directly connected to the router.

I was just wondering what the max fps is that you - as the creator of the script- can get with the script. So I can see that what I get is normal or that something might be wrong with my setup.


It depends on the camera model, but top end is about this, when the camera is in wired mode:

12 FPS (160*120)

6 FPS (320*240)

3 FPS (640*480)

When the camera is in wireless mode, the top end is about 30 percent less:

8 FPS (160*120)

4 FPS (320*240)

2 FPS (640*480)

The major two goals were to not impact any alarm notifications such as FTP uploads, which can/could be as high as 1 image per second and email notifications of 6 images during the 60 second alarm periods as well as being able to not impact the use of streaming and/or use of the Standard Camera Interface or any NAS/NVR software running, at the same time.

All this, while of course supporting any Internet browser capable device or computer, using any operating system and using any browser.

Don
TheUberOverLord
 
Posts: 13110
Joined: Fri Jun 22, 2012 11:52 pm

Re: Free Generic Browser Interface For Foscam IP MJPEG Came

Postby pomonabill221 » Fri Aug 24, 2012 3:56 pm

I have an 8918, using blueiris for my surveillance software.
Windows XP sp3.
cat 6 throughout. camera about 50 feet from switch and switch to computer about 6 feet ALL WIRED.
1 gig netgear switch (unmanaged though).
1 gig NIC.
AMD Athlon running at 3.6ghz (quad core) 4 gig ram.
I have been fighting my foSCAMs and tried your client htm script and found a rather interesting problem, maybe...
When I run the generic ver 1.5 alone, I get between .8 to 3.6 fps (variable).
When I run the generic AND blueiris, the displayed framerate in the generic jumps to almost a solid 5.6 fps, and blueiris indicates about 9 fps.
Why would running blueiris affect the generic's framerate display? hhmmm...
pomonabill221
 
Posts: 82
Joined: Sun Sep 18, 2011 7:45 pm

Re: Free Generic Browser Interface For Foscam IP MJPEG Came

Postby TheUberOverLord » Fri Aug 24, 2012 4:56 pm

pomonabill221 wrote:I have an 8918, using blueiris for my surveillance software.
Windows XP sp3.
cat 6 throughout. camera about 50 feet from switch and switch to computer about 6 feet ALL WIRED.
1 gig netgear switch (unmanaged though).
1 gig NIC.
AMD Athlon running at 3.6ghz (quad core) 4 gig ram.
I have been fighting my foSCAMs and tried your client htm script and found a rather interesting problem, maybe...
When I run the generic ver 1.5 alone, I get between .8 to 3.6 fps (variable).
When I run the generic AND blueiris, the displayed framerate in the generic jumps to almost a solid 5.6 fps, and blueiris indicates about 9 fps.
Why would running blueiris affect the generic's framerate display? hhmmm...


During testing, I noticed if I did not include a unique .jpg image name for each image displayed from a camera in the generic version, that I could actually pull images, sometimes hours old. Yet there were no alarms that took place during those times.

So the cameras seem to have alot of image cache available that is also being used, even during non alarm periods.

Most likely images are being cached internally in the camera when Blue Iris is running. So, because of that, you might be getting faster rates with the Generic version running at the same time, because the images are already there to grab.

Non-Compressed MJPEG, is really just a bunch of JPEG images in reality. So, just the fact that the camera is streaming MJPEG to Blue Iris, may allow it to also reference those same JPEG images as snapshots as well.

More here about that: http://foscam.us/forum/free-generic-browser-interface-for-foscam-mjpeg-ptz-cameras-t2522-10.html#p11577

What is the Blue Iris average FPS without the Generic version running? Is it faster or about the same FPS rate?

Don
TheUberOverLord
 
Posts: 13110
Joined: Fri Jun 22, 2012 11:52 pm

Re: Free Generic Browser Interface For Foscam IP MJPEG Came

Postby pomonabill221 » Sat Aug 25, 2012 3:25 am

With BI running and the generic NOT running, the frame rate, as displayed in BI, is the same.
So the camera has that large of an image cache? HHmmmm... that might explain why, after several minutes (about 20) that BI is running, both of my foSCAM 8918's and my Edimax IP-7010 have a 2-3 second delay from when I command a pan or tilt in BI, to when the image actually moves... this delay seems to change throughout the day though.
Sometimes the foSCAMs have the delay and the Edimax doesn't.
pomonabill221
 
Posts: 82
Joined: Sun Sep 18, 2011 7:45 pm

Re: Free Generic Browser Interface For Foscam IP MJPEG Came

Postby TheUberOverLord » Sat Aug 25, 2012 4:08 pm

pomonabill221 wrote:With BI running and the generic NOT running, the frame rate, as displayed in BI, is the same.
So the camera has that large of an image cache? HHmmmm... that might explain why, after several minutes (about 20) that BI is running, both of my foSCAM 8918's and my Edimax IP-7010 have a 2-3 second delay from when I command a pan or tilt in BI, to when the image actually moves... this delay seems to change throughout the day though.
Sometimes the foSCAMs have the delay and the Edimax doesn't.


Yes. From what I can tell, there is alot of image cache in the MJPEG cameras.

Don
TheUberOverLord
 
Posts: 13110
Joined: Fri Jun 22, 2012 11:52 pm

Re: Free Generic Browser Interface For Foscam IP MJPEG Came

Postby javaman » Tue Aug 28, 2012 3:06 pm

Nice code! Do you have anything that works in PHP such that it proxies the actual cam (on internal subnet) and said "get" vars (uid, pwd) to the outside world? Similar to how PHP is used to access a MySQL DB (ie, DB credentials aren't gettable from the outside web). I want it such that even at the visitor level, credentials aren't hackable.
javaman
 
Posts: 2
Joined: Tue Aug 28, 2012 3:01 pm

Re: Free Generic Browser Interface For Foscam IP MJPEG Came

Postby javaman » Tue Aug 28, 2012 5:43 pm

Nevermind, figured out my own answer. videostream.cgi needs a proper boundary and the builtin PHP functions (readfile, fopen, etc) loop without respecting this, so I used CURL

Code: Select all
<?php
header('Content-type: image/jpeg');
header('Content-type: multipart/x-mixed-replace; boundary=ipcamera');
while (@ob_end_clean());
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://10.0.2.223:8081/videostream.cgi?user=visitor&pwd=mypassword&rate=9');
curl_setopt($ch, CURLOPT_HEADER, 0);
$output = curl_exec($ch);
echo $output;
curl_close($ch);
?>
javaman
 
Posts: 2
Joined: Tue Aug 28, 2012 3:01 pm

Re: Free Generic Browser Interface For Foscam IP MJPEG Came

Postby TheUberOverLord » Thu Aug 30, 2012 10:30 am

javaman wrote:Nevermind, figured out my own answer. videostream.cgi needs a proper boundary and the builtin PHP functions (readfile, fopen, etc) loop without respecting this, so I used CURL

Code: Select all
<?php
header('Content-type: image/jpeg');
header('Content-type: multipart/x-mixed-replace; boundary=ipcamera');
while (@ob_end_clean());
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://10.0.2.223:8081/videostream.cgi?user=visitor&pwd=mypassword&rate=9');
curl_setopt($ch, CURLOPT_HEADER, 0);
$output = curl_exec($ch);
echo $output;
curl_close($ch);
?>


Thanks.

There are a few downsides of using your method vs. this interface.

Sadly, the stream interface, including videostream.cgi, requires in many cases, that additional software is installed on the device to process the stream. In some cases, for some devices, there is no ability to install anything to view the streams, or at a cost to do so.

One Example: Using IE ("Internet Explorer") on Windows systems, one does not see this stream. Using a standard Windows installation.

Using some browsers and your method, I can see the user and password for the stream, which defeats all the work in trying to hide them.

I think if you play more with this version you can see how using the configurable options, it can do what you want and need.

Of course you can have many copies of this interface, one maybe for public use and others for personal access for your cameras, allowing you to actually control your cameras as well from any internet browser capable device using any browser.

I have been told ("Not yet verified by me") that there is a max of 4 videostream.cgi streams, that can be going on at the same time. Whereas this interface has no max limit. If your goal is to support more than 4 people viewing your camera at the same time, this limit maybe a problem using your methods.

Understanding that everyone has different needs for security, this interface does allow prompt for logon as well as automatic logon and camera control features which can be enabled/disabled easily.

This does not help with the HTTP authorization vs. HTTPS, but trys to give many configurable options. You can see this by trying the Live Demos for Visitor vs. Operator user id levels, both the prompt-for-logon and automatic-logon Live Demos here:

http://foscam.us/forum/free-generic-browser-interface-for-foscam-ip-mjpeg-cameras-t2522.html

Many people don't seem to have a general idea of how many bytes per second these cameras can and do use. When a camera is publicly available, you could reach an ISP, Hosting or data plan monthly limit. Based on how many people end up viewing your camera during any given month.

This is another reason why this interface also supports the 160*120 resolution besides the standard 320*240 and 640*480 camera resolutions.

When you combine that with the inifinite-zoom feature of this interface, it allows one to quickly zoom in each time that the camera image is left-clicked and to return to the default resolution when the camera image, is double-left-clicked.

Since this zoom feature is not changing the actual camera resolution, it allows you to control the byte rate while allowing the viewer to get larger images.

Having the ability to default to a specifc FPS ("Frame Per Second") rate, and/or allowing that FPS rate to be increased ("On-the-Fly and without stop/starting the camera feed"), to some maximum limit, decided by you, could save you some grief. You can configure a fixed FPS rate, unchangable, or a default FPS rate with a maximum limit of your choice. You can do this by user level as well. Vistor vs. Operator or Admin.

Example: Even if you want to allow a maximum of 30 FPS, you could default to 5 FPS and then the viewer would need to manually increase the FPS rate to 30 FPS. This might save you some bytes.

This interface also supports a timeout feature by User Level. So, if you want to allow someone to view your camera for up to 30 minutes and then have them forced to a jump page somewhere on the internet, you can do that as well using the configuration options. In fact, the Live Demos, use this method to come back here after someone has viewed one of the demos for 5 minutes. Again, this can be set by user level.

MJPEG uncompressed streams are about virtually equal to the same FPS rates as this interface uses with .jpeg images.

A special version of this interface was created to show just how many bytes of data would be used during a 30 day period if 1 person was viewing your camera 24/7 during that 30 day period, at that resolution, using that FPS rate.

Imagine, if it were 4, 10 or more on average, during that 30 day period.

Note: You can change both the FPS rate as well as the resolution during the demo below, to see the total bytes used impact, during a 30 day period.

Here is a link to the special version of this interface that shows these statistics: http://foscam.us/forum/free-generic-browser-interface-for-foscam-mjpeg-ptz-cameras-t2522-10.html#p11577

Don
TheUberOverLord
 
Posts: 13110
Joined: Fri Jun 22, 2012 11:52 pm

Re: Free Generic Browser Interface For Foscam IP MJPEG Came

Postby H2ans » Thu Aug 30, 2012 1:24 pm

javaman wrote:Nice code! Do you have anything that works in PHP such that it proxies the actual cam (on internal subnet) and said "get" vars (uid, pwd) to the outside world? Similar to how PHP is used to access a MySQL DB (ie, DB credentials aren't gettable from the outside web). I want it such that even at the visitor level, credentials aren't hackable.

If all you need is to show your visitors an image that refreshes itself, you can perfectly mask URL, username and password using php. The Spanish Foscam site has a nice example script to accomplish this: http://foscam.es/descarga/scriptPHPwebcam.zip

I you need a videostream (instead of images) and full controls, that's a lot more tricky. I'm currently investigating this myself to see how much of the camera details I can mask using php.

I couldn't get your curl sample to work (seems to keep looping without showing the stream). But I'll look into this too, as it's an interesting path to investigate.
H2ans
 
Posts: 33
Joined: Mon Aug 13, 2012 7:53 am

Re: Free Generic Browser Interface For Foscam IP MJPEG Came

Postby TheUberOverLord » Thu Aug 30, 2012 1:42 pm

H2ans wrote:
javaman wrote:Nice code! Do you have anything that works in PHP such that it proxies the actual cam (on internal subnet) and said "get" vars (uid, pwd) to the outside world? Similar to how PHP is used to access a MySQL DB (ie, DB credentials aren't gettable from the outside web). I want it such that even at the visitor level, credentials aren't hackable.

If all you need is to show your visitors an image that refreshes itself, you can perfectly mask URL, username and password using php. The Spanish Foscam site has a nice example script to accomplish this: http://foscam.es/descarga/scriptPHPwebcam.zip

I you need a videostream (instead of images) and full controls, that's a lot more tricky. I'm currently investigating this myself to see how much of the camera details I can mask using php.

I couldn't get your curl sample to work (seems to keep looping without showing the stream). But I'll look into this too, as it's an interesting path to investigate.


Just a heads-up.

There would need to be some changes in the php code above due to image flutter. Browsers like Opera, as well as other browers for devices like some tablets and phones, will attempt to display the next image, before it is ready.

If you take a look at the HTML, for this interface, you will see how it avoids this issue now. It was a problem in earlier versions. This same logic would need to be added to the php code, to avoid this.

One Example, Before changes to this interface:

HansAPlast wrote:Hi,

your code works good with IE and Firefox, but have you tried the lastest Opera browser? In the Opera browser you get a flickering slideshow, one picture -white image box- one picture-white image box....
I think Opera refresh the hole picture and then draw the new one, this is to slow for a "video" view. I find no option in Opera to changes this refresh....

Regards from Germany

Gerd


From: http://foscam.us/forum/free-generic-browser-interface-for-foscam-ip-mjpeg-cameras-t2522-10.html#p11525

After changing this interface, this is no longer an issue with any browsers on any device.

IMHO, the easiest method to check/test this issue with the php code, would be by using a Opera browser ("If possible") and a FPS rate > than the FPS rate you intend to use. If all is well, you should not see any image flutter. If it works with Opera browers, it will also be ok with other devices that may have had an issue as well.

For those that are not their own host and are using hosting services, with a php interface like this. IMHO, I would check what your terms-of-service agreement is with that hosting service.

I mention this, because depending on how many people could use this php interface, at the same time. You could exceed limits, specified by that agreement when using a php interface, like this. It may require some monitoring, to make sure your hosting account does not get suspended.

This is another reason on why this interface avoided using a server as a proxy. You still do however, even using this interface, need to be aware of any ISP maximum bytes per month limits you may have.

I think a php interface is a great idea, as long as you are the host or can comply with your hosting service terms-of-service agreement without running any risk that your hosting account is suspended.

Don
TheUberOverLord
 
Posts: 13110
Joined: Fri Jun 22, 2012 11:52 pm

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 8 guests