Extracting other data from an mjpeg stream via http

I’m getting an mjpeg stream via http and viewing it using the <img> tag. Pretty standard and no problem there, everything is streaming correctly.

However, along with the encoded jpg data there’s a UTC timestamp in the http response that I’d like to access. Basically, I’d like to be able to display the matching time with each frame. Here’s the response I’m working with for each frame that comes through:

  • No element found FF - Error visible in firebug
  • Why HTTP keep alive switched off by default in Node.js?
  • Firefox exception 'JavaScript component does not have a method named: “available”'
  • Avoid form redirection on 204 response in ios browsers
  • Node.js : Know when all http requests are finished
  • cancelling $http request angularjs
  • Content-Type: image/jpeg
    Content-Length: 60189
    Time-Stamp: 51961243969
    UTC-Time: 1349439599864
    Flags: 2097153
    PlayID: 1
    Camera-Type: Halocam IP
    Connection: Close
    
    [encoded jpg data]
    --myboundary
    

    Currently the <img> tag is taking that stream and interpreting the jpgs directly. Is there anyway to intercept, interpret or separate the UTC-Time value via javascript so I could display it on the page? I don’t control the http response, but if a solution were available via some change there, I could talk to the person who does control it.

  • How can I make the browser see CSS and Javascript changes?
  • No element found FF - Error visible in firebug
  • CORS GET with custom headers: is it possible to get rid of OPTIONS
  • In Node.js / Express, how do I “download” a page and gets its HTML?
  • Download one file, with pieces stored on more than one server (HTTP)
  • Get current page http status from javascript
  • 2 Solutions collect form web for “Extracting other data from an mjpeg stream via http”

    use XMLHttpRequest, then extract all of its response headers

    example with jquery:

    $.ajax({url:'a.jpg', 
            complete: function(r){
                  console.log(r.getAllResponseHeaders());
            }
    })