Not a JPEG file: starts with 0x35 0x39

Support and queries relating to all previous versions of ZoneMinder
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Hi Don,

I don't know if it's possible but I wonder if you could open up the camera so I could connect to it from here and see if I can diagnose it. Alternatively, and perhaps less usefully, capture a few frames of output (with wget) into a file, including headers as discussed above, and I'll go through that first.

Phil
donatmote
Posts: 31
Joined: Mon Jan 24, 2005 6:06 pm
Location: Sarasota, FL US

Post by donatmote »

Hi Phil,

Yes, you can get to the camera now. It's set up for testing in my office.
We'll be putting it behind a firewall when it goes into production.
This URL should work for you:

[url]http://phil:Xphil7@keatlobby.mote.org/cgi-bin/video.jpg[/url]

Thanks for your continued interest.

Don
Don Hayward
Mote Marine Laboratory
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Hi Don,

After about 3 hours on this I think I've sort of cracked it. There are a couple of bizarre elements to it that I don't understand though.

If I do

Code: Select all

wget -U 'User-Agent: ZoneMinder/1.20.1' -s http://phil:Xphil7@keatlobby.mote.org/cgi-bin/video.jpg
I get this

Code: Select all

HTTP/1.1 200 OK
Content-Type: image/jpeg
Date: Wed, 02 Feb 2005 23:15:32 GMT
Expires: Thu, 26 Oct 1995 00:00:01 GMT

Last-Modified: Wed, 02 Feb 2005 23:15:32 GMT
Pragma: no-cache
Server: Vivotek MiniAVServer

ÿØÿÀ^@^Q^H^@ð^A`^C^@"^@^A^Q^A^B^Q^AÿÛ^@~D^@^P^K^L^N^L
but if I do

Code: Select all

 telnet keatlobby.mote.org http
Connected to keatlobby.mote.org (12.174.210.12).
Escape character is '^]'.
GET /cgi-bin/video.jpg HTTP/1.1
User-Agent: ZoneMinder/1.20.1
Host: keatlobby.mote.org
Connection: Close
Authorization: Basic cGhpbDpYcGhpbDc=
I get this!

Code: Select all

HTTP/1.1 200 OK
Content-Type: image/jpeg
Date: Wed, 02 Feb 2005 23:16:50 GMT
Cache-Control: no-cache
Expires: Thu, 26 Oct 1995 00:00:01 GMT
Transfer-Encoding: chunked
Connection: close

59e
ð`"
           

which looks completely different and includes a spurious 59e in there which is causing all the trouble. The headers also don't include the server field but do include a Transfer-Encoding field. Essentially I think this is what is causing the problem, as ZM does not support chunked encoding. Never having seen it before I don't even really know what it is. Luckily setting the http version to 1.0 instead of 1.1 (Options->Network) gives this response instread

Code: Select all

HTTP/1.1 200 OK
Content-Type: image/jpeg
Date: Wed, 02 Feb 2005 23:28:32 GMT
Expires: Thu, 26 Oct 1995 00:00:01 GMT
Last-Modified: Wed, 02 Feb 2005 23:28:32 GMT
Pragma: no-cache
Server: Vivotek MiniAVServer
ð`"
which doesn't have the spurious characters. So I guess wget uses http 1.0 which results in entirely different headers. The long term solution is for ZM to support chunked encoding, provided I can find a server to test against, but the short term solution for now if just for you to switch to http 1.0 which should work. It works for me at least.

Phil
donatmote
Posts: 31
Joined: Mon Jan 24, 2005 6:06 pm
Location: Sarasota, FL US

Post by donatmote »

Phil,

Yes! I set the web option to http 1.0 and I'm getting pictures.
Thanks so much!

Don
Don Hayward
Mote Marine Laboratory
Locked