• 1
  • 25
  • 26
  • 27(current)
  • 28
  • 29
  • 31
Release Surveillance Room - Your IP Camera Companion with extra Foscam HD Support
(2018-05-03, 20:50)johnny_swindle Wrote: 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....
  
Hey Johnny -- my mistake, potentially.
Upon closer inspection I noticed that your camera's manual mentions it can take a default port of 88, OR a configured port of your choosing. You verified port 88 works fine via VLC... so if you followed my instructions to the letter, and used :554 instead of :88 in your setup, then yeah it won't work. Sorry! Unrelated aside... the manual for that camera is just riddled with errors and vaguely threatening english, lol:

Image

Let's lay out this plan:
  1. follow my instructions on page 25, but use 88 instead of 554
  2. if that doesn't immediately work, please take some pics/screenshots and share them here (or via imgur link)
  3. after the above, does the "snapshot" preview appear when you mouseover/select (but not click) the name of your camera in the addon's list of cameras?
  4. assuming video still doesn't work, can you upload your kodi.log to pastebin and link me to it here?
  5. kind of unrelated, but so we're working on the same page... I actually have been using a modified version of maikito's addon that correctly allows me to use my cameras via the 'override' camera type (thanks to RaysceneNS's github fork)... it's worth trying that. Here's a link to the zip: https://github.com/jasonbuechler/k/blob/...1.2.3c.zip ... if you aren't sure how to get it from there, like if you're on locked-down android box, you can create a file source in kodi to this address then install-from-zip from that filesource
Reply
This post is to summarize some stuff you can find earlier in this thread, and present fixes for common problems that newcomers to this thread might stumble onto/over.

Firstly... the C1/"Foscam HD Override" bug...
I'm not sure if the .zip file for v1.2.3 that is on Maikito26's repo is exactly the same version as the source code in his github, but either way, I think both have a bug that breaks the "Foscam HD Override" camera type. Or I'm not configuring my cameras correctly. Either way, there's some fixes.

Credit to Maikito26, ogremalfeitor, and RaysceneNS who all left a trail of breadcrumbs behind for me to look through. I'll summarize their edits here...
(2016-04-28, 14:01)maikito26 Wrote: @ogremalfeitor It's an error in my code Sad Sorry!

Update file: [kodi settings folder]/addons/plugin.video.surveillanceroom/resources/lib/ipcam_api_foscamhd.py
Update lines: around 807-835 from 'class FoscamCameraOverride(FoscamCamera)'
  • From: super(FoscamCamera, self).init(camera_settings, daemon = False, verbose = True)
  • ___To: super(FoscamCameraOverride, self).init(camera_settings, daemon = False, verbose = True)
.
  • From: _mjpegUrl = "http://{0}/cgi-bin/CGIStream.cgi?cmd={GetMJStream}&usr={1}&pwd={2}&".format(self.url, self.usr, self.pwd)
  • ___To: _mjpegUrl = "http://{0}/cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr={1}&pwd={2}&".format(self.usr, self.pwd)
.
  • From: _snapshotUrl = "http://{0}/cgi-bin/CGIProxy.fcgi?cmd={snapPicture2}&usr={1}&pwd={2}&".format(self.url, self.usr, self.pwd)
  • ___To: _snapshotUrl = "http://{0}/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr={1}&pwd={2}&".format(self.usr, self.pwd)

This is because I didn't properly test it after making the API Wrapper changes. Hope that fixes it!         
  
Those fixes didn't work or weren't sufficient for ogremalfeitor, who fixed some of those fixes and added another fix for the rtsp stream since the port defaults to the rtsp-default of 554 for C1's, instead of 88 which was used on earlier cameras...
 
(2016-04-29, 23:57)ogremalfeitor Wrote: I changed the lines you mentioned, but had to be to:
 
  • From: _mjpegUrl = "http://{0}/cgi-bin/CGIStream.cgi?cmd={GetMJStream}&usr={1}&pwd={2}&".format(self.url, self.usr, self.pwd)
  • ___To: _mjpegUrl = "http://{0}/cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr={1}&pwd={2}&".format(self.url, self.usr, self.pwd)
.
  • From: _snapshotUrl = "http://{0}/cgi-bin/CGIProxy.fcgi?cmd={snapPicture2}&usr={1}&pwd={2}&".format(self.url, self.usr, self.pwd)
  • ___To: _snapshotUrl = "http://{0}/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr={1}&pwd={2}&".format(self.url, self.usr, self.pwd)
.
  • From: _videoUrl = "rtsp://{0}:{1}@{2}/videoMain".format(self.usr, self.pwd, self.url)
  • ___To: _videoUrl = "rtsp://{0}:{1}@{2}/videoMain".format(self.usr, self.pwd, self.host)
 

This was a nice elegant fix that I assume worked based on the RTSP protocol defaulting to 554 unless otherwise overridden by swapping the combined host+IP "url" variable with just the host variable.
  
But there's a specific thing here where I'm super super confused: Since ogremalfeitor didn't mention the super(FoscamCamera, self)... line, it kinda sounds like it worked for him?? Or maybe he just easily saw a fix, applied it, and forgot to mention it. Either way, that needed further TLC, which was provided in a fork on github by RaysceneNS: https://github.com/maikito26/plugin.vide...187716d0cc
His edits were...
 
github user RaysceneNS Wrote:Fix for __init__ FoscamCameraOverride class:
- Change video_url to use port 554 for RTSP stream in this model.
- Fix for cmd attributes of snapshot_url and mjpeg_url.
  • From: super(FoscamCamera, self).init(camera_settings, daemon = False, verbose = True)
  • ___To: FoscamCamera.__init__(self, camera_settings, daemon, verbose)
.
  • From: _mjpegUrl = "http://{0}/cgi-bin/CGIStream.cgi?cmd={GetMJStream}&usr={1}&pwd={2}&".format(self.url, self.usr, self.pwd)
  • ___To: _mjpegUrl = "http://{0}/cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr={1}&pwd={2}&".format(self.url, self.usr, self.pwd)
.
  • From: _snapshotUrl = "http://{0}/cgi-bin/CGIProxy.fcgi?cmd={snapPicture2}&usr={1}&pwd={2}&".format(self.url, self.usr, self.pwd)
  • ___To: _snapshotUrl = "http://{0}/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr={1}&pwd={2}&".format(self.url, self.usr, self.pwd)
.
  • From: _videoUrl = "rtsp://{0}:{1}@{2}/videoMain".format(self.usr, self.pwd, self.url)
  • ___To: _videoUrl = "rtsp://{0}:{1}@{2}:554/videoMain".format(self.usr, self.pwd, self.host)
 

However, I asked RaysceneNS about exactly why that fix worked, and he wasn't exactly sure either.

Also, there's nothing wrong with specifying the :554 in there, but I *think* that was unnecessary...?

Anyway, I ultimately tried my hand at some edits and along the way found a different fix for the error-generating super(FoscamCamera, self)... line. I don't know if mine is any better than RaysceneNS's, but it's closer to SR's author's original suggestion, so I'm going to personally roll with it. Another thing I did was make the rtsp port dynamic instead of hardcoded, fed into the code live like the other port, via the addon's settings. Doing that requires several other edits so I'll put that in the next section of this post, and leave a slightly modified version of RaysceneNS's edits which represents my final edits to date (except without my dynamic rtsp, which we'll get to).

