Release - Foscam HD - Video feed with camera controls, and motion/sound detection preview

  Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
fantasticn Offline
Senior Member
Posts: 294
Joined: Dec 2012
Reputation: 2
Location: Germany
Post: #16
Hi Leopold,

thanks for you answer.

As to the adjustments of the files I would appreciate your help because I really do not have any expertise in coding (at least not with respect to those XMBC addons).

"http://username:[email protected]/snapshot.cgi" ist working fine and delivers a snapshot from the current view in 640x480.

The camera has built in motion-detection (adjustable through the webinterface), but of course any software just tracking the picture that it's been delivered from the camera should be able to do its own motion detection.

Best regards,

FantasticN
find quote
Leopold Offline
Fan
Posts: 358
Joined: Jan 2011
Reputation: 14
Location: UK
Post: #17
Yes this add-on queries the status of the camera's own motion detection alarm. I found the command to do that for the MJPEG models, e.g. using the Foscam demo:

http://50.197.211.181:8910/get_status.cg...pwd=foscam

This reveals that the response is not XML format as with the HD models, so that adds another complication for adapting the current code. The easiest way to parse the response would be something like

PHP Code:
re.findall("^var (\w+)='?([\w\.]+)'?;$"responsere.M

Start by going through the add-on code until you understand the basics of what it does, but adapting it would not be trivial.

If you want something basic without adapting the add-on you can access the main video feed in XBMC by creating a text .strm file with contents in this format:

http://50.197.211.181:8910/videostream.a...pwd=foscam

http://wiki.xbmc.org/index.php?title=Int...le_method:

Leopold's Repository: Home of LibreELEC Dev Updater ...
find quote
fantasticn Offline
Senior Member
Posts: 294
Joined: Dec 2012
Reputation: 2
Location: Germany
Post: #18
Hi Leopold,

thanks for the info. I tried the Foscam demo command with my cameras IP & password and it came up with the following result:

var id='78A5DD07894D';
var sys_ver='21.35.2.47';
var app_ver='0.7.3.6';
var alias='Haustuer';
var now=1397022178;
var tz=0;
var alarm_status=0;
var ddns_status=0;
var ddns_host='';
var oray_type=0;
var upnp_status=0;
var p2p_status=0;
var p2p_local_port=25656;
var msn_status=0;
var wifi_status=0;
var temperature=0.0;
var humidity=0;
var tridro_error='';

Now what can I do with that info?

I already have my cam implemented in XBMC by means of a simple playlist named "ipcam.pls" under "\userdata\playlists\video". It hast the following content:

[playlist]
NumberOfEntries=1
File1=http://ip-address/videostream.asf?user=username&pwd=password
Title1=IP Camera
Length1=-1
Version=2

I added the playlist as a favorite so I access it from the main menu. It will show up as a fullscreen video then. However, I would like to make use of the functions your addon provides (small picture-in-picture-screen automatically shown when a motion is detected). Do you have an idea how to (easily) implement it? Or do you at least see a way to have a button assigned to my remote control that brings up the cam as a picture-in-picture-screen,

Best regards,

FantasticN
find quote
Leopold Offline
Fan
Posts: 358
Joined: Jan 2011
Reputation: 14
Location: UK
Post: #19
alarm_status is the part you are interested in.

0 = motion detection disabled
1 = motion detection enabled but not detected
2 = motion detected

(2014-04-09 07:57)fantasticn Wrote:  Do you have an idea how to (easily) implement it?
It could probably be done but it would take some time to make the addon work completely with the MJPEG cameras, and my free time is quite limited at the moment.

(2014-04-09 07:57)fantasticn Wrote:  Or do you at least see a way to have a button assigned to my remote control that brings up the cam as a picture-in-picture-screen,
For that you could use the "Security Cam Overlay" addon http://forum.xbmc.org/showthread.php?tid=182540.

You can run the addon with a button press by putting something like this in userdata/keymaps/remote.xml

Code:
<keymap>
  <global>
    <remote>
      <blue>XBMC.RunAddon(script.securitycam)</blue>
    </remote>
  </global>
</keymap>

The overlay grabs the focus so while it is active you can't navigate any other windows.

Leopold's Repository: Home of LibreELEC Dev Updater ...
find quote
fantasticn Offline
Senior Member
Posts: 294
Joined: Dec 2012
Reputation: 2
Location: Germany
Post: #20
Hi Leopold,

thank you very much! That's exactly what I wanted. Now I can have my cam as an overlay on top of the menu or any video I watch. The option to combine it with motion detection would be a nice additional gadget. But for the time being I am totally fine.

Best regards and another time: thank you!

FantasticN
find quote
Piet Mosh Offline
Junior Member
Posts: 7
Joined: Oct 2013
Reputation: 0
Post: #21
Hi there,

thanks a lot for your addon, but unfortunatly I canĀ“t get it to work.
Addon always replies, check your Settings and/or Network configuration.

Camera: FI9820w
XBMC: Gotham RC1

IP: 192.168.178.XX
Port: set my own port to 98xx


Democam also not working

What did I wrong?
Any advice?

Thanks in advance Wink

Piet
find quote
Leopold Offline
Fan
Posts: 358
Joined: Jan 2011
Reputation: 14
Location: UK
Post: #22
Are you sure the port is correct? The default port is 88 I think.

Leopold's Repository: Home of LibreELEC Dev Updater ...
find quote
Piet Mosh Offline
Junior Member
Posts: 7
Joined: Oct 2013
Reputation: 0
Post: #23
Hi,

thnx for your reply.
Changed it to 88. Nothing changed Sad

Do you know the direct stream url?

Thnx
find quote
Leopold Offline
Fan
Posts: 358
Joined: Jan 2011
Reputation: 14
Location: UK
Post: #24
rtsp://user:[email protected]:port/videoMain

You can try this url in a .strm file and see if XBMC can play it.

Leopold's Repository: Home of LibreELEC Dev Updater ...
find quote
sea3pea0 Offline
Junior Member
Posts: 49
Joined: Oct 2013
Reputation: 0
Post: #25
This addon looks very nice! Great work! I was wondering if there is a way to trigger the addon to display the preview image? I understand how to use the command to display the main video feed but since I don't use the foscam camera's built in motion detection I am looking for a way to trigger the addons alert/preview function externally. I have been using the addon security cam overlay for this and it works nice however I haven't been able to get that addon to work with my ios xbmc on my ipad. Your app does work on my ipad though. Thanks
find quote
Leopold Offline
Fan
Posts: 358
Joined: Jan 2011
Reputation: 14
Location: UK
Post: #26
(2014-05-02 22:36)sea3pea0 Wrote:  I have been using the addon security cam overlay for this and it works nice however I haven't been able to get that addon to work with my ios xbmc on my ipad.
What exactly isn't working with the Security Cam Overlay addon?

Leopold's Repository: Home of LibreELEC Dev Updater ...
find quote
sea3pea0 Offline
Junior Member
Posts: 49
Joined: Oct 2013
Reputation: 0
Post: #27
I can't get it to display at all on IOS. It works just fine on windows. For example when I launch the overlay from within xbmc on ipad, a place holder appears where the image would be, but without an image. I can make the same thing happen externally from the json interface. Once again just no image.
(This post was last modified: 2014-05-03 07:22 by sea3pea0.)
find quote
Leopold Offline
Fan
Posts: 358
Joined: Jan 2011
Reputation: 14
Location: UK
Post: #28
I think your best bet is to post a log file on the other thread. There may be some clues in the log.

Turn on debug mode, try to run the addon, upload xbmc.log to xbmclogs.com, then post the url.

(2014-05-02 22:36)sea3pea0 Wrote:  I was wondering if there is a way to trigger the addon to display the preview image?
There isn't currently a way to trigger the preview manually with this addon.

With the MJPEG Foscams I believe you can trigger a motion event through a cgi request but not with the HD cameras.

Leopold's Repository: Home of LibreELEC Dev Updater ...
(This post was last modified: 2014-05-03 13:00 by Leopold.)
find quote
sea3pea0 Offline
Junior Member
Posts: 49
Joined: Oct 2013
Reputation: 0
Post: #29
Thanks, I'll do that. Do you have any plans to include support for foscam mjpeg cameras in your addon? I have a mix of mjpeg cams and hd cams. It would be nice to be able to use your addon for both types of cam.

Regards,

Sea
find quote
Leopold Offline
Fan
Posts: 358
Joined: Jan 2011
Reputation: 14
Location: UK
Post: #30
I did start to look into it but came to the conclusion that it would be best to make a separate addon. I will probably get round to doing it at some point.

Leopold's Repository: Home of LibreELEC Dev Updater ...
find quote
Post Reply