ZoneMinder Client Mobile Application for Android

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.
kevin186
Posts: 55
Joined: Mon May 10, 2010 4:11 am
Location: Worth, IL

ZoneMinder Client Mobile Application for Android

Post by kevin186 » Sun Feb 03, 2013 5:46 pm

If anybody is interested, I will make my android app available. There are no ads, and no limits. And it is free. I have only tested it using ZoneMinder 1.24.4 on Fedora 16 x86_64, so I do not know if it will work with other versions. It requires the use of my custom skin that must be uploaded to your skins directory. The other caveat is that my android app is dependent on the Adobe AIR app, so this must also be installed on your android device.

edit: I just spent a few hours and finished packaging the android app and the skin
The app can be downloaded @ http://dvr-security.net/air/zmc/ZoneMin ... Mobile.apk
note: to download and install the app from my server, you must go to your settings and check the option "Unknown sources" which is necessary to install apps from sources other than google play store
The skin can be downloaded @ http://dvr-security.net/air/zmc/zmc_xml.tar.gz

Steps for installing the skin:
1. Navigate to the skins directory: cd /usr/share/zoneminder/www/skins (your directory may be different)
2. Download the archived skin file: wget http://dvr-security.net/air/zmc/zmc_xml.tar.gz
3. Extract the skin folder archive: tar -zxf zmc_xml.tar.gz
4. Remove the archived skin file: rm -f zmc_xml.tar.gz
5. Login to your ZoneMinder installation and go to the console
6. Change the skin to zmc_xml by adding ?skin=zmc_xml to your url
7. Verify that you can view the xml data

Code: Select all

cd /usr/share/zoneminder/www/skins
wget http://dvr-security.net/air/zmc/zmc_xml.tar.gz
tar -zxf zmc_xml.tar.gz
rm -f zmc_xml.tar.gz
Setting up the app and logging in:
1. Enter username and password
2. Enter url in the format: http://example.com/zm/ or http://12.34.56.789/zm/ (IT IS NECESSARY TO INCLUDE TRAILING SLASH)
3. Press the save button to store the info for next time
4. Check the button "automatically log in" to automatically log in when the app starts up
5. Press the log in button

I have tested it and have it working on the following android devices:
- Coby Kyros (MID8042) Android 4.0.3
- Google Nexus 4 (LG E960) Android 4.2.1
- HTC Google G2 Android 2.3.4
- LG Optimus L9 Android 4.0.4
- Motorola Droid RAZR (XT912) rooted with Android 4.1.2
- Samsung Droid Charge (SCH-I510) Android 2.3.6
- Samsung Galaxy Exhibit 4G (SGH-T679) Android 2.3.6
- Sony Tablet S Android 4.0.3(release5a)

Features:
free, no ads, montage view, watch view, unlimited number of monitors, multiple bandwidth options(high, medium, low, phone), automatically requests the correct scale of video feed to fit the available space(as to not waste bandwidth loading a stream at 100% when maybe 40% would be appropriate), option to prevent the phone from sleeping while watching monitors, option to utilize full screen(hides bar at top that shows clock and carrier signal strength), turns off video feeds when app loses focus(restarts automatically when app gains focus)

Here are some screenshots taken with my Google Nexus 4:
Log In (portrait)
Image
Console (portrait)
Image
Montage Settings (portrait)
Image
Montage (portrait)
Image
Montage (landscape)
Image
Watch (portrait)
Image
Watch (landscape)
Image

Bug reporting:
- Please respond on this forum with a post.
- Please don't just say "It doesn't work."
- Please give details of versions of software and operating systems and any special configurations.
- If you need personal troubleshooting, you can always PM me with a temporary account to your server to take a look.
- If the app cannot connect to your server, make sure you have the zmc_xml skin installed
- Make sure the zmc_xml skin is working by adding ?skin=zmc_xml to your url in your web browser

XML data should be output when you visit your ZoneMinder installation and add ?skin=zmc_xml to your url in your browser like so:

Code: Select all

<console>
<skinVersion>1</skinVersion>
<running>1</running>
<username>admin</username>
<maxBandwidth>high</maxBandwidth>
<viewStream>1</viewStream>
<viewMonitors>1</viewMonitors>
<editMonitors>1</editMonitors>
<viewEvents>1</viewEvents>
<editEvents>1</editEvents>
<monitor>
<monitorID>1</monitorID>
<monitorName>Side_Porch</monitorName>
<monitorWidth>480</monitorWidth>
<monitorHeight>360</monitorHeight>
<monitorSequence>1</monitorSequence>
<monitorFunction>Monitor</monitorFunction>
</monitor>
<monitor>
<monitorID>2</monitorID>
<monitorName>Side_Gate</monitorName>
<monitorWidth>480</monitorWidth>
<monitorHeight>360</monitorHeight>
<monitorSequence>2</monitorSequence>
<monitorFunction>Monitor</monitorFunction>
</monitor>
</console>

