Home AMX Technical Discussion

Stream video from analog cam to AMX touch panel, be it a 8400 or a DXT-1000

I successfully was streaming my cams to any of my touch panels for 10 years, using a  IP Video 9100A Plus Network Video Server, but it stopped working.
So I just bought a AVIGILON 4-Port H.264 Analog Video Encode.

Now I outpiut my BNC outputput from DVR (not an NVR) to the input BNC on this new unit.

So it has a webpage and I can see my cams when I enter 192.168.1.131 and I can setup the stream.
So there are 4 BNC's ports and I will only use port 1 and setup the format as JPEG, as opposed to H.264.

Now since the video is streaming properly I need to set up in TP4 in Resource Manager, in which I do not know how to do.

For the old 9100A unit - I did the following and it worked:
1) I setup a Dynamic Image:

 Name cam5 
 Host: 192.168.1.72
 Path:
 File: GetData.cgi

2) Then in NetLinx -- my code had this:
slCONNECT_STATUS = IP_CLIENT_OPEN(dvIPCams.PORT,'192.168.1.131',80,TCP_IP);
then this:
cVideoStr = "'GET /SetChannel.cgi?Channel=1 HTTP/1.0',13,10,13,10";//third is the 4th slot on unit next to DVR
then:
send_string dvIPCams,cVideoStr;

 then to setup image on panel:
            holdPic = "'^BMF-502,1,%JB0,80,10,%Pcam5'";
           send_command dTP_CAMERAS[holdPanel], holdPic; 

All the above syntax would show any of the 8 cams on the AMX touchpanel.
Now since I bought a new encoder this syntax doesnt work and was wondering what I need to do syntactically to get the new unit to display my cams to touchpanel.

Comments

  • johnbonz1johnbonz1 Posts: 41

    well thanks for the links, but I dont think it really matters what the encoder is. The whole thing is what syntax to send to AMX so it recognizes it. so once I open port:
    slCONNECT_STATUS = IP_CLIENT_OPEN(dvIPCams.PORT,'192.168.1.131',80,TCP_IP);
    then the key is how to stream the video. as I stated above the Get /SetChannel is the syntax I used when I had the 9100A encoder.

              cVideoStr = "'GET /SetChannel.cgi?Channel=1 HTTP/1.0',13,10,13,10";
    

    so for the new encoder I have now AVIGILON 4-Port H.264 Analog Video Encode., I must do somehting similar, I dont know by issuing a SetChannel or something. I was hoping someone uses an encoder and can share what they did to get stream working

  • This GET command may select the input that the stream server should use to create the mjpeg image the panel's resource get loaded by http://192.168.1.72/getData.cgi

    By the datasheet, the AVIGILON can do MJPEG, so must be provided by http or https with the path to the image the server creates and updates. I haven't found any documentation for that encoder, so question is how to configure the AVIGILON to provide mjpeg of the inputs.

    I only used Axis in the past (loooong ago....)... and there it never was necessary to change the input used on the server. A single input/stream server had only one mjpeg url (with additional parameters for the resolution of the image). And I remember that there was also a model with 4 inputs, but this unit provided all 4 inputs as individual mjpeg urls all the time, so 4 individual mjpeg images were available, and if want to change between them we either changed the url parameters of the dynamic resource used for the view in the panel, or had 4 resources defined in the panel design, that we on demand assigned to the video button by command.
    https://adn.harmanpro.com/site_elements/resources/15084_1535551880/TPDesign4v3.3.InstructionManual_original.pdf page 47ff.

    It may be also possible to use a "real" stream of the inputs, like the first link i posted shows for rtsp. But this is a permanent active stream the panels have to load, which is not the best for a MVP wireless panel. Furthermore, the G4 and G5 Moderos can't show rtsp, so the stream may have to be provided as udp.
    Real streams are not provided in the panel as dynamic resource, but the stream url has to be provided to a video button set for "streaming URL", and the either hardcoded into the URL field of that button or provided by send_commands dynamically
    As an example, see this AMX KnowledgeBase entry: https://help.harmanpro.com/stream-svsi-h-264-video-to-g4-and-g5-panels-(3)

  • johnbonz1johnbonz1 Posts: 41

    ok in the Avigilon page where I setup the settings

    note the highlighted red boxes, the first BNC(Port 1) I have format det to JPEG, the at bottom RTSP Port 1 is set to Multicast, then in the Dynamic Images section of the TP4, I have this

    I think the key here is that the Dynmaic Images section has to point to the proper settings in Avigilon encoder. Now myold encoder (100A this GetDat.cgi worked but for some reason using the Avigilon it doesnt. Also attached the Live view of the Avigilon encoder shows my camera

    when I click the cam and choose image address:
    http://192.168.1.131/media/cam0/still.jpg?1756310555052

    somehow this address needs to be incorporated in the Dynamic Images and so when I do this in Netlinx

    slCONNECT_STATUS = IP_CLIENT_OPEN(dvIPCams.PORT,'192.168.1.131',80,TCP_IP);

    cVideoStr = "'GET /SetChannel.cgi?Channel=1 HTTP/1.0',13,10,13,10";

    it will work

  • Found another support article that confirms the path: http://admin:admin@192.168.1.100/media/cam0/still.jpg

    So I would say, your Dynamic Image might be set:
    name: cam5
    protocol: http
    host: 192.168.1.131
    path: media/cam0
    file: still.jpg

    Maybe it could also be
    path: media/cam0/still.jpg
    without file specified, as there are no additional parameters required for the jpg link.

    And if required by the server settings: User and Password

    Opening/selecting the input by a GET command should not be required, as the 4 inputs are selected by the cam number in the path

  • johnbonz1johnbonz1 Posts: 41

    ok here is what I did:
    entering the ip address of http://192.168.1.131/web/live.shtml I get this:

    this pic is streaming as the seconds tick off
    Then from the Dynamic Images section of TP4 I choose cam 5 and enter the info from pic

    then when I close dialog box and then double click on cam 5 I see this:

    but it is a JPG

    so this shuld be very simple but it still doesnt work. I should probbaly just do this in code:

      slCONNECT_STATUS   =   IP_CLIENT_OPEN(dvIPCams.PORT,'192.168.1.131/web/live.shtml',80,TCP_IP);
    

    and bypass the dynamic images as if I just open IP address of http://192.168.1.131/web/live.shtml
    yu wold think it would just work. but there is something I am missing

  • the http://192.168.1.131/web/live.shtml is just the webpage the image is embedded, it is not referring to the image itself.
    When you right-click to the cam image, can you get a path to the image itself?

    If you open in browser http://192.168.1.131/media/cam0/still.jpg directly, would you get the image itself?
    If yes, is it updating the timestamp by itself, or have you to manually reload (and so update) the image again?
    If manual update is required, in the Dynamic Image Settings, you may have to set a refresh rate.

  • johnbonz1johnbonz1 Posts: 41

    when I right clic on the image the path is http://192.168.1.131/media/cam0/still.jpg
    in dynamic Image Setting I did set refresh rate to 1 see

    so in netflix code I have the following to display image to touch panel

       slCONNECT_STATUS   =   IP_CLIENT_OPEN(dvIPCams.PORT,'192.168.1.131',80,TCP_IP);
    
        cVideoStr=GET /SetChannel.cgi?Channel=1 HTTP/1.0$0D$0A$0D$0A
        send_string dvIPCams,cVideoStr;  
    

    then to access cam5 from dynamic mages:
    send_command dTP_CAMERAS[holdPanel], holdPic; holdPic = "'^BMF-500,1,%JB0,180,100,%Pcam5'"

    still not working

  • Then my only last idea is to set the link completely to the path field:
    media/cam0/still.jpg

    And let the file field empty.

    Otherwise I'm out of more ideas, sorry.

  • johnbonz1johnbonz1 Posts: 41

    U cant have file field empty.
    the issue could be that my encoder is not comaptible with AMX.
    I wonder if therer is another way to stream video from an encoder into AMX TP4 or Netlinx and if anyone in the past has used different encoders to get streaming to work, that is why I posted this hoping someone got streaming to work using a different encoder

  • John NagyJohn Nagy Posts: 1,753

    We've used GRANDSTREAM encoders in the past, very similar to the A9100 in protocols. It's been a while, not sure what models... worth a look.

  • John NagyJohn Nagy Posts: 1,753

    This one. I see they are available some places. Google search. If you find one, I can share the calls to show video. Better video than the 9100a but not wonderful.
    https://www.amazon.com/Grandstream-GS-GXV3500-Video-Encoder-Decoder/dp/B006307P6S/ref=cm_cr_pr_product_top?ie=UTF8

  • johnbonz1johnbonz1 Posts: 41
    edited August 29

    I just ordered anoter 9100A as since I cannt get the AVIGILON to work might as well goto one encoder I know works.
    What if I had a NVR which are IP cams, how would I set up dynamic Images, just put IP address of each cam that is IP in the Dynamic Images? Would I need to setChaneel in the netflix code?
    cVideoStr = "'GET /SetChannel.cgi?Channel=1 HTTP/1.0',13,10,13,10";
    send_string dvIPCams,cVideoStr;

    below is a sample if I were to set up 2 IP cams.


  • so by trying to communicate with the AVIGILON encoder
    I sent this:
    -- cVideoStr = "'GET / HTTP/1.1',13,10,13,10";
    SEND_STRING dvIPCams,cVideoStr;
    SEND_STRING dvIPCams, "'Host: 192.168.1.131'"; //IP address of the Avigilon encoder

    --- this is 4 bit conversion of admin:admin which is the userid and password of the Avigilon encoder
    UsernamePasswordBase64[100] = 'YWRtaW46Ym9uenBhc3M=';
    SEND_STRING dvIPCams, "'Authorization: Basic '" + UsernamePasswordBase64;


    and recieved this:

    strVideoBuff = HTTP/1.1 401 Unauthorized$0D$0AServer: AvigilonOnvifNvt/2.2.0.82$0D$0AWWW-Authenticate: Digest realm="Avigilon-112008310210"

    It seems that I am getting an authentication error. whats that mean? I sent user/password (see above) .

    I think this will work getting the cameras on the AMX panel using Avigilon encoder but it just a matter of sending the proper syntax to the encoder. anyone have any suggestions on what commands to send to encoder?

  • That's btw no NetLinx Syntax....
    SEND_STRING dvIPCams, "'Authorization: Basic '" + UsernamePasswordBase64;

    Find attached an archive with a sample program and an axi to Base64 encode.
    First send the Authorization, and if it is confirmed, send your GET for control.

  • As I parse thru the return I noticed that it is trying to authenticate( I think) but returns Unauthorized

    strVideoBuff = HTTP/1.1 401 Unauthorized**$0D$0AServer: AvigilonOnvifNvt/2.2.0.82$0D$0AWWW-Authenticate: Digest realm="Avigilon-112008310210"

    So I contacted the AVIGILON tech support guy and he said this:
    The 401 Unauthorized response indicates the Avigilon encoder rejected the request because it didn’t include valid authentication.
    Since you see WWW-Authenticate: Digest, the encoder expects HTTP Digest Authentication (not plain/basic authentication).
    It can’t just append user:password in the URL string (like http://user:pass@ip/...) this device requires Digest Auth, and AMX is sending Basic Auth.
    For Digest Auth, (your AMX program) must:

    1. Send an initial request.
    2. Receive the 401 Unauthorized with the WWW-Authenticate header (this includes the realm, nonce, and algorithm).
    3. Respond with the same request but add an Authorization header containing a hash of the username, password, realm, nonce, and request details.
      To fix it, your AMX code must support Digest Authentication and include the proper Authorization header when talking to the Avigilon encoder

    So I asked for an example using DIGEST instead of BASIC during authentication and he sent me this:
    HTTP/1.1 401 Unauthorized
    Server: AvigilonOnvifNvt/2.2.0.82
    WWW-Authenticate: Digest realm="Avigilon-112008310210"

    I contructed my SEND command

    So I did send the Digest instead of the Basic.

    still got Unauthorized error ( I am assuming the nonce is the password to the encoder)

                        cVideoStr = "'GET ',sUrl,' HTTP/1.0',13,10,'Authorization: Digest username=admin,realm=Avigilon-112008310210'";
                        cVideoStr = "cVideoStr,',nonce=admin,uri=/onvif/device_service, response=hashed-value, algorithm=MD5' ";
    

    SEND_STRING dvIPCams,cVideoStr;

    and suggestions on how to format send command?

  • I don't have a sample for Digest authentication, sorry. I have an Include that can do the MD5, but this include has a note that it only works correctly up to 119 bytes...

    If it would be my installation, and there would be no other way to access the new video encoder, I may grab an RaspberryPI, let run Nodered on it, and would use it as an interface/gateway, doing the communication to the video encoder with the authentication, and an IP server from within Nodered I can send in and out clear text messages to/from NX.....

  • Do you have a sample of code for AXIS encoders?

Sign In or Register to comment.