Check alle échte Black Friday-deals Ook zo moe van nepaanbiedingen? Wij laten alleen échte deals zien

[HTML]Axis PTZ Camera besturen

Pagina: 1
Acties:
  • 299 views sinds 30-01-2008
  • Reageer

  • LiquidSmoke
  • Registratie: Maart 2001
  • Laatst online: 30-11 09:11
Ik heb hier een Axis 213PTZ camera, welke te draaien is door een commando naartoe te posten volgens onderstaande manier:

http://172.16.30.251/axis-cgi/com/ptz.cgi?move=up


Dit werkt ook goed, alleen nadeel is dat het beeld op pagina stil gaat staan en niet meer ververst wordt.

Wanneer ik de video open laat staan op een andere pagina blijft deze wel doorlopen (je ziet hem verschuiven).

Op de één of andere manier zal ik dus gegevens moeten posten zonder da thet beeld stil gaat staan.

De besturingsknoppen in een ander frame is helaas geen optie, ook Google en de Axis media control SDK help bieden geen uitkomst.

Iemand een idee hoe dit te doen?

  • Defector
  • Registratie: December 2005
  • Niet online
mischien heel simpel maar als je een move commando stuurt de pagina automatisch opnieuw laten laden.

  • LiquidSmoke
  • Registratie: Maart 2001
  • Laatst online: 30-11 09:11
Dat is ook een optie natuurlijk, maar hoe kan ik met 1 link én de gegevens verzenden én de pagina vernieuwen?

Ik heb hierop gegoogled maar kreeg niet echt een duidelijk antwoord.

Als ik de link (via aan a href) in een nieuw venster laat openen (target=blank) dan loopt de stream gewoon door...

  • Defector
  • Registratie: December 2005
  • Niet online
In de code van de pagina die je aanroept is dat aan te passen je kunt het op meerdere manieren doen bv javascript of cgi (aangezien de pagina in die taal geschreven heb) tenminste ik neem aan dat cgi dat kan want daar heb ik voor de rest geen ervaring mee.

[ Voor 93% gewijzigd door Defector op 27-09-2007 15:06 ]


  • LiquidSmoke
  • Registratie: Maart 2001
  • Laatst online: 30-11 09:11
Tot welke code? Ik kan overal bij iig.

Die van de camera is vrij eenvoudig;

Ik heb een javascriptje die de cam-stream laad en die roep ik aan in een html-tabel.
HTML:
1
<td  align=center><SCRIPT SRC="../js/camera.js" LANGUAGE="JavaScript" TYPE="text/javascript"></SCRIPT></td>


In de volgende tabelrij wil ik wat simpele controls gebruiken.
HTML:
1
<a href="http://172.16.30.251/axis-cgi/com/ptz.cgi?move=down"><img width="14pcx" height="16pcx" src="../img/down.png">


Zodra ik op de knop druk, stopt het beeld en moet je de pagina verversen...

De code van het javascriptje (is door de cam zelf gegenereerd)

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Set the BaseURL to the URL of your camera
var BaseURL = "http://172.16.30.251/";

// DisplayWidth & DisplayHeight specifies the displayed width & height of the image.
// You may change these numbers, the effect will be a stretched or a shrunk image
var DisplayWidth = "352";
var DisplayHeight = "288";

// This is the path to the image generating file inside the camera itself
var File = "axis-cgi/mjpg/video.cgi?resolution=CIF";
// No changes required below this point
var output = "";
if ((navigator.appName == "Microsoft Internet Explorer") &&
   (navigator.platform != "MacPPC") && (navigator.platform != "Mac68k"))
{
  // If Internet Explorer under Windows then use ActiveX 
  output  = '<OBJECT ID="Player1" width='
  output += DisplayWidth;
  output += ' height=';
  output += DisplayHeight;
  output += ' CLASSID="CLSID:DE625294-70E6-45ED-B895-CFFA13AEB044" ';
  output += 'CODEBASE="';
  output += BaseURL;
  output += 'activex/AMC.cab#version=3,32,14,0">';
  output += '<PARAM NAME="MediaURL" VALUE="';
  output += BaseURL;
  output += File + '">';
  output += '<param name="MediaType" value="mjpeg-unicast">';
  output += '<param name="ShowStatusBar" value="0">';
  output += '<param name="ShowToolbar" value="0">';
  output += '<param name="AutoStart" value="1">';
  output += '<param name="StretchToFit" value="1">';
  // Remove the '//' for the ptz settings below to use the code for click-in-image. 
      output += '<param name="PTZControlURL" value="';
      output += BaseURL;
      output += '/axis-cgi/com/ptz.cgi?camera=1">';
      output += '<param name="UIMode" value="ptz-relative">'; // or "ptz-absolute"
  output += '<BR><B>Axis Media Control</B><BR>';
  output += 'The AXIS Media Control, which enables you ';
  output += 'to view live image streams in Microsoft Internet';
  output += ' Explorer, could not be registered on your computer.';
  output += '<BR></OBJECT>';
} else {
  // If not IE for Windows use the browser itself to display
  theDate = new Date();
  output  = '<IMG SRC="';
  output += BaseURL;
  output += File;
  output += '&dummy=' + theDate.getTime().toString(10);
  output += '" HEIGHT="';
  output += DisplayHeight;
  output += '" WIDTH="';
  output += DisplayWidth;
  output += '" ALT="Camera Image">';
}
document.write(output);
// document.Player.ToolbarConfiguration = "play,+snapshot,+fullscreen"
// document.Player.UIMode = "MDConfig";
// document.Player.MotionConfigURL = "/axis-cgi/operator/param.cgi?ImageSource=0"
// document.Player.MotionDataURL = "/axis-cgi/motion/motiondata.cgi";


Zodra ik op de knop druk moet dus ook de pagina ververst worden, maar ik kom er niet uit hoe dat te doen..

[ Voor 70% gewijzigd door LiquidSmoke op 27-09-2007 15:11 ]


  • LiquidSmoke
  • Registratie: Maart 2001
  • Laatst online: 30-11 09:11
Het antwoord kan soms zo simpel zijn:

Een on-click parent refresh doet wonderen :)
Pagina: 1