[RELEASE] ZoneMinder CCTV Addon
#1
Thumbs Up 
For anyone out there who uses ZoneMinder, I've created an addon that allows you to connect to a ZoneMinder server and view camera feeds. The addon is in the official repository, so anyone using Dharma should be able to grab it from within XBMC.

I'd be interested in anyone who ends up trying out this addon, especially if you're using hashed authentication. It seemed to work okay when I tested it, but I'd love to have independent confirmation that all's well.

I may release a new version soon, with the option to specify an IP address for the hash. This would be useful for people who have ticked the option in ZoneMinder to include the IP in the calculated hash for authentication, but are going through a proxy or some other fanangled networking which causes the IP that ZoneMinder sees to be different to the IP of the box XBMC is running on.

I also have a script for more generic streams, which I've been using with VLC on Linux. I've created a VLM config file for VLC which allows me to create streams from multiple webcams attached to a PC, and additionally create a "mosaic" of all the webcams in one HD stream. Once I'm happy that the script and the VLC solution are working okay (VLC currently seems to use a lot of CPU transcoding the streams, and I'd like to look into minimising this) I'll probably release the script and add a tutorial for VLC on this forum.
Author of the NZ OnDemand and ZoneMinder addons, and caretaker of the pyamf script. Contributor to fanart.tv, TheMovieDB and TheTVDB.
Reply
#2
markhoney Wrote:For anyone out there who uses ZoneMinder, I've created an addon that allows you to connect to a ZoneMinder server and view camera feeds. The addon is in the official repository, so anyone using Dharma should be able to grab it from within XBMC.

I'd be interested in anyone who ends up trying out this addon, especially if you're using hashed authentication. It seemed to work okay when I tested it, but I'd love to have independent confirmation that all's well.

I may release a new version soon, with the option to specify an IP address for the hash. This would be useful for people who have ticked the option in ZoneMinder to include the IP in the calculated hash for authentication, but are going through a proxy or some other fanangled networking which causes the IP that ZoneMinder sees to be different to the IP of the box XBMC is running on.

I also have a script for more generic streams, which I've been using with VLC on Linux. I've created a VLM config file for VLC which allows me to create streams from multiple webcams attached to a PC, and additionally create a "mosaic" of all the webcams in one HD stream. Once I'm happy that the script and the VLC solution are working okay (VLC currently seems to use a lot of CPU transcoding the streams, and I'd like to look into minimising this) I'll probably release the script and add a tutorial for VLC on this forum.

I haven't had a chance to test this yet as I haven't got ZM set up yet, but I'll definitely give you some feedback when I get it done.
Reply
#3
Hi Mark

Great idea for XBMC add on

tried it on my setup and getting the message 'Warning No Camera Found'

i can access zm from http://servername/zm usual and have setup user pass etc without hashed auth.

any ideas?

running version 1.23.3 of zm

cheers
Reply
#4
Hi, it is a great idea!

