Using the output of a script as the source of an Image

Support and queries relating to all previous versions of ZoneMinder
Locked
diggler
Posts: 6
Joined: Mon Sep 08, 2008 3:40 pm

Using the output of a script as the source of an Image

Post by diggler »

Hi

I have written a small perl script to extract a jpeg from a Linksys WVC54G which is notoriously awkward by normally only providing a propriatory image stream.

Is there any way of using this script directly from zoneminder; i.e. define this script as the source where the output of the script is a jpeg?

Thanks in advance

Diggler
haus
Posts: 213
Joined: Thu Oct 11, 2007 5:10 am

Post by haus »

If you haven't tried it yet:

In the source of the monitor, set source type to file and enter the path to the script? Probably make sure the script has the proper shebang and all the right permissions. I've never done it, though, but it seems like it should work.
diggler
Posts: 6
Joined: Mon Sep 08, 2008 3:40 pm

Post by diggler »

I tried that, it seems it is looking for a file to open - it complains the file is not a valid jpg file ; I could run the file regulary in a cron job and read the results but there would be locking issues and other contention. I would rather run the script and take the result.

The script sends the jpg to STDOUT so i was hoping that I could just suck it in to zoneminder.

Thanks

Diggler
coke
Posts: 518
Joined: Wed Jan 30, 2008 5:53 pm
Location: St. Louis, MO, USA

Post by coke »

Maybe something's wrong with the jpeg it's outputting? Try piping it to an image viewer, do you get anything?
diggler
Posts: 6
Joined: Mon Sep 08, 2008 3:40 pm

Post by diggler »

Woohoo

Well, got a workaround which seems to be ok if a little slow; have converted the perl code to run under cgi-bin and now treat it as a network web-cam (if a little slow).

For what its worth if anyone has one of these godawful webcams feel free to pm me for the code.

Cheers

Diggler
Locked