ZoneMinder Client Desktop Application for Mac and PC

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
kevin186
Posts: 55
Joined: Mon May 10, 2010 4:11 am
Location: Worth, IL

ZoneMinder Client Desktop Application for Mac and PC

Post by kevin186 »

As of today, I released a test version of a desktop app for streaming the video feeds similar to the montage view. The app is built on the Adobe Air runtime environment, which is similar to Java. It was a little tricky because mjpeg's are not natively supported by adobe flash. I spent about 3 months of my free time working out the bugs to keep the cpu usage low and prevent any memory leaks. Also, it requires the use of a custom skin. The app and skin are available to download for free at http://dvr-security.net/air/zmc/ .

Features:
-Uses ZoneMinder's built-in login system to authenticate user.
-Streams unlimited number of live video feeds using socket connections (only jpeg is currently supported).
-Take snapshots of what is currently visible on the monitor by pressing the snapshot button, which saves a jpeg locally to your computer.
-Video feeds can be tweaked by changing scale and bandwidth (smaller scale and lower bandwidth reduce CPU usage).
-CPU usage can be reduced by using Frame Skipping, which just tosses out 1 out of x images received.
-CPU usage can be reduced at the expense of more memory being used by un-checking bitmap smoothing and setting smoothing quality to default.
-Select from 1 of 9 montage layouts(more can be added or existing ones changed based on user feedback).
-If space is limited, you can remove the control bars that are at the top and bottom of each video feed.

Experimental Features:
- Change the background frame rate to a low value and the app will use very little resources while it is minimized or if another window gains focus. Be careful, if you set the rate too low, then you may have an increase in memory usage as the image buffers will be filling up faster than they are being read and truncated.
-Pressing the Garbage Collection button will free up any unused memory that is current assigned to the app. Open up task manager before you press the button so that you can see if any memory gets released. This may lead to me writing a timer script that will periodically run the garbage collection command if needed.

All feedback is welcome and appreciated. I would love to see some screenshots of a mac user, since I don't have one to test with. And please try to break it!

Here is a screen shot of the login form:
Image

Here is a screen shot of the montage with options panel open:
Image

Tested on PC's: windows vista home premium, windows 7 home premium, windows 7 starter
Tested on ZM server: fedora 16 with zoneminder 1.24.4
timgman
Posts: 46
Joined: Wed Mar 14, 2007 6:01 pm

Re: ZoneMinder Client Desktop Application for Mac and PC

Post by timgman »

NNNIIICCCEE!!!SUPER COOL!
kevin186
Posts: 55
Joined: Mon May 10, 2010 4:11 am
Location: Worth, IL

Re: ZoneMinder Client Desktop Application for Mac and PC

Post by kevin186 »

Just released version 0.1.1.
--Moved some buttons around.
--Added a system tray icon
--Left clicking system tray icon will focus/restore app.
--Right clicking system tray icon will open context menu.
--Optimization to the mjpeg parsing code.
kevin186
Posts: 55
Joined: Mon May 10, 2010 4:11 am
Location: Worth, IL

Re: ZoneMinder Client Desktop Application for Mac and PC

Post by kevin186 »

Version 0.1.2 released. I noticed that on my cousin's computer some camera feeds occasionally stalled. They have a slow connection and computer which may be the problem, since I have not personally experienced this on my computers. I added a Keep-Alive value to the headers of the socket request in hope that this will prevent the camera feeds from stopping.

Changelog for version 0.1.2:
-- Option to automatically log in was added.
-- Option to set snapshot naming was added.
-- "Keep-Alive: 115" was added to socket headers. (maybe will fix camera feeds that stall)
-- "User-Agent: ZoneMinder Client v0.1.2" was added to socket headers.

Here is a screenshot of the log in form with the Automatically Log In option:
Image
Flasheart
Posts: 342
Joined: Thu Jul 06, 2006 2:27 pm

Re: ZoneMinder Client Desktop Application for Mac and PC

Post by Flasheart »

Hi
Gave this a try, as although I have my own in-house ip camera montage thing (detailed in the wiki) I'm curious how others have approached this
problem :)

But v.0.1.2 no go for me. I tried with 3 zoneminder servers;

2 resulted in "Error: Invalid data format" and one with "Error: Unable to reach server".

Servers were running zm 1.23.3 or 1.24.2, all debian, all with correct url's specified.

What is common to all three is that they don't need a user/pass to log in. I tried with blank details and invented details for these fields on your client's login, with and without the save buttons clicked.

I have no login required for users, each server is on a private lan and has ip-restrictions at apache level which aren't interfering here.

Happy to give it another go sometime if you've any ideas/fixes.
kevin186
Posts: 55
Joined: Mon May 10, 2010 4:11 am
Location: Worth, IL