I'm using jpegs to view the picture from cameras instead of mpeg.
I can start the plugin and I can see thumbnails but when select any camera I get:
Quote:09:14:00 T:3078018928 M:1530134528 NOTICE: Parsing ASX
09:14:00 T:3078018928 M:1530134528 ERROR: Unable to parse ASX info Error: Error document empty.
09:14:00 T:3078018928 M:1529372672 NOTICE: DVDPlayer: Opening: http://myurl.com/cgi-bin/nph-zms?monitor...r1&pass=pa$$word
09:14:00 T:3078018928 M:1529372672 WARNING: CDVDMessageQueue(player):Tongueut MSGQ_NOT_INITIALIZED
09:14:00 T:2949389168 M:1529372672 NOTICE: Creating InputStream
09:14:01 T:2949389168 M:1528856576 NOTICE: Creating Demuxer
09:14:01 T:2949389168 M:1528221696 NOTICE: Opening video stream: 0 source: 256
09:14:01 T:2949389168 M:1528221696 ERROR: CDVDPlayerVideo::OpenStream - Invalid framerate 1000, using forced 25fps and just trust timestamps
09:14:01 T:2949389168 M:1528221696 NOTICE: Creating video codec with codec id: 17
09:14:01 T:2949389168 M:1528221696 NOTICE: CDVDVideoCodecFFmpeg::Open() Using codec: MPEG-4 part 2 Microsoft variant version 3
09:14:01 T:2949389168 M:1528221696 NOTICE: Creating video thread
09:14:01 T:2949389168 M:1528221696 WARNING: CDVDMessageQueue(audio):Tongueut MSGQ_NOT_INITIALIZED
09:14:01 T:2949389168 M:1528221696 NOTICE: CDVDPlayer::OnExit()
09:14:01 T:2949389168 M:1528221696 NOTICE: DVDPlayer: eof, waiting for queues to empty
09:14:01 T:2949389168 M:1528221696 NOTICE: DVDPlayer: closing video stream
09:14:01 T:2949389168 M:1528221696 NOTICE: Closing video stream
09:14:01 T:2949389168 M:1528221696 NOTICE: CDVDMessageQueue(video)::WaitUntilEmpty
09:14:01 T:3075468144 M:1528221696 NOTICE: running thread: video_thread
09:14:01 T:2949389168 M:1528221696 NOTICE: waiting for video thread to exit
09:14:01 T:3075468144 M:1528221696 ERROR: Got MSGQ_ABORT or MSGO_IS_ERROR return true
09:14:01 T:3075468144 M:1528221696 NOTICE: thread end: video_thread
09:14:01 T:2949389168 M:1528221696 NOTICE: deleting video codec
09:14:01 T:2949389168 M:1528221696 NOTICE: CDVDPlayer::OnExit() deleting demuxer
09:14:01 T:2949389168 M:1528221696 NOTICE: CDVDPlayer::OnExit() deleting input stream
09:14:01 T:3078018928 M:1528246272 ERROR: XLCDproc::SetBackLight - Unable to write to socket
09:14:01 T:3078018928 M:1528246272 NOTICE: CDVDPlayer::CloseFile()
09:14:01 T:3078018928 M:1528246272 WARNING: CDVDMessageQueue(player):Tongueut MSGQ_NOT_INITIALIZED
09:14:01 T:3078018928 M:1528246272 NOTICE: DVDPlayer: waiting for threads to exit
09:14:01 T:3078018928 M:1528246272 NOTICE: DVDPlayer: finished waiting
09:14:01 T:3078018928 M:1529516032 ERROR: XLCDproc::SetBackLight - Unable to write to socket

mpeg cannot be found because there is no mpeg stream, only jpeg.
Any idea how to fix it without changing in ZM from jpeg to mpeg?
Reply
#5
Hi, great idea for a script.

I don't know much about Zoneminder, but it would be cool if you could make it so when my doorbell rings (or any motion detected at my front door cam) the video I am watching pauses and a popup showing the front door cam stream, like this thread.
Reply
#6
i can' t start ZoneMinder plugin from XMBC
it's log
Code:
10:34:00 T:2901285744 M:2905022464  NOTICE: -->Python Interpreter Initialized<--
10:34:01 T:2901285744 M:2903752704  NOTICE: Grabbing URL: http://zoneminder/zm/?skin=classic
10:34:01 T:2901285744 M:2903752704  NOTICE: Requesting page: http://zoneminder/zm/?skin=classic
10:34:01 T:2901285744 M:2903752704   ERROR: Error Type: urllib2.HTTPError
10:34:01 T:2901285744 M:2903752704   ERROR: Error Contents: HTTP Error 407: Proxy Authentication Required
10:34:01 T:2901285744 M:2903244800   ERROR: Traceback (most recent call last):
                                              File "/home/aivs/.xbmc/addons/plugin.video.zoneminder/default.py", line 170, in ?
                                                listcameras()
                                              File "/home/aivs/.xbmc/addons/plugin.video.zoneminder/default.py", line 147, in listcameras
                                                doc = gethtmlpage(url)
                                              File "/home/aivs/.xbmc/addons/plugin.video.zoneminder/default.py", line 47, in gethtmlpage
                                                response = urllib2.urlopen(req)
                                              File "../Python/Lib/urllib2.py", line 130, in urlopen
                                                return _opener.open(url, data)
                                              File "../Python/Lib/urllib2.py", line 364, in open
                                                response = meth(req, response)
                                              File "../Python/Lib/urllib2.py", line 471, in http_response
                                                response = self.parent.error(
                                              File "../Python/Lib/urllib2.py", line 402, in error
                                                return self._call_chain(*args)
                                              File "../Python/Lib/urllib2.py", line 337, in _call_chain
                                                result = func(*args)
                                              File "../Python/Lib/urllib2.py", line 480, in http_error_default
                                                raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
                                            HTTPError: HTTP Error 407: Proxy Authentication Required
10:34:01 T:3020281728 M:2903244800   ERROR: GetDirectory - Error getting plugin://plugin.video.zoneminder/
10:34:01 T:3020281728 M:2903244800   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.zoneminder/) failed
10:34:01 T:3020281728 M:2903248896 WARNING: GetLabel - Unknown nodetype requested 0
10:34:08 T:3020281728 M:2901295104  NOTICE: Storing total System Uptime
10:34:08 T:3020281728 M:2901295104  NOTICE: Saving settings
10:34:08 T:3020281728 M:2901295104  NOTICE: stop all
10:34:08 T:3020281728 M:2901295104  NOTICE: ES: Stopping event server
10:34:09 T:2932538224 M:2901581824  NOTICE: ES: UDP Event server stopped
10:34:09 T:2949323632 M:2901581824  NOTICE: DS: DBUS server stopped
10:34:09 T:3020281728 M:2901581824  NOTICE: stop dvd detect media
10:34:09 T:3020281728 M:2901581824  NOTICE: stop sap announcement listener
10:34:09 T:3020281728 M:2901581824  NOTICE: clean cached files!
10:34:09 T:3020281728 M:2901581824  NOTICE: unload skin
10:34:09 T:3020281728 M:2909962240  NOTICE: stop python
10:34:09 T:3020281728 M:2912501760  NOTICE: stopped
10:34:09 T:3020281728 M:2912501760  NOTICE: destroy
10:34:09 T:3020281728 M:2912501760  NOTICE: unload sections
Reply
#7
aivs, it looks like you may be going through a proxy:

