Home AMX User Forum AMX Technical Discussion

Camera Contol

I want to control my ptz cams or at minimum be able to view them on my touch panel. They are Java based. I know how to use the motion Jpeg image but in this case I cant do that how else can I control them or at least view?

Comments

  • ericmedleyericmedley Posts: 4,177
    davidv wrote: »
    I want to control my ptz cams or at minimum be able to view them on my touch panel. They are Java based. I know how to use the motion Jpeg image but in this case I cant do that how else can I control them or at least view?

    it depends upon the camera. What/which brand are you speaking of?
  • davidvdavidv Posts: 90
    Camera Brand

    Micron iguard 280e camera
  • davidvdavidv Posts: 90
    Control Info

    <html><head><title>Camera A</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><link rel=stylesheet type=text/css href=style.css><script language="javascript">

    var zoom_size=100;

    var msg_height=24;

    var angle=0,mirror=0,angle_count=0;

    var mirror_status=0;

    var isChangeSize=2;

    var old_isChangeSize=0;

    var changed=0;

    var ImageSize_w=0,ImageSize_h=0,msg_radix=0;

    var freesize=0;

    var camNo=1;

    function change_freesize()

    {

    if(freesize == 0){

    document.getElementById("free").src="freesize_down.gif";

    document.getElementById("free").alt="Image Selection";

    document.cam.setCropImage(1);

    freesize = 1;

    }else{

    document.getElementById("free").src="freesize.gif";

    document.getElementById("free").alt="Normal";

    document.cam.setCropImage(0);

    freesize = 0;

    }

    }

    function getImageSize()

    {

    var cam = document.getElementById("cam");

    ImageSize_w = document.cam.getImgWidth();

    ImageSize_h = document.cam.getImgHeight();

    if ((ImageSize_w == 0)||(ImageSize_h == 0)) {

    ImageSize_w = cam.width;

    ImageSize_h = cam.height;

    }

    msg_height = 26;

    }

    var old_w = 320;

    var old_h = 262;

    var w1,h1;

    function swap_w_h()

    {

    var cam = document.getElementById("cam");

    getImageSize();

    if ((old_w != ImageSize_w) || (old_h != ImageSize_h)) {

    changed = 1;

    old_w = ImageSize_w;

    old_h = ImageSize_h;

    }

    cam.width=ImageSize_w;

    cam.height=ImageSize_h+msg_height;

    w1 = (parseInt(cam.width) < 332 ? 320 : parseInt(cam.width)) + 160;

    h1 = (parseInt(cam.height) < 252 ? 240 : parseInt(cam.height)) + 160;

    if(parseInt(changed) == 1) {

    document.cam.ImageSizeChangedAck();

    changed = 0;

    top.resizeTo(w1,(h1+1));

    }

    }

    function change_zoom(status)

    {

    var cam = document.getElementById("cam");

    if(status==1) {

    switch(zoom_size){

    case 25:

    zoom_size = 50;

    document.getElementById("z_out").disabled = 0;

    break;

    case 50:

    zoom_size = 75;

    break;

    case 75:

    zoom_size = 100;

    break;

    case 100:

    zoom_size = 125;

    break;

    case 125:

    zoom_size = 150;

    break;

    case 150:

    zoom_size = 200;

    break;

    case 200:

    zoom_size = 400;

    document.getElementById("z_in").disabled = 1;

    break;

    }

    }else if(status==0) {

    switch(zoom_size){

    case 400:

    zoom_size = 200;

    document.getElementById("z_in").disabled = 0;

    break;

    case 200:

    zoom_size = 150; break;

    case 150:

    zoom_size = 125; break;

    case 125:

    zoom_size = 100; break;

    case 100:

    zoom_size =75; break;

    case 75:

    zoom_size = 50; break;

    case 50:

    zoom_size = 25;

    document.getElementById("z_out").disabled = 1;

    break;

    }

    }

    swap_w_h();

    document.cam.setResizeImage(zoom_size);

    }

    function change_focal(status)

    {

    document.cam.setDigitalZoom(status);

    swap_w_h();

    }

    function status_gress(rotate)

    {

    if(mirror_status == 0) {

    if(rotate==0)

    angle_count-=1;

    else

    angle_count+=1;

    } else {

    if(rotate==0)

    angle_count+=1;

    else

    angle_count-=1;

    }

    angle=angle_count%4;

    if(angle>3)

    angle-=4;

    else if(angle<0)

    angle+=4;

    swap_w_h();

    document.cam.setAngle(rotate,zoom_size);

    }

    var direction = 2;

    function getMoveDirection(){

    var v1 = document.cam.getMove_direction();

    if (v1 > 0){

    direction = v1;

    }

    if(direction== 1){

    document.getElementById("around").src="stop_around.gif";

    document.getElementById("around").alt="Stop";

    }

    }

    function setauto(){

    if(direction ==2){

    document.getElementById("around").src="stop_around.gif";

    document.getElementById("around").alt="Stop";

    document.cam.setMove_direction(9);

    direction =1;

    }else{

    document.getElementById("around").src="around.gif";

    document.getElementById("around").alt="Start";

    document.cam.setMove_direction(10);

    direction =2;

    }

    }

    function send_server(obj)

    {

    document.cam.setExternalFlip(obj.name,obj.checked==true?1:0);

    }

    function setMaxFrameRateApplet(maxFR)

    {

    document.cam.setExternalFPS(maxFR);

    }

    function changeMirror()

    {

    object = document.getElementById("mirror");

    if (mirror_status == 0){

    object.src="mirror_down.gif";

    object.alt="Normal";

    mirror_status = 1;

    }else{

    object.src="mirror.gif";

    object.alt="Mirror";

    mirror_status = 0;

    }

    document.cam.setMirror();

    }

    function setMoveDirection(mm)

    {

    document.cam.setMove_direction(mm);

    }

    function checkAngle()

    {

    var cam = document.getElementById("cam");

    angle = document.cam.getAngle();

    swap_w_h();

    var timerID = setTimeout("checkAngle()",1000);

    }

    function html_getMirror(){

    mirror_status = document.cam.getMirror();

    object = document.getElementById("mirror");

    if (mirror_status == 0){

    object.src="mirror.gif";

    object.alt="Mirror";

    }else{

    object.src="mirror_down.gif";

    object.alt="Normal";

    }

    }

    function simp_go_spot(spot)

    {

    var cgiurl;

    cgiurl = "run_hotspot.cgi?cam=" + camNo + "&target=" + spot;

    top.hotspotcgi.document.location = cgiurl;

    document.cam.setMove_direction(10);

    document.getElementById("around").src="around.gif";

    document.getElementById("around").alt="Start";

    direction =2;

    }

    function setMoveMode(mm) {

    document.cam.setMove_Mode(mm);

    }

    </script></head><body class=bgc><table cellspacing=0 cellpadding=0 align=center width=100%><tr><td align=center><input type=hidden name=$set_camA_size id=set_camA_size value="2"><applet code=a.c.class name=cam id=cam archive=channel.jar width=320 height=262 align=right><param name=CHANNEL value=1><param name=WIDTH value=320><param name=HEIGHT value=262><param name=SPEED value=0.5><param name=IMGTRANSPORT value=9001><param name=USERID value=guest><param name=USERPWD value=guest><param name=LOCATION value="Location:"><param name=CONNECTION value="Connection:"><param name=SYSTEM_TIME value="System Time:"><param name=NO_RESPONSE value="Server has no response"><param name=EXCEED_MAX_CONNECTIONS value="Exceed max connections"><param name=FPS value="FPS:"><param name=IMAGE_ERROR value="Image error"><param name=PERMIT_TIME_END value="The permit time has been terminated"><param name=CAM_NO_PLUGGED value="Camera A not plugged in"></applet></td><td width=5% valign=bottom><table></table></td></tr><tr><td align=right><input name=free id=free type=image onClick=change_freesize() src=freesize.gif alt="Image Selection"><input name=focal_in id=f_in type=image onClick=change_focal(1) src=focal_in.gif alt="Enlarge Image"><input name=focal_out id=f_out type=image onClick=change_focal(0) src=focal_out.gif alt="Reduce Image"><input name=z_in id=z_in type=image onClick=change_zoom(1) src=zoom-in.gif alt="Zoom In"><input name=z_out id=z_out type=image onClick=change_zoom(0) src=zoom-out.gif alt="Zoom Out"><input name=regress type=image onClick=status_gress(0) src=rotate_left.gif alt="Rotate Left"><input name=gress type=image onClick=status_gress(1) src=rotate_right.gif alt="Rotate Right"><input name=mirror id=mirror type=image width=28 height=27 onClick=changeMirror(); src=mirror.gif alt="Mirror"> </td></tr></table><div id=javadownload>You may not have the right system requirements to support Java software. <br> Please consult the <a href=http://www.java.com/en/download/windows_automatic.jsp>http://www.java.com</a&gt; for assistance..</div></body><script language=javascript>

    var javaws;

    if (navigator.userAgent.indexOf("Gecko") !=-1){

    x = navigator.mimeTypes;

    if(x) {

    window.setTimeout("getMoveDirection()",3000);

    window.setTimeout("html_getMirror()",3000);

    window.setTimeout("checkAngle()",3000);

    document.getElementById("javadownload").style.display = "none";

    }

    }

    </script><script language=VBscript>

    On Error Resume Next

    If Not(IsObject(CreateObject("JavaWebStart.isInstalled"))) Then

    javaws = 0

    ELSE

    javaws = 1

    END IF

    </script><script language=javascript>

    if (navigator.appName != "Netscape"){

    if(window.javaws) {

    window.setTimeout("getMoveDirection()",2000);

    window.setTimeout("html_getMirror()",2000);

    window.setTimeout("checkAngle()",2000);

    document.getElementById("javadownload").style.display = "none";

    }

    }

    </script></html>
  • viningvining Posts: 4,368
    That's just the HTML source and is only useful for javascript enable browsers.

    In the cameras set up pages see if there are html examples for your setup like in this picture for an Axis Camera setup. In this set up once you select your stream type, image size, etc it will issue a url where that setup can be fetched from. (bottom of picture)

    The pdf I read said it supports MJPEG Steams which I assume meant streams so it should be viewable via dynamo, dynamic image. Control may be a little tricky w/o an api of HTTP commands but once you find them or figure them out you'll need to open an HTTP connection every time you want to issue a command. The connection will need to close before you can open another connection to issue another command. I can show you examples for axis cameras but you need command suitable for your camera. Maybe try sniffing with wireshark, it shouldn't take that long.
  • viningvining Posts: 4,368
    I downloaded the manual and it doesn't appear to support MJPEG afterall. It does have MPEG-4 which I think works on VG panels and you can set up a button to accept streaming in TPD4>properties>states>video fill select streaming and then below, enter the source. (maybe?)

    I've never tried this and don't know if or how it works.

    ftp://ftp.micon.com/micontechnology/iGuard/iGuard-200%20Series%20User's%20Guide.pdf
    AVI codecs:
Sign In or Register to comment.