XBMC Addon

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
markhoney
Posts: 5
Joined: Wed Nov 03, 2010 9:00 am

XBMC Addon

Post by markhoney »

If there are any ZoneMinder users out there that also use XBMC, you should be able to download an XBMC addon I released recently which allows you to watch streams from your ZoneMinder cameras in XBMC.

You need to be using the (currently beta) XBMC Dharma or newer release to have access to addons. To get the addon, in XBMC just go to Settings, Add-ons, Get Add-ons, XBMC.org Add-ons, Video Add-ons, ZoneMinder. Click on the addon and then click Install.

Once installed, it'll show up under the Videos main menu in the Video Add-ons folder. You can configure the addon to connect to a ZoneMinder server, with configurable cgi and zm paths, and also select the authentication type (plain and hashed authentication are supported).

I'd be especially interested if anyone's able to give the authentication a good thrashing. Hashed authentication seems to work, but at one point adding the IP to the hash was causing problems for me and I never got to the bottom of it. If you have any feedback, please post to this thread.
DREMA
Posts: 162
Joined: Fri Dec 12, 2008 2:39 am
Location: México

Post by DREMA »

Hey man, your plugin is pretty awesome!! Works great on my htpc.
Here's an example to gain some attention.

Image

Cool isn't it?
Is there any way to have a full screen montage view?
Also if you don't mind, I'll add your plugin with some screenshots to the wiki.
markhoney
Posts: 5
Joined: Wed Nov 03, 2010 9:00 am

Post by markhoney »

Glad you like it! You're more than welcome to put it in the Wiki.

Unfortunately, I wasn't able to work out how to create a montage. As I wanted a montage myself, I ended up figuring out how to use VLC to create Webcam streams and generate a montage from them, and wrote another XBMC plugin to make connecting to VLC streams easy. I haven't released the plugin yet, but may do at sometime in the future.
DREMA
Posts: 162
Joined: Fri Dec 12, 2008 2:39 am
Location: México

Post by DREMA »

So, you can watch several cams on one instanse of VLC?? HOW ???
markhoney
Posts: 5
Joined: Wed Nov 03, 2010 9:00 am

Post by markhoney »

You can do it by building a mosaic with VLM. Here's a Wiki page describing the process:

http://wiki.videolan.org/Mosaic

And here's how I create my montage:

Create the file /etc/vlc/vlm.conf, with contents:

Code: Select all

new channel0 broadcast enabled
setup channel0 input v4l2:///dev/video0
setup channel0 output #transcode{vcodec=mp2v,vb=5000,acodec=none}:duplicate{dst=mosaic-bridge{id=0,height=480,width=640},dst=std{access=http,mux=ts,dst=192.168.1.1:8081},dst=std{access=mmsh,mux=asfh,dst=192.168.1.1:8181},select=video}

new channel1 broadcast enabled
setup channel1 input v4l2:///dev/video1
setup channel1 output #transcode{vcodec=mp2v,vb=5000,acodec=none}:duplicate{dst=mosaic-bridge{id=1,height=480,width=640},dst=std{access=http,mux=ts,dst=192.168.1.1:8081},dst=std{access=mmsh,mux=asfh,dst=192.168.1.1:8181},select=video}

new channel2 broadcast enabled
setup channel2 input v4l2:///dev/video2
setup channel2 output #transcode{vcodec=mp2v,vb=5000,acodec=none}:duplicate{dst=mosaic-bridge{id=2,height=480,width=640},dst=std{access=http,mux=ts,dst=192.168.1.1:8082},dst=std{access=mmsh,mux=asfh,dst=192.168.1.1:8182},select=video}

new channel3 broadcast enabled
setup channel3 input v4l2:///dev/video3
setup channel3 output #transcode{vcodec=mp2v,vb=5000,acodec=none}:duplicate{dst=mosaic-bridge{id=3,height=480,width=640},dst=std{access=http,mux=ts,dst=192.168.1.1:8083},dst=std{access=mmsh,mux=asfh,dst=192.168.1.1:8183},select=video}

new background broadcast enabled
setup background input fake://
setup background output #transcode{sfilter=mosaic,vcodec=mp2v,vb=5000,scale=1,acodec=none}:bridge-in{delay=400,id-offset=100}:standard{access=http,mux=ts,dst=192.168.1.1:8085}