Error Contents: HTTP Error 407: Proxy Authentication Required

If this isn't the case, it may be ZoneMinder authentication that's causing this. What auth method have you setup in ZoneMinder?
Author of the NZ OnDemand and ZoneMinder addons, and caretaker of the pyamf script. Contributor to fanart.tv, TheMovieDB and TheTVDB.
Reply
#8
markhoney Wrote:aivs, it looks like you may be going through a proxy:

Error Contents: HTTP Error 407: Proxy Authentication Required

If this isn't the case, it may be ZoneMinder authentication that's causing this. What auth method have you setup in ZoneMinder?

I have asked the admin to switch off proxy for me.

Can this plugin work with out internet connection ?
Reply
#9
If ZoneMinder is running on the same box as XBMC, you can connect without an internet connection by using the loopback IP address, 127.0.0.1.

Obviously, if the Zoneminder service is running on another machine, the XBMC machine needs to talk to it over the network!
Author of the NZ OnDemand and ZoneMinder addons, and caretaker of the pyamf script. Contributor to fanart.tv, TheMovieDB and TheTVDB.
Reply
#10
Admin switch off proxy, and now in ~.xbmc/temp/XBMC.log

00:44:46 T:2905127792 M:3180322816 NOTICE: -->Python Interpreter Initialized<--
00:44:46 T:2905127792 M:3180322816 NOTICE: Grabbing URL: http://zoneminder/zm/?skin=classic
00:44:46 T:2905127792 M:3180322816 NOTICE: Requesting page: http://zoneminder/zm/?skin=classic
00:44:46 T:2905127792 M:3180322816 ERROR: Error Type: urllib2.URLError
00:44:46 T:2905127792 M:3180322816 ERROR: Error Contents: <urlopen error (-2, 'Name or service not known')>
00:44:46 T:2905127792 M:3180322816 ERROR: Traceback (most recent call last):
File "/home/aivs/.xbmc/addons/plugin.video.zoneminder/default.py", line 170, in ?
listcameras()
File "/home/aivs/.xbmc/addons/plugin.video.zoneminder/default.py", line 147, in listcameras
doc = gethtmlpage(url)
File "/home/aivs/.xbmc/addons/plugin.video.zoneminder/default.py", line 47, in gethtmlpage
response = urllib2.urlopen(req)
File "../Python/Lib/urllib2.py", line 130, in urlopen
return _opener.open(url, data)
File "../Python/Lib/urllib2.py", line 358, in open
response = self._open(req, data)
File "../Python/Lib/urllib2.py", line 376, in _open
'_open', req)
File "../Python/Lib/urllib2.py", line 337, in _call_chain
result = func(*args)
File "../Python/Lib/urllib2.py", line 1021, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "../Python/Lib/urllib2.py", line 996, in do_open
raise URLError(err)
URLError: <urlopen error (-2, 'Name or service not known')>
00:44:46 T:3021739904 M:3180322816 ERROR: GetDirectory - Error getting plugin://plugin.video.zoneminder/
00:44:46 T:3021739904 M:3180322816 ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.zoneminder/) failed
00:44:46 T:3021739904 M:3180322816 WARNING: GetLabel - Unknown nodetype requested 0

