Home AMX User Forum AMX Control Products
Options

Dynamic Images w/o path/file?

Is it some how possible to pull an MJPEG stream if I can't provide a path and/or filename? I have some new cameras made by HAI that don't require or have a path or filename and they expect you to get the stream by the IP:Port but I can't seem to make it work with for a TP's dynamic image or a Synollogy Surveillance Station since their entries won't accept anything that doesn't use a filename.

Comments

  • Options
    AMXJeffAMXJeff Posts: 450
    Hope this helps!

    Network Path Information

    While AMX strives to bring to the market innovative features such as support for Motion JPEG, at points we have to work through the different ways manufacturers implement standards. In the case of streaming network cameras/servers, manufacturers are using somewhat different syntax for requesting Motion JPEG streams from their networked cameras and servers.

    For example, many networked cameras/servers are accessed using a regular HTML browser, and the camera/server is serving up an HTML page with a video window being a part of the page. For Dynamo, however, the panel needs to access only the M-JPEG stream, not the entire HTML page served by the camera/server by default.

    Depending on the camera/network video server type you are using, you may need to consult product documentation, or if necessary, contact manufacturer's technical support. In general, however, what is being sent to the camera/server in the path is a CGI call that may have additional parameters based on the feature set of the camera/server and the syntax the manufacturer requires. What follows are examples for some of most popular manufacturers.

    Note: Like with any other type of equipment AMX controls, manufacturer's documentation and customer support are the most reliable ways of obtaining information on the device's communication protocol/syntax. This can also help you fully utilize optional features available on that specific device.

    However, at times it can be difficult to get the needed information with respect to the protocol/syntax of a particular camera/server. One way to work around this is connecting to your networked camera or video server using an Internet browser that captures the location or path to the stream. An example of such browser is Mozilla FireFox. Using the browser you can go to your network device's IP address, left click on the streaming image and select Copy Image Location.

    You can download a free version of FireFox at www.mozilla.org.
  • Options
    viningvining Posts: 4,368
    Thx Jeff and I get all that but these cameras don't require a path or filename just the straight http/IP:8008. If I type that into FireFox I get the stream and nothing but the stream. My probelm is that AMX dynamic image requires a path/filename, well at least a file name in order to satisfy the entry form. I was just hoping that the might be some sort of escape character or something that I can put into the filename slot to satisfy the need for a filename but isn't used to pull the stream.

    If there is an escape sequence that I could use, cool but if not no big deal I'll just use the cameras somewhere where TP display isn't a requirement unless I use an HAI TP but I don't see that happening any time soon (knock on wood). I did also talk with one of HAI's engineers and they simply don't have a path or filename for their video stream just IP:port and that's it. I've also check it all out in Wireshark, opening the HTML page and opening the stream and there's nothing I could see other that what they said so if there's no way around the filename requirement on the AMX side, then there's no work around.
  • Options
    a_riot42a_riot42 Posts: 1,624
    vining wrote: »
    My probelm is that AMX dynamic image requires a path/filename, well at least a file name in order to satisfy the entry form.

    I didn't realize a path was absolutely required and thought leaving it blank would have worked, but I assume you tried that and had no luck. Have you tried using a '/' or '/index.html' just to have something there? If it works in a browser with http://192.168.1.100:8080 then it should work with a panel. Does the documentation mention what the default path is? If so, maybe you can use that. Have you considered that a port is being blocked rather than a path being wrong?
    Paul
  • Options
    John NagyJohn Nagy Posts: 1,734
    Pathless

    Our test showed that you must have something in the filename parameter to get dynamic images to work. The PATH is in fact optional. You must understand that when you pass

    host path filename

    that the panel will impute a forward slash ( / ) between each item. If there is nothing in PATH, it adds only one slash between host and filename. You can't put all the url into HOST, but you can put all the path and filename in FILENAME. You can't put the filename in PATH and leave filename empty. You can split up the path into both PATH and FILENAME on some convenient / point.

    I don't know if there's a way to get your URL. You could try adding a / as the filename. It may or may not mess up the connection, but might work. It does in browsers... multiple trailing / don't stop a url from working.
  • Options
    viningvining Posts: 4,368
    Yeah I tried / and a few other ideas for a file name but no joy. That was in TPD4 using "Get Live File" so it could be that part isn't working since I can't seem to get that working for the MET-ECOMs either. Spire_Jeff eluded to the possibilty that "Get Live File" doesn't work with the MET-ECOMs (?) so maybe there's other things it doesn't work with either and this could be one. Of course up until now I've never had issues with it but maybe if I tried through the TP results would be different(?).

    Yeah, http://192.168.xxx.xxx:8008 works just fine in FireFox.
  • Options
    DHawthorneDHawthorne Posts: 4,584
    There really ought to be a firmware update that allows a blank file name. Most servers will cough up a default if it's not specified. For example, you never have to append "index.htm" to a top level URL, it just gets sent. I bet that is what is happening here. If you could guess what the default file name is, and enter that, it would probably work.
  • Options
    Joe HebertJoe Hebert Posts: 2,159
    vining wrote: »
    My probelm is that AMX dynamic image requires a path/filename, well at least a file name in order to satisfy the entry form.
    Try using any filename so you can close the dynamic image dialog box in TPD4 and then in code set the filename to blank. I don't know if that will get you any further but it might be worth a shot.
  • Options
    viningvining Posts: 4,368
    Joe Hebert wrote:
    Try using any filename so you can close the dynamic image dialog box in TPD4 and then in code set the filename to blank. I don't know if that will get you any further but it might be worth a shot.
    Even if that doesn't work it's a freakin clever idea! I'll give it a shot when I get a chance.
  • Options
    yuriyuri Posts: 861
    even though you can directly access the file, there should be referrer to the file, right?
    192.168.x.x:8008 could be anything from 192.168.x.x:8008/index.html to 192.168.x.x:8008/index.php :)

    Use something like the Firebug extensions for FireFox to figure it out.
  • Options
    viningvining Posts: 4,368
    FireBug is a pretty cool add on but nothing. I've already been through multiple session in WireShark looking for anything similar to the norm but there just ain't nothin'. In FireBug I did get img= 192.168.xxx.xxx:8008 so there really doesn't appear to be a referrer or filename that it could refer to.
  • Options
    viningvining Posts: 4,368
    Joe Hebert wrote:
    Try using any filename so you can close the dynamic image dialog box in TPD4 and then in code set the filename to blank. I don't know if that will get you any further but it might be worth a shot.
    As an update to Joe's suggestion it actually works. I wrote a quick program to run in define program so I could easily change values in the debug watch window and this time it worked. I did try it the day after Joe's post and at that time it didn't work but I think I was just being stupid since I had other code running that I forgot about that was working against me.

    Question, how do you delete a resource created through code? Is there a way to switch to Dynamo from code? Although I haven't looked that hard I didn't find an answer to either question.

    Although I tried the RAF, BMF and BBR commands the only one I really had success with was the RMF. I would also then need the RFR, PPX and then call the pop up again but I didn't really get into that to see which order and which combinations worked best. I've always found the dynamic image commands to be temperamental.

    This particular cameras doesn't allow for a user/pass to can access to the stream (stupid) but I left in the %U & %P w/o value just cuz I originally created the resource incorrectly with values.
    DEFINE_VARIABLE // CAMERA TEST VARS
    
    VOLATILE INTEGER nBtnTest = 0 ;
    VOLATILE INTEGER nCamVT_CH = 2 ;
    VOLATILE CHAR cCamPopUP[36] = 'Camera_1' ;
    VOLATILE CHAR cResourceProperties[128]    = '%P0%U%S%H192.168.1.50:8008%A%F%R1' ;
    VOLATILE CHAR cNewResourceProperties[128] = '%P0%U%S%H192.168.1.50:8008%A%F%R1' ;
    VOLATILE CHAR cNewResourceName[128] = 'Camera_New' ;
    VOLATILE CHAR cResourceName[128] = 'Camera_1' ; 
       
    DEFINE_PROGRAM //CAMERA TESTING ROUTINES
    
         {
         WAIT 10
    	  {
    	  if(nBtnTest)
    	       {
    	       LOCAL_VAR INTEGER nRFR ;//%P0%Uuser%Spassword%H192.168.1.50:8008%A %F %R1
    				       //%P0%Uuser%Spassword%H192.168.1.44%Aaxis-cgi/mjpg%Fvideo.cgi?resolution=800x600%R1
    	       SWITCH(nBtnTest)
    		    {
    		    CASE 1://change properties of exisiting resource
    			 {
    			 fnFB_DoSend_UI_CMD(1,"'^RMF-',cResourceName,',',cResourceProperties") ;
    			 }
    		    CASE 2://create new resouce
    			 {
    			 fnFB_DoSend_UI_CMD(1,"'^RAF-',cNewResourceName,',',cNewResourceProperties") ;
    			 }
    		    CASE 3://set button to use different resource
    			 {
    			 fnFB_DoSend_UI_CMD(1,"'^BMF-',itoa(nCamVT_CH),',%P',cResourceName") ;
    			 }
    		    CASE 4://set button to use different resource
    			 {
    			 fnFB_DoSend_UI_CMD(1,"'^BBR-',itoa(nCamVT_CH),',0,',cResourceName") ;
    			 }
    		    }
    	       if(nRFR)//refresh resource
    		    {
    		    fnFB_DoSend_UI_CMD(1,"'^RFR-',cResourceName") ;
    		    fnDo_Page_or_Pop(1,'@PPX') ;
    		    fnDo_Page_or_Pop(1,"'PPON-',cCamPopUP") ;
    		    }
    	       nBtnTest = 0 ;
    	       }
    	  }
         }
    
Sign In or Register to comment.