Snapshot URL stopped working

Have some questions or having issues with your IP Camera(s), Post them here for the mods and other users to assist you with.
Post Reply
danaroode
Posts: 7
Joined: Tue Oct 08, 2019 10:17 am

Snapshot URL stopped working

Post by danaroode »

Hello,

I have an AMCREST IP8M Camera running the current firmware (2.622.00AC000 from April 2019). I found the URL to get a single snapshot on the forum and it worked:

http://user:pwd@ip:port/cgi-bin/snapshot.cgi

However, after I used it a few times it stopped working - I receive an HTTP error 500 when I try it, after a brief pause. I have rebooted the camera and power cycled it a few times. All I can figure is I changed a parameter that and an unintended consequence. However, I've only been setting up motion detection and FTP so I don't know how I broke it.

Any suggestions appreciated.

Dana
User avatar
Revo2Maxx
Site Admin
Posts: 5893
Joined: Sat Jun 15, 2019 3:05 pm

Re: Snapshot URL stopped working

Post by Revo2Maxx »

The 500 Internal Server Error is a very general HTTP status code that means something has gone wrong on the web site's server but the server could not be more specific on what the exact problem is.

Did you maybe open a port change a port or do something that may make the command you were using invalid?

Welcome to the Forum
Be Safe.
User avatar
longedge
Site Admin
Posts: 584
Joined: Fri Mar 31, 2017 9:34 am

Re: Snapshot URL stopped working

Post by longedge »

I've been troubleshooting something similar with one of my cameras myself over the past few days. I have found that the way it behaves is completely predictable and consistent so perhaps you could see if your problem is the same as mine.

If I reboot my camera, then a call to cgi-snaphot works once or twice and then it stops responding. Another re-boot brings it back to life again.

Obviously constant re-booting is not a satisfactory answer but it would be interesting to know if your camera is the same as mine in the way it behaves.

p.s. I can see that you have been re-booting the camera but I'm not clear whether that's been succesful or not.
My AMCREST Cameras:-
2 x IP3M-941B firmware V2.620.00AC00.3.R, Build Date: 2019-12-18
1 x IP2M-841B firmware V2.420.AC00.18.R, Build Date: 2019-08-03
danaroode
Posts: 7
Joined: Tue Oct 08, 2019 10:17 am

Re: Snapshot URL stopped working

Post by danaroode »

Thanks for the replies, much appreciated. Regarding Port - no changes there. In fact, the URL to get a video stream via HTTP works fairly consistently - both that one and the snapshot one use use the http port. I have also tried from both sides of the firewall, doesn't work locally or off-net.

Regarding rebooting - no, it doesn't work at all even after reboot. I both rebooted and power cycled and after the camera came back up, nothing.

The firmware is a bit flakey. There is this problem and another I have is setting motion detection settings, like the sensitivity in each zoon, saving them, exiting, verifying they were set, only to discover a few hours later they have reverted to previous values. The new values made it across my most recent reboot, perhaps they will stick now.

Dana
jack7
Posts: 904
Joined: Tue May 29, 2018 7:46 pm

Re: Snapshot URL stopped working

Post by jack7 »

Where and how are you using the snapshot URL?
What URL are you using for video stream?
What are you trying to accomplish?

I will try to provide some useful information.
Jack
danaroode
Posts: 7
Joined: Tue Oct 08, 2019 10:17 am

Re: Snapshot URL stopped working

Post by danaroode »

I enter the snapshot URL into the address bar in Chrome, also have it in bookmarks and on a web page. I have these for several different non-Amcrest cameras.

The Video Stream URL is:

http://user:password@hostname:httpport/cgi-bin/mjpg/video.cgi?channel=0&subtype=1

Works fine.

I am trying to have a snapshot link for this camera on a webpage along with similar links for other cameras. The snapshot URLs have always been helpful to access cameras easily and avoid dealing with various plug-in requirements (including Amcrest Web View).

Dana
jack7
Posts: 904
Joined: Tue May 29, 2018 7:46 pm

Re: Snapshot URL stopped working

Post by jack7 »

I don't know whether you are using Windows, Linux, etc. with Chrome. Using that snapshot URL, you could get different responses depending on OS and browser. With win10 chrome, I get a camera login prompt, then a snapshot. My android tablet chrome just shows snapshot. Amcrest cameras require digest authorization which may cause different browser responses.
In your webpage, you will probably require code similar to what's below. It's a post I saved elsewhere. I haven't used the code.
Regarding video stream, your URL is mjpg which for Amcrest cameras is normally substream VGA resolution. You said it's fine but if you ever want higher resolution up to 4K, rtsp would needed.

Code: Select all

If your PHP cURL module is enabled, you can use this PHP code.


PHP:
<?php

$fp = fopen("snapshot.jpg", "w");
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://cameraIP/cgi-bin/snapshot.cgi");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_TIMEOUT, 50);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
curl_setopt($ch, CURLOPT_USERPWD, "username:password");
curl_exec($ch);
curl_close($ch);
fclose($fp);

?>

You can run this code every 5 or 10 minutes. It will overwrite existing snapshot.jpg file.
If you have VPS or dedicated server, you can do this with cron jobs.
Some web hosting control panels like cPanel also have cron jobs function.
Umet
danaroode
Posts: 7
Joined: Tue Oct 08, 2019 10:17 am

Re: Snapshot URL stopped working

Post by danaroode »

Thanks Jack. I have tried the URL in IE, Chrome, Safari, and Netscape; on Windows, MacOS and Linux; same response each time, http error 500. It gets past authorization fine before the error. Something off in the camera, perhaps it will get fixed in future firmware.

I'm not using PHP, but thanks for the code.

Dana
User avatar
longedge
Site Admin
Posts: 584
Joined: Fri Mar 31, 2017 9:34 am

Re: Snapshot URL stopped working

Post by longedge »

A late follow-up on this subject.

I think that I have resolved the problem of my IP2M-841B not responding to calls for a cgi-snapshot.

I was tinkering with Windows (Version 1909 fully updated) settings and I switched off the firewall for private networks. The camera immediately started responding again. Next day I switched Windows Firewall on again for private networks and it still works. I don't know why but it does, I'm guessing that Windows has 'learned' that the camera is safe.

The problem only ever affected the one camera, my IP3M-941B's both always worked normally.
My AMCREST Cameras:-
2 x IP3M-941B firmware V2.620.00AC00.3.R, Build Date: 2019-12-18
1 x IP2M-841B firmware V2.420.AC00.18.R, Build Date: 2019-08-03
bro
Posts: 1
Joined: Fri Apr 24, 2020 10:44 am

Re: Snapshot URL stopped working

Post by bro »

I have a bunch of these IP3M cameras on a network at work that is behind a firewall. I can access the camera Setup remotely while connected to VPN using the webbrowser (Chrome for example). The goal is to be able to just see the snapshot image remotely (I'm building it into an internal webpage we use to monitor various things remotely).

When I try to use the link to the snapshot, the link works from within the network just fine if I use remote desktop for Windows and then open it with a web browser. If I try to open same exact link remotely from my local computer that is connected to the VPN (same method I use to control camera directly with the web-app) and I get message:

Error
Invalid Authority!

Any idea what that means or why it would be rejecting me? The IP address is a real IP, like I said, same exact one I can time directly in same browser locally and I can get to setup, but not the snapshot.
Post Reply