When i disconnectet, i can't open all plugins.
XBMC-->Videos-->Video Add-ons-->Remote share Network is not connected
Reply
#11
What's the name of your ZOneMinder box? Is it local, or on the internet? Your log shows that the plugin is attempting to connect to a ZoneMinder server called "zoneminder". Is this the name of your server that's running zoneminder? If not, you need to edit the settings for the plugin and tell it the name or IP address of your ZoneMinder server.

Oh, and as it's not a proxy issue you can turn the proxy back on!
Author of the NZ OnDemand and ZoneMinder addons, and caretaker of the pyamf script. Contributor to fanart.tv, TheMovieDB and TheTVDB.
Reply
#12
markhoney Wrote:What's the name of your ZOneMinder box? Is it local, or on the internet? Your log shows that the plugin is attempting to connect to a ZoneMinder server called "zoneminder". Is this the name of your server that's running zoneminder? If not, you need to edit the settings for the plugin and tell it the name or IP address of your ZoneMinder server.

Oh, and as it's not a proxy issue you can turn the proxy back on!

Thanks, my hostname is localhost, i edit settings, and now all work!!
Reply
#13
Now i have new problem
Code:
17:11:23 T:3021510528 M:3109953536   ERROR: Playlist Player: skipping unplayable item: 0, path [http://192.168.1.100/cgi-bin/nph-zms?monitor=7&mode=mpeg&format=asf&bitrate=10&maxfps=25]
17:11:23 T:3021510528 M:3109953536  NOTICE: CDVDPlayer::CloseFile()
17:11:23 T:3021510528 M:3109953536 WARNING: CDVDMessageQueue(player)::Put MSGQ_NOT_INITIALIZED
17:11:23 T:3021510528 M:3109953536  NOTICE: DVDPlayer: waiting for threads to exit
17:11:23 T:3021510528 M:3109953536  NOTICE: DVDPlayer: finished waiting
17:11:23 T:3021510528 M:3109953536  NOTICE: DVDPlayer: Opening: http://192.168.1.100/cgi-bin/nph-zms?monitor=7&mode=mpeg&format=asf&bitrate=10&maxfps=25
17:11:23 T:3021510528 M:3109953536 WARNING: CDVDMessageQueue(player)::Put MSGQ_NOT_INITIALIZED
17:11:23 T:2862693232 M:3109953536  NOTICE: Creating InputStream
17:11:23 T:2862693232 M:3109953536 WARNING: FillBuffer: curl failed with code 22
17:11:23 T:2862693232 M:3109953536   ERROR: CFileCurl::CReadState::Open, didn't get any data from stream.
17:11:23 T:2862693232 M:3109953536   ERROR: Open - failed to open source <http://192.168.1.100/cgi-bin/nph-zms?monitor=7&mode=mpeg&format=asf&bitrate=10&maxfps=25>
17:11:23 T:2862693232 M:3109953536   ERROR: CDVDPlayer::OpenInputStream - error opening [http://192.168.1.100/cgi-bin/nph-zms?monitor=7&mode=mpeg&format=asf&bitrate=10&maxfps=25]
17:11:23 T:2862693232 M:3109953536  NOTICE: CDVDPlayer::OnExit()
17:11:23 T:2862693232 M:3109953536  NOTICE: CDVDPlayer::OnExit() deleting input stream
17:11:23 T:3021510528 M:3109953536   ERROR: Playlist Player: skipping unplayable item: 0, path [http://192.168.1.100/cgi-bin/nph-zms?monitor=7&mode=mpeg&format=asf&bitrate=10&maxfps=25]
17:11:23 T:3021510528 M:3109953536  NOTICE: CDVDPlayer::CloseFile()
17:11:23 T:3021510528 M:3109953536 WARNING: CDVDMessageQueue(player)::Put MSGQ_NOT_INITIALIZED
17:11:23 T:3021510528 M:3109953536  NOTICE: DVDPlayer: waiting for threads to exit
In ZoneMinder Plugin i can't see video, but In browser i can see video from camera.
Reply
#14
Sorry for bumping an old thread here but I was wondering if the zoneminder addon is available to atv2 users? I didn't see it in the official repo and wanted to double check before manually installing it. Thanks for any help!
Reply
#15
Has anyone been able to install the ZoneMinder Add-On recently on XBMC on an Apple TV 2?

I find the search for this very frustrating...

Any help appreciated.

Thanks!

MT
Reply

Logout Mark Read Team Forum Stats Members Help
[RELEASE] ZoneMinder CCTV Addon0