Empty input file on 1.19.0

Support and queries relating to all previous versions of ZoneMinder
cybr0t
Posts: 26
Joined: Fri Mar 19, 2004 8:38 am

Re: Empty input file on 1.19.0

Post by cybr0t »

zmc is also segfaulting for me now as well

Although occasionally, I get the following:

Correupt JPEG data: premature end of data segment
Invalid JPG file structure: two SOI markers
'zmc -m 1' crached at 04/03/19 10:47:46, exit status 1
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Re: Empty input file on 1.19.0

Post by zoneminder »

I don't think it's anything to do with ZM_FRAME_SOCKET_SIZE, a value of zero just means it will use the default setting.

Can you check what's at line 181 of zm_remote_camera.cpp, mine is an FD_SET line which is a little odd. I did do two drops of 1.19.1, it might be worth checking you have the later one.

A couple of things we can do to get to the bottom of this, add the line

zm_dbg_level = 9

into zmc.cpp underneath the line that starts zm_dbg_name =, then check the debug output which might be helpful to me. The other alternative is for me to get my mitts on a camera. There is so much variation between what they send, in terms of which headers are present, whether they terminate lines with LF or CRLF (or a mixture of the two), whether images terminates with one or two CRs (or CRLF pairs), whether image boundaries are prefixed with '--' and so on and so on. The debug might be a start though.

Phil,
User avatar
tech_fixer
Posts: 132
Joined: Tue Jul 29, 2003 3:07 pm

Re: Empty input file on 1.19.0

Post by tech_fixer »

Phil,
I am behind a corporate firewall, so I cant expose a camera to you... the admin would have my head.

Still, heres an internet address with a camera same as mine:
http://m-cam.uchicago.edu/view/view.shtml

Jose.
cybr0t
Posts: 26
Joined: Fri Mar 19, 2004 8:38 am

Re: Empty input file on 1.19.0

Post by cybr0t »

Jose, what version firmware are you running on the Axis cams? (purely out of curiousity)

The latest firmware is 2.40, but I'm running 2.31 (only notable thing in release notes is "Performance increased to up to 15 fps"

-- Cy
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Re: Empty input file on 1.19.0

Post by zoneminder »

Jose,

This doesn't seem to be the same camera as you have, it seems to reference /cgi-bin/hugesize.jpg rather than /axis-cgi etc etc as your does. Or do both cameras have both paths on? I can't get tge path you gave to work on that, or the paths used on my Axis either! Do you know what the other paths for this camera are?

Phil,
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Re: Empty input file on 1.19.0

Post by zoneminder »

Oh, I meant to ask, which _exact_ model of camera do you have. I was going to try and google for some that were left public.

Phil,
cybr0t
Posts: 26
Joined: Fri Mar 19, 2004 8:38 am

Re: Empty input file on 1.19.0

Post by cybr0t »

Axis 2100 firmware version 2.31
cybr0t
Posts: 26
Joined: Fri Mar 19, 2004 8:38 am

Re: Empty input file on 1.19.0

Post by cybr0t »

Made the change to zmc.cpp and recomiled, here's a dump of what I'm getting now:

Mar 19 13:03:33 bdc zmc: DB1 [Initialising Debug]
Mar 19 13:03:33 bdc zmc-m1[15505]: INF [Debug Level = 9, Debug Log = ]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB1 [Got 1 monitors]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB2 [Request: GET /axis-cgi/jpg/image.cgi?res
olution=320x240 HTTP/1.1 User-Agent: /1.19.1 Host: netcam1.voicefx.com Connectio
n: Keep-Alive ]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB1 [monitor purpose=1]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB1 [shm.size=448]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB1 [Initialised zone 0/All - 1 - 0x0 - Rgb:f
f0000, CM:3, MnAT:15, MxAT:0, MnAP:50, MxAP:75000, FB:3x3, MnFP:50, MxFP:50000,
MnBS:10, MxBS:0, MnB:0, MxB:0]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB1 [Monitor Netcam1 has function 2]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB1 [Monitor Netcam1 LBF = '%%s - %y/%m/%d %H
:%M:%S', LBX = 0, LBY = 0]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB1 [Monitor Netcam1 IBC = 100, WUC = 25, pEC
= 10, PEC = 10, FRI = 1000, RBP = 10]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB1 [Got 1 zones for monitor Netcam1]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB1 [Initialised zone 1/All - 1 - 42949672x42
949672 - Rgb:ff0000, CM:3, MnAT:25, MxAT:0, MnAP:5634997, MxAP:12025909, FB:3x3,
MnFP:5634997, MxFP:12025909, MnBS:18073222, MxBS:0, MnB:1, MxB:0]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB1 [Loaded monitor 1(Netcam1), 1 zones]
Mar 19 13:03:33 bdc zmc-m1[15505]: INF [Starting Capture]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB3 [Connected to host, socket = 6]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB3 [Request sent]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB3 [Expecting 45 bytes]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB3 [Read 45 bytes]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB4 [Captured header (45 bytes): 'HTTP/1.0 20
0 OK^M Content-Type: image/jpeg^M ^M ']
Mar 19 13:03:33 bdc zmc-m1[15505]: DB3 [Got status '200' (OK), http version 1.0]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB3 [Got content type 'image/jpeg' ]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB3 [Expecting 1460 bytes]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB3 [Read 1460 bytes]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB3 [Expecting 1460 bytes]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB3 [Read 1460 bytes]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB3 [Expecting 1460 bytes]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB3 [Read 1460 bytes]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB3 [Expecting 1460 bytes]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB3 [Read 1460 bytes]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB3 [Expecting 1460 bytes]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB3 [Read 1460 bytes]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB3 [Expecting 1460 bytes]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB3 [Read 1460 bytes]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB3 [Expecting 2177 bytes]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB3 [Read 2177 bytes]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB3 [Expecting 0 bytes]
Mar 19 13:03:33 bdc zmc-m1[15505]: DB3 [Socket closed]


Hope this helps

-- Cy
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Re: Empty input file on 1.19.0

Post by zoneminder »

Thanks, that's interesting. When you do a wget to your image url, can you tell me if the image itself is terminated by a CR, CRLF, 2 CRs, 2CRLFS, or nothing at all? So far I've see all of the above apart from the last one, which I suspect is what is used in your case.

Phil,
cybr0t
Posts: 26
Joined: Fri Mar 19, 2004 8:38 am

Re: Empty input file on 1.19.0

Post by cybr0t »

Not 100% sure how I would tell so I apologize is this is not what you want..

Last couple lines of downloaded image via "wget http://<host>/axis-cgi/jpg/image.cgi?resolution=320x240"

--
<90><CF><8C>^Q<EC>i<80><C9>f.<DB>A<<F5>5ESCH^T`t<A4>^C^K<93>I<93>@^A<A6><9E><B4>
^@^QH<9D>^M^@^]<CD>.h^@<CF><D2><8A>^@F<E9>V<ED>%>X^Y<E4>P^C^_ESC<8A><8E><82><B4>
l<A5>^O^@^Ns<B7><83>@^M}Qam<B6><E8><AC>^?<BD>Q<CB>{<<80>y<8F><D7><B0><E0>S^B&
<9B>^G^C<AD>V33<9E>M^L^EC<F3><F5><A5>s<CD>^@1<8F><CC>)^\c^^<F4><80>m5<8F>^T^A
<FF><D9>
--

If there's some other way to find out, please let me know and I'll do it

-- Cy
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Re: Empty input file on 1.19.0

Post by zoneminder »

Thanks, I've managed to find an open camera so have tested it myself. I can confirm that the stills image is not terminated by anything, which is a slight PITA to say the least as there's no way to see if it's finished other than trying another unnecessary read on the socket and sort of breaks the paradigm I'm using.

The good news is that using the motion JPEG path, /axis-cgi/mjpg/video.cgi?resolution=320x240, works fine. All frames terminated in a semi-consistent way. Plus it's a faster frame rate. If you want to try it, can you let me know if it works ok for you.

Cheers,

Phil,
cybr0t
Posts: 26
Joined: Fri Mar 19, 2004 8:38 am

Re: Empty input file on 1.19.0

Post by cybr0t »

Hrmm.. well the daemon's not segfaulting now, however:

/var/log/messages:
Mar 19 13:41:30 bdc zmc-m3[17472]: DB3 [Expecting 65807 bytes]
Mar 19 13:41:30 bdc zmc-m3[17472]: DB3 [Read 8192 bytes]
Mar 19 13:41:31 bdc last message repeated 7 times
Mar 19 13:41:31 bdc zmc-m3[17472]: DB3 [Read 271 bytes]
Mar 19 13:41:31 bdc zmc-m3[17472]: DB3 [Unable to extract subheader from stream, retrying]

You said this worked fine for?
cybr0t
Posts: 26
Joined: Fri Mar 19, 2004 8:38 am

Re: Empty input file on 1.19.0

Post by cybr0t »

er, worked fine for you rather.

-- Cy
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Re: Empty input file on 1.19.0

Post by zoneminder »

Yep, worked fine here. I don't see any errors in your output either, the 'unable to extract' message is only because it can't get the next subheader in the block it read last, so it tries again. Like I said, it's just debug anyway.

Can you see images?

Phil,
cybr0t
Posts: 26
Joined: Fri Mar 19, 2004 8:38 am

Re: Empty input file on 1.19.0

Post by cybr0t »

Can't see any images, looks as if it just keeps on reading the stream, but I noticed when I first start up zm I get an error in zmdc.log:

'zmc -m 3' starting at etc. etc.
Not a JPEG file: starts with 0x48 0x54

which I believe is "H" and "T".. (presumably followed by "M" and "L"?)


(BTW, thanks for all the great help, I really appreciate this)
-- Cy
Locked