• 1
  • 24
  • 25
  • 26(current)
  • 27
  • 28
  • 31
Release Surveillance Room - Your IP Camera Companion with extra Foscam HD Support
Im using Blue Iris with this add-on right now i just set it up today. Only issue ive had was a wonky issue where i cant get my camera 1 to work in PiP but works fine elsewhere.

In blue iris go to settings>web server. At the bottom make sure the dropdown box for Authentication  has "Non-LAN only" and make sure "secure only" is unchecked.

In kodi make sure you select

source-player mjpeg
source-preview snapshot

for the URLS mine are just written in like so

Snapshot URL- http://192.168.0.10:8087/image/Cam1
MJPEG URL - http://192.168.0.10:8087/mjpg/Cam1

This should get the streams and snapshots working for you but like i said i have a weird issue where it will not play cam1 in PiP but plays the others just fine. Then when i go into the 4 way grid  of my cameras only cam1 will work while the others dont. Maybe someone else could help me with this part? I have previews checked for each camera so im not sure what could be the problem.
Reply
Amcrest owners, I wish that I knew python, because I'd be able to contribute a proper, non-generic camera type for amcrest cams to this project.  But sadly, I can only script the hell out of bash, not python.  But perhaps someone who can script python (or maybe even Maikito26 if we ask nicely enough) can take this information and run with it, because as part of rolling my own alexa integration for my amcrest cams, I've found some useful things. 

In recent firmwares, Amcrest's API only responds to HTTP Digest auth.  For example, the command
curl "http://<username>:<password>@<camera ip>:80/cgi-bin/snapshot.cgi?1 

used to return just fine.  Now, you'd have to do 'curl --digest' in order to gain access.  Previous api specifications allowed encoding username and password as &usr=<user>&pwd=<password>, but now you can only pass them as a URL prefix:  http://<username>:<password>@<camera ip>

The correct URLs for returning a snap, rtsp, or mjpg are definitely the below, but without class urllib.request.HTTPDigestAuthHandler() extending urllib in the python scripts, only RTSP can be accessed properly in this addon - that's why people are seeing black screens for previews/multicams.

Snapshot:           http://<USER>:<PASSWORD>@<CAMERA_IP>/cgi-bin/snapshot.cgi?1
Video Stream :     rtsp://<USER>:<PASSWORD>@<CAMERA_IP>:554/cam/realmonitor?channel=1&subtype=0
MJPEG:               http://<USER>:<PASSWORD>@<CAMERA_IP>/cgi-bin/mjpg/video.cgi?channel=1&subtype=1

To get motion alarms working, the api calls to show the status of the alarm (is it currently triggered or not) is 
http://<USER>:<PASSWORD>@<CAMERA_IP>/cgi-bin/alarm.cgi?action=getOutSlots

Foscam returns XML to API calls, whereas Amcrest just returns a string - in the case of the alarm state above, that would be 
result=0    or   result=1

where 0 means not in alarm state, and 1 means alarm has been triggered.  So while the python script for the foscam HD cameras uses 'xml.etree.ElementTree' to parse the API response, getting the status code for the Amcrests would have to use something like raw_string.split("=", 2)   (but again, I don't really python, I can just read it and mildly edit some, so that's probably not the best way to do it.)

Maikito26's implementation for the Foscam API is incredibly full featured, with the ability to fetch and set nearly every setting and state the foscam cameras have.  But if someone did say a file /resources/lib/ipcam_api_amcrest.py  that implemented the http digest tweak for urllib in order to properly fetch MPJG steams and snapshots, and just the get alarm state api call, then we'd have most of the core awesomeness of the surveillance rooms addon available for Amcrest cams, without having to implement the whole range of API commands.
Reply
(2018-04-07, 22:25)thestig Wrote: In recent firmwares, Amcrest's API only responds to HTTP Digest auth.  For example, the command
curl "http://<username>:<password>@<camera ip>:80/cgi-bin/snapshot.cgi?1 
used to return just fine.  Now, you'd have to do 'curl --digest' in order to gain access. 
Huh that's weird... are you totally sure it *requires* digest auth??
According to the latest (rev 2.12) cgi API, it still accepts Basic.
https://support.amcrest.com/hc/en-us/art...TP-API-SDK
Quote:3.5 Authentication
Video products support either basic authentication or digest authentication. If the http request does not provide valid
“Authorization” information, video products would return HTTP status code 401 and information for authentication. Video
products return the required resource only if authorization correct. 