control background play
control channel0 play
control channel1 play
control channel2 play
control channel3 play
In my example, I've also setup a background at /etc/vlc/background.png so that if any cameras are turned off there's something interesting to see (I used an aerial picture of my house from google Earth).

Now we need to run VLC and tell it to a) use the config file we created and b) create our mosaic. We do this with:

Code: Select all

cvlc -d -I http --http-host 192.168.1.1:8080 --vlm-conf /etc/vlc/vlm.conf --fake-file /etc/vlc/background.png --fake-aspect-ratio "4:3" --mosaic-width 1280 --mosaic-height 960 --mosaic-keep-picture --mosaic-rows 2 --mosaic-cols 2 --mosaic-position 1 --mosaic-order 0,1,2,3
Now we should have a montage, or mosaic, available over HTTP on port 8080, and our separate cameras available on HTTP from port 8081 onwards. We also have our cameras available on MMS, from port 8181. Of course, remember to change 192.168.1.1 to the IP of the machine you're running VLC on.

If you're interested in doing this, and in having an XBMC plugin to easily connect to your streams, just let me know and I'll look into submitting the plugin to the official XBMC repo.
Last edited by markhoney on Thu Nov 25, 2010 9:17 am, edited 1 time in total.
DREMA
Posts: 162
Joined: Fri Dec 12, 2008 2:39 am
Location: México

Post by DREMA »

I'm trying this with no succes.

What is this address for? "172.22.2.11"

Also tried with the mosaic wizard and I can't get it working.
markhoney
Posts: 5
Joined: Wed Nov 03, 2010 9:00 am

Post by markhoney »

Oops, sorry, those were meant to be "192.168.1.1", I just missed them when changing the IPs from my script. Try replacing them and see if it works for you.
DREMA
Posts: 162
Joined: Fri Dec 12, 2008 2:39 am
Location: México

Post by DREMA »

Yeah I deduced that and another few typos you have in there, but I can't get it working.

Also, do I have to transcode everything? How is the load on your machine with 4 cameras? I will need a mosaic of 23, hehe. Is it posible to have the mosaic and clic any feed to get full screen and then go back to mosaic?

Thanks for your help
markhoney
Posts: 5
Joined: Wed Nov 03, 2010 9:00 am

Post by markhoney »

Can you point out the other typos? I'll fix them in the original post.

Also, you're right that everything's transcoded. With 4 feeds and a mosaic on a Celeron 3GHz, it eats up 80% of CPU. I don't know if shrinking the individual feed dimensions will lessen this, it might be worth trying.
alecano23
Posts: 22
Joined: Thu Oct 23, 2008 1:47 pm

Re: XBMC Addon

Post by alecano23 »

Hi everybody !!

I have A machine with debian, no X11, and vlc-nox (vlc with no X11 version) installed and working . The idea is to build in this machine a viewer to read the jpeg stream from monitor 1 from the zm server.

I tested it in vlc for windows and can successfully play the monitor with this source:

http://zmbox_ip/cgi-bin/nph-zms?mode=jpeg&monitor=4&scale=100&user=admin&pass=password

but when I try to open it in vlc-nox, it says it cant find the jpeg stream.

I suspect I have to add some options in linux....

thanks for the help
alecano23
Posts: 22
Joined: Thu Oct 23, 2008 1:47 pm

Re: XBMC Addon

Post by alecano23 »

I finally got it working by using mplayer on the debian lenny viewer low resources compaq deskpro 2000 machine (Pentium 233Mhz MMX, 128MB RAM, 800MB Hard Disk)

Here are the mplayer options

mplayer -ni -nobps -slave -nocache "http://10.10.10.202/cgi-bin/nph-zms?mod ... format=asf"

My viewer now is showing the mpeg stream at 7fps 640x480 x RGB24 fullscreen at only 35% and 80MB RAM , so I suppoused a P1 100Mhz could be used as a viewer too.

Now my goal is to reduce the CPU, memory and hard disk usage, to get a fully functional viewer with older pcs so we can recicle them !!!!!.
Post Reply