timgman
Posts: 46
Joined: Wed Mar 14, 2007 6:01 pm

Re: ZoneMinder Client Mobile Application for Android

Post by timgman » Tue Feb 05, 2013 6:53 pm

NNNIICCEE!!!

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

Re: ZoneMinder Client Mobile Application for Android

Post by kevin186 » Mon Feb 11, 2013 4:55 am

I updated the app. There is now a "cycle" view. There is also an option in the console settings to auto launch with a choice of : montage, cycle, or none. I also updated my server mime types to include .apk so that you can properly download the app directly to your phone/tablet. I made a few other performance tweaks. Try it out and let me know if you have any likes or dislikes: http://dvr-security.net/air/zmc/ZoneMin ... Mobile.apk

Don't forget, the montage, cycle, and watch views each have their own settings to adjust. I did this because when I am watching the montage, I like to have a low bandwidth setting/framerate to conserve bandwidth. If I doubleclick a monitor on the montage to launch a Watch view, then I like to have that in a high framerate.

axelm
Posts: 46
Joined: Wed Feb 06, 2013 1:50 pm

Re: ZoneMinder Client Mobile Application for Android

Post by axelm » Sat Mar 02, 2013 1:48 pm

I installed the apk on my Galaxy S3 GT-i9300 running stock Android 4.2.1 and latest Adobe Air version 3.6.0.597.

Server is zm 1.25.0 nextime branch on Fedora 18 i686. I don' t have the zmc_xml skin. Here's a ls -la of my skins folder: http://paste.fedoraproject.org/4111/

Should I copy that skin from 1.24.4?

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

Re: ZoneMinder Client Mobile Application for Android

Post by kevin186 » Sat Mar 02, 2013 2:12 pm

axelm wrote:I installed the apk on my Galaxy S3 GT-i9300 running stock Android 4.2.1 and latest Adobe Air version 3.6.0.597.

After I type in user, password and url the Login button is still greyed out. I can't login.

EDIT: I added a final / after http://ip/zm in the URL and now the login button is enabled.

Thanks for pointing that out. I added some checks to make sure that the url is formatted properly so that the app can communicate with your server. The url address should be in the format:

Code: Select all

http://yourserver.com/zm/
or

Code: Select all

http://123.12.35.65/zm/
or if it is not in a sub folder then just

Code: Select all

http://yourserver.com/
It must begin with "http://" and end with a slash "/".

On another note, I will be releasing a newer version of the app this weekend. It includes the ability to change the function of the monitors, such as from modect to monitor and to enable or disable them. I also changed the layout of the console. I will be adding an interface for event viewing in a later version, but unfortunately I am using flashbuilder and the last day of my free trial is today.

And remember, if you are to use this app, you must use the custom skin I created for it.
Last edited by kevin186 on Sat Mar 02, 2013 2:51 pm, edited 1 time in total.

axelm
Posts: 46
Joined: Wed Feb 06, 2013 1:50 pm

Re: ZoneMinder Client Mobile Application for Android

Post by axelm » Sat Mar 02, 2013 2:28 pm

Apparently I should not be doing any IT stuff on Saturday mornings. My brain is still asleep! How could I miss your instructions regarding the skin download? Sorry about that.

EDIT: You should check out the way IP Cam Viewer lets you test the setup while you are configuring it. I find it very practical. It tests credentials and fetches a test frame.

axelm
Posts: 46
Joined: Wed Feb 06, 2013 1:50 pm

Re: ZoneMinder Client Mobile Application for Android

Post by axelm » Sat Mar 02, 2013 3:32 pm

Pretty nice :)

Everything works except that when I pinch to zoom into a video feed I get "socket closed" and the yellow ZM triangle.

EDIT: zms is crashing when I zoom.

2013-03-02 12:42:30.159613 zms 21940 ERR Attempt to directly assign buffer from an undersized buffer of size: 372768 zm_image.cpp 344

I am using mmap. Zoom works fine in IP Cam Viewer Lite, which is what I usually use.

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

Re: ZoneMinder Client Mobile Application for Android

Post by kevin186 » Sat Mar 02, 2013 8:57 pm

axelm wrote:Pretty nice :)

