B4J Question B4J MJPEG DECODER

Discussion in 'B4J Questions' started by micro, Aug 7, 2019.

  1. micro

    micro Well-Known Member Licensed User

    From B4A forum
    https://www.b4x.com/android/forum/threads/mjpeg-decoder-example.101957/#content

    Hi Erel
    i have the same problem and also with your suggestion not work

    If i put into browser or with vlc this link, all work well:
    With vlc:
    Code:
    http://root:admin@192.168.1.24/axis-cgi/jpg/image.cgi?resolution=1024x768
    Into browser also without user and password :
    Code:
    http://192.168.1.24/axis-cgi/jpg/image.cgi?resolution=1024x768
    I also used the advice of tchart setting the user and password in Base64 but the problem remains

    This is the debug answer (with your and tchart suggestion)

    Code:
    Waiting for debugger to connect...
    Program started.
    HTTP/
    1.1 401 Unauthorized
    Date: Mon, 
    16 Oct 2023 22:07:43 GMT
    Server: Apache/2.4.27 (Unix) OpenSSL/1.0.2k
    WWW-Authenticate: Digest realm=
    "AXIS_ACCC8EC78757", nonce="78yootwHBgA=3b997f87ad98f387e14bdfb97106b92f10d97478", algorithm=MD5, qop="auth"
    Content-Length: 
    381
    Keep-Alive: timeout=
    5max=100
    Connection: Keep-Alive
    Content-
    Type: text/html; charset=iso-8859-1
    <!DOCTYPE HTML 
    PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>
    401 Unauthorized</title>
    </head><body>
    <h1>Unauthorized</h1>
    <p>This 
    server could not verify that you
    are authorized 
    to access the document
    requested.  Either you supplied the wrong
    credentials (e.g., bad password), 
    or your
    browser doesn
    't understand how to supply
    the credentials required.</p>
    </body></html>
    Terminated
    ....always unauthorized.

    what I ask is whyI have to use the safe mode if in the browser it also works with http?

    is there a simple way to use HTTJOB and download mode? (so much is just a screenshot i need)

    Thank's
     
  2. DonManfred

    DonManfred Expert Licensed User

    You need to authenticate the request using a Digest Authorisation.
    Search the forum; i´m pretty sure i did read something about in the past.

    Do you have a link to the camera documentation? It may reveal more infos about the Authentification.
     
    Last edited: Aug 7, 2019
    Erel likes this.
  3. Erel

    Erel Administrator Staff Member Licensed User

    That suggestion is not related to this error. As DonManfred wrote your camera expects the client to support the digest authentication method. This is not implemented in MJPEG decoder class which acts as a primitive http client.

    You can read about this method here: https://en.wikipedia.org/wiki/Digest_access_authentication
    It shouldn't be too difficult to implement it.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice