Page 1 of 1

Can I use a jpeg input missing content-type in the http reply?

Posted: Sun Nov 08, 2015 6:30 pm
by marcmerlin
One of my cameras has a special backdoor URL that returns a jpeg, but is missing the Content-Type: image/jpeg header in the reply.
I can view the jpeg in a browser which figures out it's a jpeg, but zoneminder complains about the empty content-type (and I can't blame it, it is missing). Is there any workaround outside of fixing the camera firmware which I don't have access to?

----------------------------------------------------------------------------
GET /mjpeg/snap.cgi?chn=1 HTTP/1.0
User-Agent: ZoneMinder/1.28.1
Host: 192.168.205.181
Connection: Keep-Alive
Authorization: Digest username="pict", realm="IPCamera Login",
nonce="8dbdb168c6c557a2437bec3daa465eac", uri="/mjpeg/snap.cgi?chn=1", qop=auth, nc=00000001,
cnonce=0a4f113b, response="d0aaaa79d0e9e1a2e4984fcf1f982a22"

HTTP/1.0 200 OK
Cache-Control: public,max-age=0
Content-Length: 13823
Connection: close
Date: Sat, 07 Nov 2015 04:31:22 GMT
Server: lighttpd/1.4.35

......JFIF.............C..............
(B+(%%(Q:=0B`Ued_U][jx..jq.s[].........g.............C....(#(N++N.n]n..................................
......................h...."......................................
.....................}........!1A..Qa."q.2....#B...R..$3br..
.....%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwx
----------------------------------------------------------------------------

I suppose I could wget the jpeg from the command line, dump to a flie, and have zoneminder read that instead, but that seems kind of ugly and there will be no synchronization :-/

The camera does offer RTSP, but I'd rather avoid using that to limit load on my overloaded server.

Re: Can I use a jpeg input missing content-type in the http reply?

Posted: Mon Nov 09, 2015 2:00 pm
by knight-of-ni
There might be a workaround.

Can you provide the following?
- Make/model of camera
- What is your monitor config?
- Have you tried any URL's other than /mjpeg/snap.cgi?
- What exactly does zoneminder show in the logs when you try to view the snapshot stream? It should tell us exactly where in the code it is stopping.

Re: Can I use a jpeg input missing content-type in the http reply?

Posted: Sat Nov 14, 2015 6:01 am
by marcmerlin
Sorry for the late reply. I was getting something like ERR [Unrecognised content type ''"]

Cam: Wansview NCM625GA I have it working with RTSP:
http://marc.merlins.org/perso/linuxha/p ... l#NCM625GA

I have found no other URLs than snap.cgi to get jpegs.