Everything works except that when I pinch to zoom into a video feed I get "socket closed" and the yellow ZM triangle.

EDIT: zms is crashing when I zoom.

2013-03-02 12:42:30.159613 zms 21940 ERR Attempt to directly assign buffer from an undersized buffer of size: 372768 zm_image.cpp 344

I am using mmap. Zoom works fine in IP Cam Viewer Lite, which is what I usually use.
There is no pinch to zoom feature. Double tap a monitor to launch it to a single watch view of that monitor. Long press a monitor to turn it on or off. It did not crash, you simply turned it off when you held you fingers on it.

I thought about having a pinch for launching the full view of the monitor, but i figured it would be hard to pinch a monitor if you had 16 on the screen at once and they would be pretty small. I can barely pinch it when i have 6 monitors in the montage, so i just made it a double tap to zoom, which will actually launch it to a single view of the 1 monitor.

I will put out full instructions soon so that there is no confusion about using the app.

I heard good things about the other apps that people can use for viewing camera feeds, but i thought that you have to pass your username and password in the url, or atleast the auth key which expires every couple of hours? With my app, all username and password data is posted to the server and you can use features such as AUTH_RELAY = hashed and AUTH_HASH_IPS.

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

Re: ZoneMinder Client Mobile Application for Android

Post by kevin186 » Sat Mar 02, 2013 9:29 pm

Latest version now available, which includes the ability to change the function of the monitor. It also blocks some interactions while waiting for the server to respond as to prevent some potential crashes. It requires the newest version of the zmc_xml skin.
The app can be downloaded @ http://dvr-security.net/air/zmc/ZoneMin ... e_beta.apk.
The skin can be downloaded @ http://dvr-security.net/air/zmc/zmc_xml_v2.tar.gz.
One way of installing the skin on the server is by using a program like putty and remotely connecting to the server and entering some commands. Here is how I did it on my server:
Navigate to skins directory:

Code: Select all

cd /usr/share/zoneminder/www/skins
Backup the old zmc_xml skin(optional):

Code: Select all

mv zmc_xml zmc_xml_v1_backup
Download the skin to that directory:

Code: Select all

wget http://dvr-security.net/air/zmc/zmc_xml_v2.tar.gz
Decompress the archived file:

Code: Select all

tar -zxvf zmc_xml_v2.tar.gz
Remove the archived file:

Code: Select all

rm -f zmc_xml_v2.tar.gz
Instructions for using the app:

-Log In view
Enter username, password, and URL to the zoneminder installation and then press the "Save" button if you wish to store the info for later use. The URL should begin with "http://" and end with "/". Click the settings button in the top right corner if you want the app to automatically attempt to log in when the app starts.

-Console view
If you have more than 1 camera then you have the option of clicking on cycle or montage. I think the cycle and montage is self explanatory if you already use zoneminder. You can also launch a single monitor view by clicking the button with that monitor's name. If you have the privileges, you can also click the Function button and change the monitor's function. There are "Event" buttons present, but the Events feature is not ready yet. Clicking the settings button in top right corner gives you the option of automatically loading the cycle or montage after the console loads.

-Function view
Change the function of the monitor to be none, monitor, modect, record, mocord, nodect. You can also change whether or not it is enabled.

-Montage view
Click the settings button in top right corner to change many settings about the montage such as monitors per page, monitor layout, bandwidth, etc. All of the settings in the montage settings page are just for the montage and are not global. The watch and cycle views each have their own settings. If you want to launch an individual view of a single monitor for the montage view, then just double click that monitor. I you wish to toggle a monitor on or off, then long press it.

-Watch view
Similar to the montage view, except that you are viewing a single monitor at a time. Easily change the viewed monitor by swiping left or right. Long press it to turn it on or off.

-Cycle view
Similar to watch view, except that the monitor will change based on the frequency setting selected. Access the settings by pressing the top right button.

Main features that I strived for:

-ad free
I have tried some other zoneminder apps and the only thing that worked on them was the ads!

-logging in and utilizing the security features of zoneminder
All usernames and passwords are sent to the server using POST requests. AUTH_RELAY can be set as "hashed" and AUTH_HASH_IPS can be enabled. The usernames and passwords and not passed in plain text for the monitor streams.

-minimizing bandwidth consumption
The app automatically calculates the available size and only loads a monitor feed with the appropriate scale. Which means that it does not always use scale=100. Most of the time if you are on montage view and have several monitors, the scale of each one may only be at 30, which will use alot less bandwidth. You can also pick your bandwidth setting in the app and then the server will send the appropriate frames per seconds video feed. I personally set Phone as 1, Low as 4, Medium as 8, and High as 16 on my server. Of course the best bandwidth save would be to use something other than mjpeg, but I have not tried to do that yet.

