AbelCam Forum
Download AbelCam buy Pro
 
 
 
Welcome Anonymous User
11/22/2024 - 10:08 PM
Quick Search:
Quick Jump:
 
Announcements
Latest Topics
 
PTZ Restore
By: DomenicoS
Rank: Forum Addict
Topics: 59
From: Croatia
Added: 04/02/2008 - 05:28 PM

Hi
I'm using Logi Sphere MP with 2.3.0 Abelcam, will make "Web server" and allow to move (PTZ) my webcam probably by "Java script stream".

I wish that webcam returns to its "Save camera position" like "Restore on start-up" after visitor stops to use my web server.

Is it possible to configure some kind of that option in any way?

Thanks


(I FTP webcam images to real server and also make Local save, and it wont be usefully if some visitor point webcam to wall etc. and leave it like that...)
By: MelvinG
Rank: Magna Cum Laude
Topics: 661
From: Los Angeles, USA
Added: 04/03/2008 - 02:21 AM

No way to do that with AbelCam alone. Shouldn't be very hard to script something on the server side with Perl or something.

To return the camera to Home, send this to AbelCam:
http://yourabelcamurl/home0-0&zoom0-1.0

Or to return it to some other position (30,30 in this example):
http://yourabelcamurl/pos0-30,30&zoom0-1.0

Note that the "&zoom0-1.0" is optional - it resets the zoom at the same time the position is reset.
By: DomenicoS
Rank: Forum Addict
Topics: 59
From: Croatia
Added: 04/04/2008 - 03:43 PM

THX a lot Melvin!

That is a good place to start...

After reset, I get message:

"AbelCam Cam moving

move QuickCam Orbit/Sphere MP-1 pos--30,-30
zoom 1.0 with QuickCam Orbit/Sphere MP-1"



Where is it written = "AbelCam Cam moving", is it alouded/possible to change that text or add something more?


P.S. it is funny I needed 10 minutes for find out how to move webcam to left side, moving up and down with ,40 and ,-40 woos easy, but to figure what to do with: pos0-30
I needed lot of time...
Smile
By: MelvinG
Rank: Magna Cum Laude
Topics: 661
From: Los Angeles, USA
Added: 04/04/2008 - 05:18 PM

The "Abelcam Cam Moving" text is built into the program so there's no way to change it directly. Since I can not see everything you are doing with your HTML and scripts, it is hard for me to say exactly what you need to do. In general terms, here is how the Perl scripts I once used operated:

1) Some even happens that requires camera to move.
2) Event causes a Perl script to run (in cgi-bin on Apache server)
3) Script connects to AbelCam webserver and sends the "home0-0" (or whatever)
4) The SCRIPT receives the text back from AbelCam and throws it away.
5) The script then returns something to the browser - a redirect or some HTML or whatever is desired.

Hope this helps at least a little bit.

By: DomenicoS
Rank: Forum Addict
Topics: 59
From: Croatia
Added: 04/04/2008 - 05:51 PM

I know just a little bit about HTML, nothing about PHP, Java etc...

My funny plan is:

1:visitor connect and move webcam (ajax.html)

2: make somehow that he have to close that window "only" by pressing button which will be link:

http://78.3.219.19:8080/pos0-00,50&zoom0-1.0


3: that he gets some understanding message:
AbelCam Cam moving, Thank you for visiting etc etc

...

Will try to do something in html for start...

THX



By: MelvinG
Rank: Magna Cum Laude
Topics: 661
From: Los Angeles, USA
Added: 04/04/2008 - 07:17 PM

You may want to look at the JavaScript "OnUnload" event. When the visitor closes your window the OnUnload event will fire - use it to invoke a function that does

location.replace("http://yourabelcamurl/pos0-00,50&zoom0-1.0")

on an invisible IFRAME in the parent document.

Note that an invisible IFRAME is used in the AbelCam JavaScript page that is included with the program. The purpose of the IFRAME is to "swallow up" the text messages that are coming back from AbelCam every time the camera is moved. Look at the plain (not Ajax) JavaScript page - it is much easier to read than the Ajax version.
By: DomenicoS
Rank: Forum Addict
Topics: 59
From: Croatia
Added: 04/06/2008 - 01:38 PM

Will do!

Thx a lot!
By: DomenicoS
Rank: Forum Addict
Topics: 59
From: Croatia
Added: 05/03/2008 - 07:31 PM

Message has been edited, click here to see original content

Well, my knowledge is not enough...

I didn't find JavaScript "OnUnload" event. Or I don't know where to search, or I didn't understand what to search.

(Until now I just copy wwwroot to myroot, and add link under cam pic in ajax.html to reset webcam position, all other files are original from instalation.)


Than I tried to do something:

I found some iframe after "include start videoinput" in javacript/index.html and javacript/ajax.html...

which is followed with "include stop videoinput" which doesn't have writen iframe. I copy above one and link it to:

( I add ) "/include/videooutputs_iframe.html" with ahref="http://cres-webcam.homeip.net:8080/pos0-00,30&zoom0-1.0" ,
but all this reset cam position when visitor open ajax.html, not when he leave the server.

Maybe I made some mistakes here, I will return it like it woos in few days.

I need some more help

Embarrassed

Here is link if somebody wish to overview server.

Thanks!
By: MelvinG
Rank: Magna Cum Laude
Topics: 661
From: Los Angeles, USA
Added: 05/04/2008 - 08:51 AM

If you really want this to work perfectly, you need to implement it on the server, not in the browser. That will be difficult because of the "stateless" nature of HTTP.

Note that there is already an existing invisible IFRAME on the JavaScript page. Its name is 'dummy'. Use it.

Here are two ideas for doing it from the browser - they are not perfect.

1) To make your "please reset cam" link work properly, do it like this:


<a target='dummy' href='#' onClick='dummy.location.replace("http://cres-webcam.homeip.net:8080/pos0-00,50&zoom0-1.0");'>
<b><font SIZE="6">
Please - click here before leaving to reset webcam!!!<br>
THANKS</font></b>
</a>

2) To make it reset automatically when user leaves the page you can try changing your BODY tag to look like this:

<body onload='javascript:loadinit();' onUnload='dummy.location.replace("http://cres-webcam.homeip.net:8080/pos0-00,50&zoom0-1.0");'>



HOWEVER!!! Method 2 only works SOME of the time! There is a reason this doesn't work well: when the onUnload event occurs, the document is already being cleared from the browser. Clearing does not stop and wait for the onUnload handler to execute. So there is a "race" going on between the event handler and the document. If the event handler loses the race (and it does lose, frequently) it will fail, because the IFRAME it is operating on has already been erased. This is either a "bug" or a "feature" of JavaScript, depending on how you look at it.

So Method 2 is not very good. I have now spent 3 hours trying different programming tricks to make it work better and I have not succeeded.
By: MelvinG
Rank: Magna Cum Laude
Topics: 661
From: Los Angeles, USA
Added: 05/04/2008 - 09:08 AM

Here's another way to reset the cam automatically when the user leaves the page. It works every time, but the "price" is that it uses an annoying pop-up. By using the pop-up, we make sure that the event handler wins the "race".

This is a modification to the existing BODY tag:


<body onload='javascript:loadinit();' onUnload='dummy.location.replace("http://cres-webcam.homeip.net:8080/pos0-00,50&zoom0-1.0"); alert("Bye bye!");'>


By: DomenicoS
Rank: Forum Addict
Topics: 59
From: Croatia
Added: 05/06/2008 - 04:48 PM

Well Melvin, this is simple and great!

First test I done reset webcam after few seconds, I can write "good bye" message on pop-up, I have all I asked for...

Thanks a lot!