It seems like it only uses Digest as a failover after Basic doesn't work?
I'm definitely no expect on any of this at all, so I just thought I'd throw that in. 
But also noteworthy in that pdf, the URL for snapshot seems to require more(/less) parameter info than you suggested -- check out section 4.4.2.

Just out of curiosity, what headers does...
curl -I "http://USERNAME:PASSWORD@IP/cgi-bin/snapshot.cgi"
...or...
curl -I "http://USERNAME:PASSWORD@IP/cgi-bin/snapshot.cgi?channel=1"
return?
(as sort of suggested in this https://zindilis.com/blog/2012/08/15/log...ython.html)
Reply
You're not wrong about what it says, but yes I'm quite sure.  I couldn't get curls working for the life of me - tried .netrc's, explicit --user args, etc.  Only --digest worked.  *BUT* I neglected to say that of the three amcrests I had (2 domes 1 bullet) the bullet worked fine with basic auth.  I believe it's probably down to firmware - I was on the latest for each, but I'm guessing that going forward it's digest only.  Both firmwares are newer than the API documentation.  And yes, that command definitely gets me a snapshot, I just checked again.  The ?1 on the end of the snap command I believe works as shorthand for &channel=1

That's the python page I landed on as well for implementing digest (we should hang out).  While it seemed straightforward enough for me to re-implement if it was a small monolithic script, the size and interconnectedness of this plugin scared me off.  Too tempting to just swap my $50 amcrest for a $50 foscam and go back to building my better life one bash script at a time.  Though i did consider cheating and dropping to an os.system() in python and just curling the dang things like I know how to do.
Reply
Oh, and the curl output - running with -I made it return "empty response" no matter if I fed it basic or digest creds, or what endpoint I hit.  But -vv gave what I think you wanted to see (using netrc to provide user/pass, and below I obscured sensitive info with italics):
Quote:curl -vv  -n   "http://CAMERA/cgi-bin/alarm.cgi?action=getOutSlots"
*   Trying CAMERAIP...
* TCP_NODELAY set
* Connected to CAMERA (CAMERAIP) port 80 (#0)
* Server auth using Basic with user 'MYUSER'
> GET /cgi-bin/alarm.cgi?action=getOutSlots HTTP/1.1
> Host: CAMERA
> Authorization: Basic YWRtaW46bGlidGFyZGk1
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
< WWW-Authenticate: Digest realm="Login to FACTORYHOSTNAME",qop="auth",nonce="1484076709",opaque="8b4b92bf58d158222eca1dbf57140fe6c0b92f06"
< Connection: close
< CONTENT-LENGTH: 0
<
* Closing connection 0

If I append --digest to the arguments everything works.
Reply
(2018-04-09, 23:27)thestig Wrote: I believe it's probably down to firmware - I was on the latest for each, but I'm guessing that going forward it's digest only.  Both firmwares are newer than the API documentation.  
...
That's the python page I landed on as well for implementing digest (we should hang out).  While it seemed straightforward enough for me to re-implement if it was a small monolithic script, the size and interconnectedness of this plugin scared me off.  Too tempting to just swap my $50 amcrest for a $50 foscam and go back to building my better life one bash script at a time.  Though i did consider cheating and dropping to an os.system() in python and just curling the dang things like I know how to do.
haha, drop me a line if you're ever around flagstaff or denver Smile
but yeah I would put my money on the firmware being the culprit. it was certainly a thought when I saw the date of that api revision.

I want you to get this to work as badly as you do, probably. Ever since Foscam's cino-american civil war, I've been planning on moving to Amcrest for my next purchases, but fortunately (or not) these things just refuse to die.  In your position, I would have already folded and cheated with system calls! Props to staying strong.  One thought I had, and I have no idea if it'd work, would be replacing/augmenting urllib with other packages/calls... I'm smelling that both of us are Python hacks at best, but it probably wouldn't be too time-consuming to do some guess-and-check one-off edits to the existing code.

And of course, failing that, maikito mentioned something in his github that when kodi v18 rolls around, he was hoping to remaster the addon... maybe neither of us could get the whole shebang working but maybe if we had some working code/CLI examples, it'd make those additions quick-n-easy for him?
  
(2018-04-09, 23:37)thestig Wrote: Oh, and the curl output - running with -I made it return "empty response" no matter if I fed it basic or digest creds, or what endpoint I hit.  But -vv gave what I think you wanted to see (using netrc to provide user/pass, and below I obscured sensitive info with italics):
Quote:curl -vv  -n   "http://CAMERA/cgi-bin/alarm.cgi?action=getOutSlots"
*   Trying CAMERAIP...
* TCP_NODELAY set
* Connected to CAMERA (CAMERAIP) port 80 (#0)
* Server auth using Basic with user 'MYUSER'
> GET /cgi-bin/alarm.cgi?action=getOutSlots HTTP/1.1
> Host: CAMERA
> Authorization: Basic YWRtaW46bGlidGFyZGk1
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
< WWW-Authenticate: Digest realm="Login to FACTORYHOSTNAME",qop="auth",nonce="1484076709",opaque="8b4b92bf58d158222eca1dbf57140fe6c0b92f06"
< Connection: close
< CONTENT-LENGTH: 0
<
* Closing connection 0

If I append --digest to the arguments everything works.  
 
You, sir, just activated a braincell of mine. 'No response at all' struck me as a security measure.  
Which makes sense, given that Basic auth is sent as (reversibly-base64-encoded) plaintext, and therefore you're not supposed to use it over http.
Although the fact upping verbosity yields the information anyway is kinda odd... I'm still curious:
Can you try any of those CGI strings over https, instead??
Might as well see if the headers are any different, as well?
Reply
Hello, my first post here. I am having a HIKVision Turbo HD 4 camera DVR installed on Friday (cameras are connected via coax to the DVR which is connected to ethernet on the web) and have been researching ways to integrate this into Kodi running on windows 10. The app I would use on my phone for remote access and viewing is called iVMS-4500.

https://us.hikvision.com/en/products/vid...204hghi-sh

I have read through the entire 26 pages but I am still at a loss as it seems to mention IP cameras on here. My DVR will have an IP of sort and I know that you can also connect via P2P to review the cameras in a web browser away from the phone or tablet apps.

Ideally if Surveillance Room could support my DVR and if anyone can tell me how I can set it up?

Many thanks in advance for your help.

Best Regards
Richard.
Reply
(2018-04-10, 18:27)jasonbuechler Wrote:
(2018-04-09, 23:27)thestig Wrote: I believe it's probably down to firmware - I was on the latest for each, but I'm guessing that going forward it's digest only.  Both firmwares are newer than the API documentation.  
...
That's the python page I landed on as well for implementing digest (we should hang out).  While it seemed straightforward enough for me to re-implement if it was a small monolithic script, the size and interconnectedness of this plugin scared me off.  Too tempting to just swap my $50 amcrest for a $50 foscam and go back to building my better life one bash script at a time.  Though i did consider cheating and dropping to an os.system() in python and just curling the dang things like I know how to do.
haha, drop me a line if you're ever around flagstaff or denver Smile
but yeah I would put my money on the firmware being the culprit. it was certainly a thought when I saw the date of that api revision.

I want you to get this to work as badly as you do, probably. Ever since Foscam's cino-american civil war, I've been planning on moving to Amcrest for my next purchases, but fortunately (or not) these things just refuse to die.  In your position, I would have already folded and cheated with system calls! Props to staying strong.  One thought I had, and I have no idea if it'd work, would be replacing/augmenting urllib with other packages/calls... I'm smelling that both of us are Python hacks at best, but it probably wouldn't be too time-consuming to do some guess-and-check one-off edits to the existing code.

And of course, failing that, maikito mentioned something in his github that when kodi v18 rolls around, he was hoping to remaster the addon... maybe neither of us could get the whole shebang working but maybe if we had some working code/CLI examples, it'd make those additions quick-n-easy for him?
  
(2018-04-09, 23:37)thestig Wrote: Oh, and the curl output - running with -I made it return "empty response" no matter if I fed it basic or digest creds, or what endpoint I hit.  But -vv gave what I think you wanted to see (using netrc to provide user/pass, and below I obscured sensitive info with italics):
Quote:curl -vv  -n   "http://CAMERA/cgi-bin/alarm.cgi?action=getOutSlots"
*   Trying CAMERAIP...
* TCP_NODELAY set
* Connected to CAMERA (CAMERAIP) port 80 (#0)
* Server auth using Basic with user 'MYUSER'
> GET /cgi-bin/alarm.cgi?action=getOutSlots HTTP/1.1
> Host: CAMERA
> Authorization: Basic YWRtaW46bGlidGFyZGk1
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
< WWW-Authenticate: Digest realm="Login to FACTORYHOSTNAME",qop="auth",nonce="1484076709",opaque="8b4b92bf58d158222eca1dbf57140fe6c0b92f06"
< Connection: close
< CONTENT-LENGTH: 0
<
* Closing connection 0

If I append --digest to the arguments everything works.   
 
You, sir, just activated a braincell of mine. 'No response at all' struck me as a security measure.  
Which makes sense, given that Basic auth is sent as (reversibly-base64-encoded) plaintext, and therefore you're not supposed to use it over http.
Although the fact upping verbosity yields the information anyway is kinda odd... I'm still curious:
Can you try any of those CGI strings over https, instead??
Might as well see if the headers are any different, as well? 
 Tried the https source and get indication of both basic and digest auth
Quote:* ALPN, server did not agree to a protocol
* Server auth using Basic with user 'admin'
> GET /cgi-bin/alarm.cgi?action=getOutSlots HTTP/1.1
> Host: CAMERA
> Authorization: Basic YWRtaW46bGlidGFyZGk1
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
< WWW-Authenticate: Digest realm="Login to CAMERA",qop="auth",nonce="169406689",opaque="932d81617986dac88750828ad8a5a582e01f44fd"
Reply
I am having one heck of a time getting my foscam R4 to work with your app, Any advice one how I should have the settings for these Cameras?
Reply
According to this link
snapshot = http://address:port/cgi-bin/CGIProxy.fcgi?usr=user_name&pwd=password&cmd=snapPicture2
and video =  rtsp://username:pwd@IP:port/videoMain
...which appear to be standard to the foscam cgi api, and are also used in the C1 which I own.  You should be able to set it up just like I set up mine... see my post #372: https://forum.kodi.tv/showthread.php?tid...pid2717599
Reply
You my sir are a god send I don't know what I had diff thought I had what you have but it works now, Thanks again!!!! Cool
Reply
Spoke to soon, video works in all camera but black screen when I load just the one camera thats enabled

Nevermind, made a resolution change from 4K to 1080P and it started working
Reply
Hello everyone....

I found this add-on earlier and have been attempting to configure without success.  I have a foscam FI9900PR and for the life of me I can't get the config correct.

The following plays in VLC.

rtsp://Administrator:[email protected]:88/videoMain

Any help getting the correct settings for the app would be appreciated.

Johnny
Reply
(2018-04-27, 03:28)johnny_swindle Wrote: I have a foscam FI9900PR and for the life of me I can't get the config correct.
The following plays in VLC.
rtsp://Administrator:[email protected]:88/videoMain
Any help getting the correct settings for the app would be appreciated.
Johnny

Johnny - check out my lengthy instructions on page 25 of this thread. Your model should accept a setup identical to mine.
 
(2018-04-12, 00:42)thestig Wrote:
(2018-04-10, 18:27)jasonbuechler Wrote: You, sir, just activated a braincell of mine. 'No response at all' struck me as a security measure.  
Which makes sense, given that Basic auth is sent as (reversibly-base64-encoded) plaintext, and therefore you're not supposed to use it over http.
Although the fact upping verbosity yields the information anyway is kinda odd... I'm still curious:
Can you try any of those CGI strings over https, instead??
Might as well see if the headers are any different, as well?   
 Tried the https source and get indication of both basic and digest auth
Quote:* ALPN, server did not agree to a protocol
* Server auth using Basic with user 'admin'
> GET /cgi-bin/alarm.cgi?action=getOutSlots HTTP/1.1
> Host: CAMERA
> Authorization: Basic YWRtaW46bGlidGFyZGk1
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
< WWW-Authenticate: Digest realm="Login to CAMERA",qop="auth",nonce="169406689",opaque="932d81617986dac88750828ad8a5a582e01f44fd"
 
hey @thestig have you had any more luck with that? 
I was really really hoping https would be our panacea -- that readout crushed my hopes of understanding. :/
I have a couple friends who're trying to get into ipcams and I want to recommend Amcrest to them over foscam but ... you know.
Have you tried to get in contact with their tech/dev team?  Confusingly, Foscam itself used to be pretty good about actually channeling technical questions to people who could answer... I gotta assume Amcrest might be at least that goodHuh
Reply
@jasonbuechler

I used your post a as a guide, but I could not get the config to work.  It is possible that I made an error setting things up, so I will give it another try.

Thanks....
Reply
  • 1
  • 24
  • 25
  • 26(current)
  • 27
  • 28
  • 31

Logout Mark Read Team Forum Stats Members Help
Surveillance Room - Your IP Camera Companion with extra Foscam HD Support7