For anyone wanting to just quick-edit their own C1-type fix, do these at the bottom of the file mentioned above:
 
  • From: super(FoscamCamera, self).init(camera_settings, daemon = False, verbose = True)
  • ___To: super(FoscamCamera, self).__init__(camera_settings, daemon = False, verbose = True)
.
  • From: _mjpegUrl = "http://{0}/cgi-bin/CGIStream.cgi?cmd={GetMJStream}&usr={1}&pwd={2}&".format(self.url, self.usr, self.pwd)
  • ___To: _mjpegUrl = "http://{0}/cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr={1}&pwd={2}&".format(self.url, self.usr, self.pwd)
.
  • From: _snapshotUrl = "http://{0}/cgi-bin/CGIProxy.fcgi?cmd={snapPicture2}&usr={1}&pwd={2}&".format(self.url, self.usr, self.pwd)
  • ___To: _snapshotUrl = "http://{0}/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr={1}&pwd={2}&".format(self.url, self.usr, self.pwd)
.
  • From: _videoUrl = "rtsp://{0}:{1}@{2}/videoMain".format(self.usr, self.pwd, self.url)
  • ___To: _videoUrl = "rtsp://{0}:{1}@{2}:554/videoMain".format(self.usr, self.pwd, self.host)

Secondly... dynamic RTSP port...
If you forward your RTSP port through a firewall, or your IPCam uses a nonstandard port, you might want to dynamically adjust it. If you were going to code it yourself, that last line would look like:
_videoUrl = "rtsp://{0}:{1}@{2}:{3}/videoMain".format(self.usr, self.pwd, self.host, self.rtsp)
But you'll also need these other edits:
  • requires a new getCameraSettings rtsp= assignment block-of-code in ipcam_api_wrapper
  • and appending 'rtsp' to the return array
  • and a new RTSP port entry in each cam# settings page
  • and re-"targetting" the relative comparators (e.g. enable=eq(-5,3) etc) if that setting is listed above the 'alarm#' enum setting