Re: ZoneMinder Client Desktop Application for Mac and PC

Post by kevin186 »

Flasheart wrote:Hi
Gave this a try, as although I have my own in-house ip camera montage thing (detailed in the wiki) I'm curious how others have approached this
problem :)

But v.0.1.2 no go for me. I tried with 3 zoneminder servers;

2 resulted in "Error: Invalid data format" and one with "Error: Unable to reach server".

Servers were running zm 1.23.3 or 1.24.2, all debian, all with correct url's specified.

What is common to all three is that they don't need a user/pass to log in. I tried with blank details and invented details for these fields on your client's login, with and without the save buttons clicked.

I have no login required for users, each server is on a private lan and has ip-restrictions at apache level which aren't interfering here.

Happy to give it another go sometime if you've any ideas/fixes.
Thanks for the feedback. I setup my server to be without a username/password by unchecking OPT_USE_AUTH Authenticate user logins to ZoneMinder. I presume this is the setting you are using. I left the fields blank, and also tried entering fake info and the client worked for me.

Did you install the required custom skin? If so, then can you add these parameters to your zoneminder url and see if the skin is outputting the correct data:

Code: Select all

?skin=zmc&view=console.xml
?skin=zmc&view=montage.xml
I added extra views that output formatted xml that can be read by the client.
The console.xml should output something like this:

Code: Select all

<console>
<running>1</running>
<status>Running</status>
<username>admin</username>
<maxBandwidth>3</maxBandwidth>
<viewStream>1</viewStream>
<viewEvents>1</viewEvents>
</console>
The montage.xml should output something like this:

Code: Select all

<montage>
<serverName>website.com</serverName>
<serverPort>80</serverPort>
<monitors>
<monitor>
<id>1</id>
<name>Monitor-1</name>
<width>480</width>
<height>360</height>
<scale>100</scale>
<scaledWidth>480</scaledWidth>
<scaledHeight>360</scaledHeight>
<maxfps>15.00</maxfps>
<sequence>1</sequence>
<serverPath>
/cgi-bin/zm/nph-zms?mode=jpeg&monitor=1&scale=100&maxfps=5&connkey=158910&rand=1338421835
</serverPath>
</monitor>
</monitors>
</montage>
In case you don't have the custom skin installed, here is how i installed mine:

Code: Select all

cd /usr/share/zoneminder/www/skins
wget http://dvr-security.net/air/zmc/zmc.tar.gz
tar -zxf zmc.tar.gz
rm -f zmc.tar.gz
pezed
Posts: 7
Joined: Tue Aug 23, 2011 4:21 am

Re: ZoneMinder Client Desktop Application for Mac and PC

Post by pezed »

Thanks for the excellent work! Love not having to have a browser open all the time now!
kevin186
Posts: 55
Joined: Mon May 10, 2010 4:11 am
Location: Worth, IL

Re: ZoneMinder Client Desktop Application for Mac and PC

Post by kevin186 »

pezed wrote:Thanks for the excellent work! Love not having to have a browser open all the time now!
Thanks for the feedback, but I am actually not satisfied with it. I plan on rebuilding it from scratch after I finish the mobile versions for android and ios.
pezed
Posts: 7
Joined: Tue Aug 23, 2011 4:21 am

Re: ZoneMinder Client Desktop Application for Mac and PC

Post by pezed »

Try IP cam viewer for android, I use it with zoneminder and it works great.
kevin186
Posts: 55
Joined: Mon May 10, 2010 4:11 am
Location: Worth, IL

Re: ZoneMinder Client Desktop Application for Mac and PC

Post by kevin186 »

I took a look at it and it seems nice. But I am making something that is dedicated for use with ZoneMinder (just upload the custom skin to the server, then enter username & password & url in the app). In the near future, maybe you can compare mine to the one you use. Hopefully your phone/tablet supports Adobe AIR (requires a processor like arm 7 or something like that).

The major thing that my app does is to dynamically change the scale of the requested video feed (based on available screen size), so that it only uses as much bandwidth, cpu, memory as needed to have the correct size image show up. For example, if your screen is small and you have 16 cameras, maybe each one only has 50px height and width available to show up on montage. It would be such a waste of resources to load a fully scaled 100% image feed and then downscale it for your screen. That would use alot more bandwidth than necessary.
arymar
Posts: 13
Joined: Tue Dec 14, 2010 3:53 pm
Location: France

Re: ZoneMinder Client Desktop Application for Mac and PC

Post by arymar »

Hi,
Got as well the "invalid data format" message. I get this one each time I am adding the port number into the URL: http://domain.com:8090/zm/index.php
If I remove the port number, the client goes further to connect to the server.
My 2 cts.
Alain
Post Reply