Empty input file on 1.19.0

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:

Re: Empty input file on 1.19.0

Post by zoneminder »

This looks ok.

I'm curious about why the stills version doesn't work as it doesn't look for anything now, just waits until the end of the feed. Can you compile a debugged zmc (look for zm_dbg_level above in this thread) and then run it against the image.cgi path. Then post or mail the debug in the messages file.

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 »

Actually

<i>Limits : 0,0 - 42949671,42949671
Alarm RGB : ff0000
Check Method: 3 - Blobs
Min Pixel Threshold : 25
Max Pixel Threshold : 0
Min Alarm Pixels : 5634997
Max Alarm Pixels : 12025909
Filter Box : 3,3
Min Filter Pixels : 5634997
Max Filter Pixels : 12025909
Min Blob Pixels : 18073222</i>

Looks a bit dodgy but shouldn't affect capture. It may be worth either deleting and recreating the zone or the whole monitor.
cybr0t
Posts: 26
Joined: Fri Mar 19, 2004 8:38 am

Re: Empty input file on 1.19.0

Post by cybr0t »

Stills capture look like they're working:

Mar 23 10:29:19 bdc zmc-m2[12432]: INF [Debug Level = 9, Debug Log = ]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB1 [Got 1 monitors]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB2 [Request: GET /axis-cgi/jpg/image.cgi?resolution=320x240 HTTP/1.1 User-Agent: ZoneMinder/1.19.1 Host: netcam Connection: Keep-Alive ]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB1 [monitor purpose=1]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB1 [shm.size=23040448]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB1 [Initialised zone 0/All - 1 - 320x240 - Rgb:ff0000, 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 23 10:29:19 bdc zmc-m2[12432]: DB1 [Monitor New has function 2]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB1 [Monitor New LBF = '%%s - %y/%m/%d %H:%M:%S', LBX = 0, LBY = 0]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB1 [Monitor New IBC = 100, WUC = 25, pEC = 10, PEC = 10, FRI = 1000, RBP = 10]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB1 [Got 1 zones for monitor New]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB1 [Initialised zone 2/All - 1 - 320x240 - Rgb:ff0000, CM:3, MnAT:25, MxAT:0, MnAP:2304, MxAP:57600, FB:3x3, MnFP:2304, MxFP:57600, MnBS:1536, MxBS:0, MnB:1, MxB:0]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB1 [Loaded monitor 2(New), 1 zones]
Mar 23 10:29:19 bdc zmc-m2[12432]: INF [Starting Capture]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB3 [Connected to host, socket = 5]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB3 [Request sent]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB3 [Expecting 45 bytes]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB3 [Read 45 bytes]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB4 [Captured header (45 bytes): 'HTTP/1.0 200 OK^M Content-Type: image/jpeg^M ^M ']
Mar 23 10:29:19 bdc zmc-m2[12432]: DB3 [Got status '200' (OK), http version 1.0]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB3 [Got content type 'image/jpeg' ]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB3 [Expecting 1460 bytes]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB3 [Read 1460 bytes]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB3 [Expecting 1460 bytes]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB3 [Read 1460 bytes]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB3 [Expecting 1460 bytes]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB3 [Read 1460 bytes]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB3 [Expecting 1460 bytes]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB3 [Read 1460 bytes]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB3 [Expecting 1460 bytes]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB3 [Read 1460 bytes]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB3 [Expecting 703 bytes]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB3 [Read 703 bytes]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB3 [Expecting 0 bytes]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB3 [Socket closed]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB3 [Got end of image by closure, content-length = 8003]
Mar 23 10:29:19 bdc zmc-m2[12432]: DB3 [Returning 8003 (8003) bytes of captured content]

However, when running from cli I get:

[root@bdc root]# zmc -m 2
Corrupt JPEG data: premature end of data segment
Invalid JPEG file structure: two SOI markers

Which I believe is the same error I've been getting all along with stills

Streams seem a little better however...

Mar 23 10:35:17 bdc zmc: DB1 [Initialising Debug]
Mar 23 10:35:17 bdc zmc-m2[12810]: INF [Debug Level = 9, Debug Log = ]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB1 [Got 1 monitors]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB2 [Request: GET /axis-cgi/mjpg/video.cgi?resolution=320x240 HTTP/1.1 User-Agent: ZoneMinder/1.19.1 Host: netcam.voicefx.com Connection: Keep-Alive ]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB1 [monitor purpose=1]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB1 [shm.size=23040448]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB1 [Initialised zone 0/All - 1 - 320x240 - Rgb:ff0000, 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 23 10:35:17 bdc zmc-m2[12810]: DB1 [Monitor New has function 2]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB1 [Monitor New LBF = '%%s - %y/%m/%d %H:%M:%S', LBX = 0, LBY = 0]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB1 [Monitor New IBC = 100, WUC = 25, pEC = 10, PEC = 10, FRI = 1000, RBP = 10]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB1 [Got 1 zones for monitor New]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB1 [Initialised zone 2/All - 1 - 320x240 - Rgb:ff0000, CM:3, MnAT:25, MxAT:0, MnAP:2304, MxAP:57600, FB:3x3, MnFP:2304, MxFP:57600, MnBS:1536, MxBS:0, MnB:1, MxB:0]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB1 [Loaded monitor 2(New), 1 zones]
Mar 23 10:35:17 bdc zmc-m2[12810]: INF [Starting Capture]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Connected to host, socket = 5]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Request sent]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Expecting 94 bytes]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Read 94 bytes]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB4 [Captured header (80 bytes): 'HTTP/1.0 200 OK^M Content-Type: multipart/x-mixed-replace;boundary=myboundary^M ^M ']
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Got status '200' (OK), http version 1.0]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Got content type 'multipart/x-mixed-replace' ]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Got content boundary 'myboundary']
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Unable to extract subheader from stream, retrying]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Expecting 1460 bytes]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Read 1460 bytes]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB4 [Captured subheader (42 bytes):'--myboundary^M Content-Type: image/jpeg^M ^M ']
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Got subcontent type 'image/jpeg']
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Expecting 1460 bytes]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Read 1460 bytes]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Expecting 1460 bytes]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Read 1460 bytes]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Expecting 1460 bytes]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Read 1460 bytes]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Expecting 1460 bytes]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Read 1460 bytes]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Expecting 751 bytes]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Read 751 bytes]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Got end of image by pattern, content-length = 8005]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Returning 8005 (8023) bytes of captured content]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Unable to extract subheader from stream, retrying]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Expecting 1460 bytes]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Read 1460 bytes]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB4 [Captured subheader (46 bytes):'^M ^M --myboundary^M Content-Type: image/jpeg^M ^M ']
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Got subcontent type 'image/jpeg']
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Expecting 1460 bytes]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Read 1460 bytes]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Expecting 1460 bytes]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Read 1460 bytes]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Expecting 1460 bytes]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Read 1460 bytes]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Expecting 1460 bytes]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Read 1460 bytes]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Expecting 723 bytes]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Read 723 bytes]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Got end of image by pattern, content-length = 7977]
Mar 23 10:35:17 bdc zmc-m2[12810]: DB3 [Returning 7977 (7995) bytes of captured content]

I don't get any errors back from zmc or in the logs on this, but it doesn't commit anything either.

(I have also been deleting and recreating monitors on every attempt)

-- 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 »

Hi Cy,

This is starting to get personal now (!). The stills all seems to be working right except that when it gets to the JPEG decoding it grumbles about the header bytes. Since the http header has been extracted and removed what's left should be just what is sent, which is an image!

I'll try and open up my 205 and see if you can access that, I'll mail you the address.

Phi,
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've asked the StartDot Technologies people about their MJPEG stream format that does not have the multipart-replace MIME http headers. Here's their answer:
_________
Jose,

Apparently, there is not M-JPEG standard (see
http://www.faqs.org/faqs/jpeg-faq/part1/section-20.html).

What the Express 6 produces is a series of JPEGs in server push mode (which
is a form of motion JPEG).

Maybe what you're looking for is an HTTP stream (possibly with "Multipart"
MIME headers)?

Vance Kozik
StarDot Technologies
Professional Remote Imaging Solutions
_________________

I've asked them if there's any chance their product will ever support the format with the http headers. I'm still waiting on that. Anyhow, I still have to ask you too, is there any chance for ZM to support this kind of headerless MJPEG stream? These people's product is, for me at least, the key to a low cost implementation for large installations. Providers over here are asking for an arm and a leg for a similar surveillance system, when I know for a fact that I can do it myself with ZoneMinder at a fraction of the cost.

Thanks for the help.

Regards,
Jose.
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 »

Hi Jose,

I can almost certainly support it if they can say exactly what is being sent down, is it just one encoded JPEG after another with nothing in between? Having said that, I have a few other things on my 'to do' list at the moment and adding support for it would be accelerated if there was a lot of demand or some funding!

Cheers,

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,
The developers from StarDot are asking me if I have any idea where they can get the exact format of the HTTP stream with the
multipart-replace MIME type?

Of course, I dont have any. Do you know where I can get some info? Perhaps what you used for ZM? If they pull this off, then ZoneMinder users will have an excellent alternative to Axis video servers at almost half the cost.

Regards,
Jose.
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 »

Hi Jose,

I don't have a reference as I'm not sure it's a defined standard anywhere, certainly I've seen a few variations. I'm surprised they don't already know about it! There is a discussion of it I've just found <a href="http://www.abiglime.com/webmaster/artic ... m">here</a>, which may help illustrate it a bit. Here's what an Axis 205 sends out, which is more or less the same as ZM does. Note the boundary is both defined and used with a leading '--' whereas discussions usually refer to it being defined without and used with.

<i>
HTTP/1.0 200 OK
Cache-Control: no-cache
Pragma: no-cache
Expires: Thu, 01 Dec 1994 16:00:00 GMT
Connection: close
Content-Type: multipart/x-mixed-replace; boundary=--myboundary

--myboundary^M
Content-Type: image/jpeg^M
Content-Length: 38451^M
^M
ÿØÿþ^@^NT@PQ8^@^@^@^@^@^@^@ÿþ^@^NI^A(^A~S^A^@^@^@d
<rest of image snipped>
~\~^=^O"~[Ar~D~M~SÏ5 c~L~Z½"Fã~TÇ?ÀqúT^Oj[æGÎ{^^?­&~J¹ÿÿÙ^M
--myboundary^M
Content-Type: image/jpeg^M
Content-Length: 39003^M
^M
ÿØÿþ^@^NT@PQ83^@^@^@^@^@^@ÿþ^@^NI^A(^A~
</i>

etc etc. Also line terminations seem to be fairly arbitrary with LF and CR/LF being used interchangeably, whereas I think technically CR/LF is preferred on all headers. Finally you wil notice that the image is terminated by a CR/LF before the next boundary, this can be either one CR/LF, two or none in my experience.

So it's a fairy loose format but so long as they implement an http server and respond to a request with something like the above it should work, at least with ZM. Don't forget that IE doesn't support it natively so they'll have to modify their client program.

I've done a bit more digging into their format and it looks pretty much ike one jpeg after another. I think I could probably support it with about 2-4 hours effort if it becomes necessary.

Cheers,

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've relayed your last post to the StarDot developers. After all, it is in their best interests to be in closer affinity with the industry defacto standard (which happens to be their nearest competitor, Axis).

Thanks,

Jose.
maron
Posts: 18
Joined: Sun Feb 15, 2004 12:08 pm

Re: Empty input file on 1.19.0

Post by maron »

I am having the exact same problem as Cybr0t with my axis 205.
maron
Posts: 18
Joined: Sun Feb 15, 2004 12:08 pm

Re: Empty input file on 1.19.0

Post by maron »

I am having the exact same problem as Cybr0t with my axis 205.
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 »

Hi Maron,

Do you have a firmware version for your 205?

Phil,
maron
Posts: 18
Joined: Sun Feb 15, 2004 12:08 pm

Re: Empty input file on 1.19.0

Post by maron »

Sorry, bit vague on info in my post.

I'm using firmware 4.04. Running zoneminder 1.19.1 on Fedora Core 1.

Maron
maron
Posts: 18
Joined: Sun Feb 15, 2004 12:08 pm

Re: Empty input file on 1.19.0

Post by maron »

Sorry, bit vague on info in my post.

I'm using firmware 4.04. Running zoneminder 1.19.1 on Fedora Core 1.

Maron
maron
Posts: 18
Joined: Sun Feb 15, 2004 12:08 pm

Re: Empty input file on 1.19.0

Post by maron »

Problem seems to be fixed. I' m not entirely sure how... I've fiddled with a lot of settings to optimize my axis2100 camera setup, using the mjpg stream on both 205 and 2100 and they now work extremely well. I'm coming to the conclusion that the network cameras are actually getting better than the analog cameras for many setups.
Locked