PTZ Control with H264 FOSCAM FI8620

Forum for questions and support relating to the 1.25.x releases only.
Locked
christophe_y2k
Posts: 102
Joined: Mon Oct 12, 2009 8:47 am
Location: EUROPE-FRANCE-MANDELIEU

PTZ Control with H264 FOSCAM FI8620

Post by christophe_y2k »

Hello have a problem to run a ptz script with this H264 camera
Have no problem to have live and i found workaround to select the control protocol directly in sql database
(zm bug: you can't select control protocol with ffmpeg source for cam and this cam is only H264 chipset hi3510)

For controlling it you need to send http request like this, with login/password:

(for turn on left slowly)

Code: Select all

http://admin:password@192.168.0.97/cgi-bin/hi3510/ptzctrl.cgi?-step=1&-act=left&-speed=15
With firefox web broswer that work fine, after open popup for confirm authentification, and this is the probleme with zoneminder.
ZM seem to be not use correctly the Basic HTTP Authentification and with this cam it's not possible to send login/password in cgi parameters

this perl script simplified for testing does'nt work and return an "Can't connect - refused"

Code: Select all

...
sub sendCmd
{
   my $self = shift;
   my $cmd = shift;
   my $result = undef;
   printMsg( $cmd, "Tx" );
   my $req = HTTP::Request->new( GET=>"http://admin:password@192.168.0.97/cgi-bin/hi3510/ptzctrl.cgi?-step=1&-act=left&-speed=15" );     

   my $res = $self->{ua}->request($req);
    
   if ( $res->is_success )
   {
       $result = !undef;
   }
   else
   {
     	 Error( "Error check failed:'".$res->status_line()."'" );
   }	
   return( $result );
}
...

with this error:

Code: Select all

2013-06-05 16:20:17.093540	zmcontrol	10125	FAT	Can't connect: Connexion refusée	zmcontrol.pl	
2013-06-05 16:20:07.092990	zmcontrol	10129	INF	Control server 4/foscamFI8620 starting at 13/06/05 16:20:07	zmcontrol.pl	
2013-06-05 16:20:07.090750	zmcontrol	10125	INF	Starting control server 4/foscamFI8620	zmcontrol.pl	
2013-06-05 16:20:04.373330	zmcontrol	10106	FAT	Can't connect: Connexion refusée	zmcontrol.pl	
2013-06-05 16:19:54.372430	zmcontrol	10110	INF	Control server 4/foscamFI8620 starting at 13/06/05 16:19:54	zmcontrol.pl	
2013-06-05 16:19:54.371300	zmcontrol	10106	INF	Starting control server 4/foscamFI8620	zmcontrol.pl
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: PTZ Control with H264 FOSCAM FI8620

Post by knight-of-ni »

Your right. Zoneminder doesn't support cameras that can only athenticate via a pop-up box. However, one could also argue that the camera's firmware should support authentication embedded into the HTTP string.

It's a shame because I was very close to hitting the "buy" button until I discoverd this myself.

The irony is that Foscam's MJPEG cameas do not have this limitation.

For further reading, this thread on the Foscam forum helps explain the situation (applies to all foscam H.264 cameras):
http://foscam.us/forum/post14111.html

This feature was requested in this Foscam forum thread on June 5:
http://foscam.us/forum/fi8620-how-to-lo ... t5853.html

I have personally sent a request to Foscam tech support for this feature and recommend you do the same. Maybe they will release a new firmware at which point I will gladly give them my money.

In the meantime, maybe someone can write some kind of script that can proxy the authentication request?
Last edited by knight-of-ni on Thu Aug 01, 2013 11:28 pm, edited 1 time in total.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: PTZ Control with H264 FOSCAM FI8620

Post by knight-of-ni »

OKay, I just noticed the irony in my post.... you are the one I quoted from the Foscam forum. #LaughingAtMyself
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
christophe_y2k
Posts: 102
Joined: Mon Oct 12, 2009 8:47 am
Location: EUROPE-FRANCE-MANDELIEU

Re: PTZ Control with H264 FOSCAM FI8620

Post by christophe_y2k »

Hi all, i work on this camera since june and since 3weeks i can use it in zoneminder.

I can view image with ffmeg source and have precise controle ptz function with variable speed and autostop function.
zoom and focus work to, and that very cool and precise with zoneminder
i progress in perl scripting and i found all solution for login and send command with this cam(and certainly all recent foscam)

the only issue is the 8 preset ptz that do not work (the cgi datasheet do not reflet the reality)
camera move but not where you wan't ....

this camera do not work under linux firefox with is own interface and its difficult to obtain an image under
windows firefox and impossible with internet explorer 10.

The only way to use it correctly is with Zoneminder...

I plain to analyse the ptz preset with an older computer under windoze this week....

When this are ok i publish entire method and ptz control script for use it.

Good night
Last edited by christophe_y2k on Fri Aug 02, 2013 7:55 am, edited 1 time in total.
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: PTZ Control with H264 FOSCAM FI8620

Post by knight-of-ni »

Excellent. I look forward to it.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: PTZ Control with H264 FOSCAM FI8620

Post by knight-of-ni »

I created an Issue in the Zoneminder github regarding this. Can you share your results there as well?
My intent is to see if we can get the developer(s) to incorporate your work into the source tree.

https://github.com/ZoneMinder/ZoneMinder/issues/33
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
christophe_y2k
Posts: 102
Joined: Mon Oct 12, 2009 8:47 am
Location: EUROPE-FRANCE-MANDELIEU

Re: PTZ Control with H264 FOSCAM FI8620

Post by christophe_y2k »

Ok i start to send tuto
in few days i termine and release screenshot for easy config and source code etc etc ...
good night

tuto start here :
http://www.zoneminder.com/forums/viewto ... =9&t=21218
Locked