Motion - Feature Request 2011x 07x 30x 103630

Feature Request: Foscam motion tracking


I would like to enable motion tracking on my Foscam camera. I can activate panning and tilting through URL commands. example: http://CAM_IP/decoder_control-cgi?command=0&onestep=1 moves the cam down.

Now I'm looking for a way to do this with motion. Any suggestions?

Best regards, Raf

-- RafVerholen - 30 Jul 2011

Follow up


I've just attached 2 patches that work against trunkREV548. These perfectly enable motion tracking with the foscam FI8918W camera on my COS 5.2 system (ClearOS) However, please not that : - part of it is in ksh as I don't have enough C skills to include it directly within the motion source code. THIS REMAINS TO BE DONE. - the ksh part have to be installed within /usr/local/bin (sorry hardcoded within patch code) - it works because my /bin/sleep command does accept decimal delay Please enjoy. Regards, ps : I may test any C fully integrated solution when provided.

-- FFredHintze - 06 Dec 2011

Please find uploaded "trunkREV548.EmbeddedFI8918W.patch" that enables motion tracking with the Foscam FI8918W webcam without any ksh aditional driver. The tracking feature as been improved with a dynamic track.move_wait calculation base on the real frames rate instead of the config setting value because the frames rate of the webcam depends the amount of light. Unfortunaly and to end with, a few external call to wget binary remain as part of the netcam.c should be completed so that sending GET connexions to the decoder_control URL without interfering with the mjpeg or jpeg capturing. Some help on this matter would be really appreciated. Best regards to motion "lovers".

-- FFredHintze - 19 Dec 2011


I have installed motion 548 with this patch successfully on Knoppix 6.7.0 live CD. I am struggling to get the tracking feature working on my fi8918w, any pointer on how to configure for getting this working would be really nice please.


-- RafiqPatel - 08 Jan 2012

Hi, The tracking feature reads the config file for : netcam_url http://<ip of FI8918W>/videostream.cgi netcam_userpass <login>:<passwd> (if any) track_type 7 track_auto on track_speed 700 when FI8918W external PTz speed is set to 0 or track_speed 250 when FI8918W external PTz speed is set to 1 ### End of config file used values ### FI8918W external PTz speed refers to the "Device Management"/"PT Speed" when connecting directly to http://<ip of FI8918W>/ using Ur browser.

Please MAKE SURE / check that you have : - /usr/bin/wget installed (This reads to be the issue as I do not know Knoppix) - patched motion 548 with trunkREV548.EmbeddedFI8918W.patch

Once done AND If it is still not working : - Uninstall motion (or rename /etc/motion.conf) for testing purpose. - Download FI8918W-PTz.ksh - make sure you have ksh and wget installed - configure ip, login, pwd and v_speed vars within FI8918W-PTz.ksh - send command like this one : ./FI8918W-PTz.ksh -dbg -mv RIGHT 600 You should be able to look your cam moving or to pinpoint the config/install issue.


-- FFredHintze - 14 Jan 2012

Thankyou for your reply. I have set all required params but still no joy with motion tracking but command line with FI8918W-PTz.ksh works.

-- RafiqPatel - 15 Jan 2012

Once FI8918W-PTz.ksh is working, motion trunk 548 patched with trunkREV548.EmbeddedFI8918W.patch (and NOT the former patch) is to be working as well as this patch actutaly does code (in C) the ksh script within motion. Thus it might be another config issue. Did you manage to have motion standard feature (capturing on event) when setting "track_auto off" before trying to track any picture change? Does your motion user is able to run /usr/bin/wget ? If none of thess solved the issue, please remind that trunkREV548.patch applied to motion trunk 548 does make direct call to the /usr/local/bin/FI8918W-PTz.ksh (which is not used anymore in trunkREV548.EmbeddedFI8918W.patch). Using the -dbg flag, it must help as well. Regards

-- FFredHintze - 16 Jan 2012

Motion capture on event works, just not moving camera. I will try using first patch without integrated C tonight and get back to you. Knoppix distro has /usr/bin/wget. Wondering if any permissions need to be changed anywhere, even though I am executing motion as root. Does your camera loose track of position? e.g if I issues ksh command RIGHT 600 then LEFT 600 it will not come back to the exact same spot. Regards

-- RafiqPatel - 16 Jan 2012

Hi, the tracking feature does not record any absolute position coordinates (not available through the cam web services). Thus the tracking feature only send move comand (that right). Only the "set home" and "goto home" are suported (using the set and goto flag of the ksh). However, please note that, eventhough running RIGHT 600 then LEFT 600, the cam does not "exactly" comes back to the same position as the webservices cant pilot the number of step the cam step motor runs. This is not a real issue as the next motion detection cycle is to correct the position if the cam is not enough centered on the pixel change event. Besides, precision of the cam move command is to be better when lowering the cam rotating speed (meaning highering PT speed e.g. set to 5 within the web interface). However, fastest move and thus rotating speed are much more usefull and validated for tracking my little boy running (3y.o.) with motion. Regards

NB : use motion debug feature (reading foswiki) on type TRACK to read the tracking command actually send by the 548 patched motion trunk. It must help solving your issue. Embedded patch is definately working at my place since december.

-- FFredHintze - 18 Jan 2012

I'm really willing to try to setup motion with my foscam camera. Any updates to this thread? Do any of you have a working config file for me to use as an example for the 8918W? thanks

-- EmersonCardoso - 21 Jun 2012

Please find "motion-FI8918W auto-tracking.doc" that is part of my config at home. (motion.conf and thread2.conf) There may have 5 cams depending the time. Please note that you won't need the whole config to have the auto tracking working. You only need : track_type 7, track_auto on, track_move_wait 3 and track_speed 700.

-- FFredHintze - 25 Jun 2012

where i found to download rev548?

-- GeorgeBarbounis - 26 Jul 2012

have you patch for the latest ver of motion?

-- GeorgeBarbounis - 26 Jul 2012

I created a patch for Gentoo and its version ot Motion 3.2.12. Be warned that the patched version crashes after several minutes with segfault. I guess it will need some more work before it becomes stable.

This patch will not work on the chineese clones of Foscam IP cameras (such as EasyN) since the decoder_control.cgi does not support authentication but simply rely on authentication header passed by the browser once the authentication is made. To have this working on the cheaper clones one will have to provide the base64 encoded header value in the settings as well.

-- HristoIliev - 07 Feb 2013

  • FI8918W-PTz.ksh: external /usr/local/lib/ ksh driver (remains to be C implemented within motion)

I Attachment Action Size Date Who Comment
FI8918W-PTz.kshksh FI8918W-PTz.ksh manage 4 K 06 Dec 2011 - 21:43 UnknownUser external /usr/local/lib/ ksh driver (remains to be C implemented within motion)
motion-FI8918W_auto-tracking.docdoc motion-FI8918W_auto-tracking.doc manage 155 K 25 Jun 2012 - 21:56 UnknownUser FI8918W web and motion config to get auto tracking
patch_foscam_motion-3.2.1212 patch_foscam_motion-3.2.12 manage 13 K 07 Feb 2013 - 11:18 UnknownUser Gentoo & Motion 3.2.12 patch based on FFredHintze patch
trunkREV548.EmbeddedFI8918W.patchpatch trunkREV548.EmbeddedFI8918W.patch manage 14 K 19 Dec 2011 - 22:08 UnknownUser New patch (release2) integrating fully embedded FI8918W webcam tracking but wget
trunkREV548.patchpatch trunkREV548.patch manage 10 K 06 Dec 2011 - 21:37 UnknownUser motion code patch based on trunkREV548
Topic revision: r13 - 07 Feb 2013, HristoIliev
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.