Thirdly... try out my fork if you want...
This is the version that includes the dynamic RTSP and the "double-underscore" fix...
  1. directly download the zip to your kodi box, and install-from-zip: https://github.com/jasonbuechler/k/blob/...1.2.3d.zip
  2. OR... add an http filesource (and install-from-zip) using this url: https://rawgit.com/jasonbuechler/k/master/sr/
...and some before/after screenshots showing the difference...

Image
Image
Reply
I am using a Foscam R4 with Kodi 7.3 and can't view the PTZ buttons. They work if you know where to click on the screen but I cant seem to see the buttons.

However my real goal is to map the PTZ controls to the keyboard. Has anybody had luck configuring that?
Reply
Thanks for the information. Will it work with 4k professional camera? But Very cool and nice Add-on.
Reply
Hello everyone!
    This addon is fantastic !!! Congratulations. It works great for my ubiquiti UVC camera

Now I have a doubt. When I call the preview through this code. It exits the movie screen and goes to the addon screen and displays the preview. It would be much better if only the preview is shown. How can I improve?

curl -i -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"Addons.ExecuteAddon","params":{"wait":false,"addonid":"plugin.video.surveillanceroom","params":{"action":"show_preview","camera_number":"1","id":"1"}},"id":2}' http://192.168.1.163:8080/jsonrpc
Reply
Guys, any prediction to show all 6 cameras? or 05?
Reply
(2018-07-30, 05:00)iorifly Wrote: Hello everyone!
    This addon is fantastic !!! Congratulations. It works great for my ubiquiti UVC camera

Now I have a doubt. When I call the preview through this code. It exits the movie screen and goes to the addon screen and displays the preview. It would be much better if only the preview is shown. How can I improve?

curl -i -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"Addons.ExecuteAddon","params":{"wait":false,"addonid":"plugin.video.surveillanceroom","params":{"action":"show_preview","camera_number":"1","id":"1"}},"id":2}' http://192.168.1.163:8080/jsonrpc

One possible solution. I'll test.

http://192.168.1.163:8080/jsonrpc?request={"jsonrpc": "2.0", "method": "GUI.SetFullscreen", "params": { "fullscreen": "toggle" }, "id": "1"}
Reply
I use a box with android, using remote control. It is possible to map the keys red, yellow .....
    I tried, but it does not seem to work ... Has anyone here got this setup? I'm using android.
Reply
I'm not quite sure what I am missing here. I have everything set up, The preview snapshots are working fine, I can see the previews in the "All Cameras" section, and can watch each of my cameras individually just fine.  However, when there is motion, the preview is not sliding onto the screen like I understand it should.  Is there something else I need to enable?  I have both Camera 1 and Camera 2 enabled.  I don't see anywhere to adjust the motion area or motion sensitivity in the addon.  Any help would be appreciated.
Reply
Awesome plugin!

I have 5 connected cameras and 5 Kodi devices.  Settings up all this 5 times x5 cameras using just a remote control is a near impossible task as I have damaged fingers. Is there a way to clone the plugin's configuration from one Kodi to another?

Straight backup/restore of Kodi won't work because although the Kodi instances are identically configured, the hardware is different (PC, Vero 4k, Shield TV).

I can't locate any configuration files which seem safe to edit.

many thanks
Reply
Wink 
Thanks for the wonderful addon.

I wanted to know if PTZ control is possible for generic IP Cameras. I seem to be getting the camera feed but the option to move the camera is not there.
Reply
(2018-07-30, 05:00)iorifly Wrote: Hello everyone!
    This addon is fantastic !!! Congratulations. It works great for my ubiquiti UVC camera

Now I have a doubt. When I call the preview through this code. It exits the movie screen and goes to the addon screen and displays the preview. It would be much better if only the preview is shown. How can I improve?

curl -i -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"Addons.ExecuteAddon","params":{"wait":false,"addonid":"plugin.video.surveillanceroom","params":{"action":"show_preview","camera_number":"1","id":"1"}},"id":2}' http://192.168.1.163:8080/jsonrpc
I am experiencing the exact same thing - although I'm sending  the command from HomeSeer. I would expect current playback to continue while the preview is being displayed.

Suggestions?
Image
Reply
(2018-09-17, 19:46)politby Wrote:
(2018-07-30, 05:00)iorifly Wrote: Hello everyone!
    This addon is fantastic !!! Congratulations. It works great for my ubiquiti UVC camera

Now I have a doubt. When I call the preview through this code. It exits the movie screen and goes to the addon screen and displays the preview. It would be much better if only the preview is shown. How can I improve?

curl -i -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"Addons.ExecuteAddon","params":{"wait":false,"addonid":"plugin.video.surveillanceroom","params":{"action":"show_preview","camera_number":"1","id":"1"}},"id":2}' http://192.168.1.163:8080/jsonrpc
I am experiencing the exact same thing - although I'm sending  the command from HomeSeer. I would expect current playback to continue while the preview is being displayed.

Suggestions?
Image 
I found another work-a-round because I am working on this problem now for weeks and I want to share it here for the users that try to solve this issue. Its not perfect (no simple json/http):

TL;DR:
Use:
- xdotool
- a key that is defined in keymaps and triggers the preview
- SSH

You can use xdotool (needs to be installed on the target-system)
Quote:DISPLAY=':0.0' xdotool key [KEY]

and SSH to trigger a key on your kodi-system and via keymaps you can trigger
Quote:xbmc.executebuiltin('RunPlugin(plugin://plugin.video.surveillanceroom?action=show_preview&camera_number=1)')


You can trigger it by exchanged keys or -if security is not important- with sshpass (needs to be installed on the client-system)
Quote:sshpass -p [USERPASS] ssh -X [USERNAME]@[KODISYSTEMIP] DISPLAY=:0 xdotool key XF86Search
In my case, I use the the search-key on my remote to activate the preview but i want to trigger it also with iobroker when someone press the doorbell

here you can find a list of keys you can send with xdotool:
http://wiki.linuxquestions.org/wiki/XF86...rd_symbols

You can also choose a key and start the keymap editor to bind it in kodi.


As I found this solution, i had to come here and share it for all unlucky users that have the same issue.
Reply
Hi,

With newer camera's there is no way to enable basic authentication and they user digest authentication. So when i choose a general camera I can't pass user and password successfully in a snapshot URL. I bash I can solve this with the following code:

`curl --user "user:pass" "http://192.168.1.108/cgi-bin/snapshot.cgi?1" --digest -o "\var\tmp\snapshot.jpg" -s` 

When I access the URL in a browser I always get a popup box for authenticatation and I cant find any way to use username and password in the URL, I don't no if this is possible with digest authentication.

But i've no idea how to modify this in your python addon. Can you help me further to modify this or how to do this otherwise? Already raised an issue in Github.
Reply
I think the "getImagesSnapshot" function in allcameraplayer.py and camerapreview.py needs to be adjusted so digest authentication is made possible.
http://docs.python-requests.org/en/lates...ntication/
Here is some information, and example code. But my knowledge op Python fails to think of something and implement it successful. My thought is to allow a username and password for generic camera's and use this info to add digest authentication.
My camera URL for snapshots is http://192.168.1.43/cgi-bin/snapshot.cgi?chn=0 and it then comes with an popup box for login. I cannot provide the user and pass in the URL. I think this is not possible with digest authentication.
Maybe can someone write the code? I could test if it works and then create a pull request.
Reply
  • 1
  • 25
  • 26
  • 27(current)
  • 28
  • 29
  • 31

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