-maintaining connection
I noticed that if i left my firefox browser on with the video feed, that after several hours that my video feeds may stall. I figured this was due to the auth key expiring after a couple of hours. My app will attempt to restart the video feed if the server cuts off the socket. I have tested out the app on several devices and let them run overnight. The feed were still live in the morning, hopefully it will work just as good for you.

axelm
Posts: 46
Joined: Wed Feb 06, 2013 1:50 pm

Re: ZoneMinder Client Mobile Application for Android

Post by axelm » Sun Mar 03, 2013 11:41 am

Looks good and worked fine for me. I still find the lack of pinch to zoom very strange considering it's a basic function in any touchscreen based environment. So to be honest I would use IP Cam Viewer to look at realtime feeds and your app to look at events once you have finished developing that function.

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

Re: ZoneMinder Client Mobile Application for Android

Post by kevin186 » Sun Mar 03, 2013 2:49 pm

axelm wrote:Looks good and worked fine for me. I still find the lack of pinch to zoom very strange considering it's a basic function in any touchscreen based environment. So to be honest I would use IP Cam Viewer to look at realtime feeds and your app to look at events once you have finished developing that function.
I tried out ip cam view basic (lite is not compatible with nexus 4, but made by same guy) and i see that they use the double click to launch a single view of 1 monitor from their "matrix" view(montage). You are not talking about zooming on montage, right? I did see that when viewing a single cam that you can zoom.

So, on that app, you double tap the monitor on the montage view to get to the single view, and then double tap the single view monitor and it give you a stream that can be zoomed. So I would need to add the zooming to the single watch view. Let me know if that is what you want. Doesnt sound too tricky.

axelm
Posts: 46
Joined: Wed Feb 06, 2013 1:50 pm

Re: ZoneMinder Client Mobile Application for Android

Post by axelm » Sun Mar 03, 2013 7:15 pm

kevin186 wrote:
axelm wrote:Looks good and worked fine for me. I still find the lack of pinch to zoom very strange considering it's a basic function in any touchscreen based environment. So to be honest I would use IP Cam Viewer to look at realtime feeds and your app to look at events once you have finished developing that function.
I tried out ip cam view basic (lite is not compatible with nexus 4, but made by same guy) and i see that they use the double click to launch a single view of 1 monitor from their "matrix" view(montage). You are not talking about zooming on montage, right? I did see that when viewing a single cam that you can zoom.

So, on that app, you double tap the monitor on the montage view to get to the single view, and then double tap the single view monitor and it give you a stream that can be zoomed. So I would need to add the zooming to the single watch view. Let me know if that is what you want. Doesnt sound too tricky.
Yup, sounds good :)

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

Re: ZoneMinder Client Mobile Application for Android

Post by kevin186 » Fri Mar 08, 2013 3:45 am

@axelm

I added the zooming feature as requested. Download the app at the same location: http://dvr-security.net/air/zmc/ZoneMin ... e_beta.apk

When in "Watch" mode viewing a single monitor and video is currently turned on:
- Double click the video to activate panning and zooming.
- Use 2 fingers for zooming in a pinching motion.
- Use 2 fingers for panning in a dragging motion.
- Double click the video again or press the back button to deactivate panning and zooming.

What happens when panning and zooming:
- Swiping left and right to shuffle through the monitors is deactivated.
- Swiping up and down to show/hide the actionbar at the top is deactivated.
- The video will re-size to your desired zoom level(big or small).
- The video will request an updated feed from the server with the newly calculated scale(never exceeding 100).

Let me know if this works for you.

axelm
Posts: 46
Joined: Wed Feb 06, 2013 1:50 pm

Re: ZoneMinder Client Mobile Application for Android

Post by axelm » Fri Mar 08, 2013 10:15 pm

It works exactly as you described.

You should probably add a limit to the panning feature. It currently allows me to move the feed off the screen.

Zooming works fine :)

Looking forward to event playback.

Regards

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

Re: ZoneMinder Client Mobile Application for Android

Post by kevin186 » Sun Mar 10, 2013 4:39 am

Added some code to limit panning and zooming.
- fixed a bug that if you zoom too small, it may crash
- added limits so that you cannot zoom too large, which may slow down the app
- panning will no longer take the video completely off the screen

http://dvr-security.net/air/zmc/ZoneMin ... e_beta.apk

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests